This topic describes the labels that are related to application configurations in clusters of Container Service for Swarm.

Swarm label Description Related Kubernetes parameter Swarm configuration example Kubernetes configuration example How to migrate
name

The name of a Service. This label does not have specific use and can be ignored.

Not supported in Kubernetes - - No need to migrate
image The container image. image - - Automatically converted by Kompose
ports The container ports. containerPort. If your Kubernetes cluster is accessed by external systems, you must create a NodePort type Service. - - Automatically converted by Kompose
environment The container environment variables. env - - Automatically converted by Kompose
volumes The directories or volumes of the host, which are used by a container.

volumeMounts

volumes

For more information, see the Swarm configuration example in volumes. For more information, see the Kubernetes configuration example in volumes. Automatically converted by Kompose
cap_add/cap_drop Grants a container the permissions to modify the kernel or revokes the permissions to modify the kernel from a container. securityContext:capabilities For more information, see the Swarm configuration example in cap_add/cap_drop. For more information, see the Kubernetes configuration example in cap_add/cap_drop. Automatically converted by Kompose
privileged: true

Grants privileged permissions to the root account of a container. If you do not specify this parameter, the root account of a container has only permissions of a standard user.

In a container that starts in privileged mode, you can view devices of the host. You can also mount devices to the container. You can start another Docker container in the container.

securityContext:privileged For more information, see the Swarm configuration example in privileged: true. For more information, see the Kubernetes configuration example in privileged: true. Automatically converted by Kompose
mem_limit The maximum amount of memory that can be used by a container. resource:request/limits For more information, see the Swarm configuration example in mem_limit. For more information, see the Kubernetes configuration example in mem_limit. Automatically converted by Kompose
cpu_shares The maximum number of cores that can be used by a container. resource:request/limits For more information, see the Swarm configuration example in cpu_shares. For more information, see the Kubernetes configuration example in cpu_shares. Automatically converted by Kompose
kernel_memory The same as the related parameter of the docker run command. Not supported in Kubernetes - - No need to migrate
memswap_reservation The same as the related parameter of the docker run command. Not supported in Kubernetes - - No need to migrate
memswap_limit The same as the related parameter of the docker run command. Not supported in Kubernetes - - No need to migrate
shm_size The same as the related parameter of the docker run command. Not supported in Kubernetes - - No need to migrate
oom-kill-disable Specifies whether to disable the Out of Memory (OOM) killer for the container. It is the same as the --oom-kill-disable parameter of the docker run command. Not supported in Kubernetes - - No need to migrate

volumes

Swarm configuration example Kubernetes configuration example
volumes volumes

For more information, see auth-service-deployment.yaml.

cap_add/cap_drop

Swarm configuration example Kubernetes configuration example
cap_add cap_add/cap_drop

For more information, see auth-service-deployment.yaml.

privileged: true

Swarm configuration example Kubernetes configuration example
privileged: true privileged: true

For more information, see auth-service-deployment.yaml.

mem_limit

Swarm configuration example Kubernetes configuration example
mem-limit mem_limit

For more information, see config-deployment.yaml.

cpu_shares

Swarm configuration example Kubernetes configuration example
cpu_shares cpu_shares

For more information, see config-deployment.yaml.