Deployment Object

A deployment includes the definition of a set of containers and the desired behavior in terms of number of replicas (underlying ReplicaSet) and deployment strategy.

  kind: Deployment
  …
  spec:
    replicas: 1 (1)
    …
    strategy:
      type: Recreate (2)
      …
    template:
      …
      spec:
        containers:
        - name: tibemsd-container
          image: ${EMS_IMAGE_LOCATION}
          imagePullPolicy: Always (3)
          env: (4)
          - name: EMS_NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: EMS_PUBLIC_PORT
            value: ${EMS_PUBLIC_PORT}
          …
          args: (5)
          - tibemsd
          livenessProbe: (6)
          …
          readinessProbe: (6)
          …
          ports:
          - containerPort: ${{EMS_INTERNAL_PORT}}
            name: tibemsd-tcp
            protocol: TCP
          …
          securityContext:
            runAsUser: ${{EMS_UID}} (7)
          …
          volumeMounts:
          - mountPath: /shared (8)
            name: tibemsd-volume (9)
        …
        restartPolicy: Always (10)
        …
        volumes:
        - name: tibemsd-volume (9)
          persistentVolumeClaim:
            claimName: ${{EMS_PVC}} (11)

(1): The number of replicated pods: 1, since we want a single instance of the EMS server.

(2): The deployment strategy: Recreate means that an existing pod must be killed before a new one is created.

(3): Determines if the EMS Docker image should be pulled from the Docker registry prior to starting the container.

(4): Environment variables that will passed to the container.

(5): Arguments to be passed to the Docker ENTRYPOINT. For more information, see EMS Server Configuration.

(6): For details on the liveness and readiness probes, see Liveness and Readiness Probes.

(7): The uid the container will run as.

(8): The path where our NFS shared folder will be mounted inside of the container.

(9): The internal reference to the volume defined here.

(10): The pod restart policy: Set such that the kubelet will always try to restart container. If the EMS server stops or fails, its container will exit and be restarted.

(11): The name of the PVC created by the cluster administrator.