Deployment Properties

You can configure properties for deployment parameters, initialization and application containers, environment variables, and resources that manage the deployment and scaling of a set of pods in your cluster. These properties define declarative updates to applications, allowing you to describe the required state for your application, and Kubernetes deploys and manages the specified number of replica pods to meet that required state.

Deployment Parameter Properties specifies the deployment parameter properties:

Table 1. Deployment Parameter Properties
Name Description
deployment.enabled Enables the deployment of the application in Helm chart deployments. The default value is false. Set this to true to deploy the application.
deployment.strategy The strategy for updating deployments. By default, deploymentStrategy is set to rollingUpdate with a maximum surge of 25% and maximum unavailability of 25%.
deployment.nodeSelector Selects the node in which to deploy the application. The default value is {}.
deployment.hostAliases Adds entries to a pod's /etc/hosts file and provides a pod-level override of the host name resolution when DNS and other options do not apply.
deployment.additionalLabels More labels for deployment.
deployment.podLabels More labels added on a pod that are used in the service's label selector. The default value is {}.
deployment.annotations Annotations on deployments. The default value is {}.
deployment.additionalPodAnnotations More pod annotations added on a pod created by this deployment.
deployment.replicas The number of pod replicas to create.
deployment.imagePullSecrets The Secrets used to pull an image. The default value is null.
deployment.initContainers A map of the initialization containers that run before the application containers, where each initialization container is identified by a name key. This key is used to assign the name of the initialization container.
deployment.containers A map of the application containers that run after the initialization containers, where each application container is identified by a name key. This key is used to assign the name of the application container.
deployment.volumes The volumes to be added to the pod, for example:

      volumes:
      default-sideloader-config:
        configMap:
          name: chf-standalone-config
      sideloader-sync-dir:
        emptyDir: {}
#      shared-networkcdr-storage:
#        persistentVolumeClaim:
#          claimName: shared-networkcdr-storage
deployment.revisionHistoryLimit The number of historical revisions to save in case rollbacks are needed.
deployment.tolerations The taint tolerations for nodes.
deployment.affinity The affinity for a pod or node.
deployment.topologySpreadConstraints The topology spread constraint definitions.
deployment.securityContext The security context for the pod.
deployment.terminationGracePeriodSeconds The graceful termination timeout in seconds.
deployment.rbac The role-based access control parameters.
deployment.automountToken Determines whether the service account token is mounted as a volume.

Initialization Container Properties specifies the initialization container properties, where each initialization container in the list is identified by [name]:

Table 2. Initialization Container Properties
Name Description
deployment.initContainers.[name] The names of the initialization containers, for example:
deployment:
  enabled: trueinitContainers:
    init-a
      ...
    init-b
      ...
deployment.initContainers.[name].image The image for initializing the application, for example:
image:
  repository: matrixx-sideloader
  tag: ${mtx-chf.version}
  pullPolicy: IfNotPresent
deployment.initContainers.[name].env The environment variables to be passed to the initialization container.
deployment.initContainers.[name].volumeMounts The mount path for volumes, for example:

      volumes:
      default-sideloader-config:
        configMap:
          name: chf-standalone-config
      sideloader-sync-dir:
        emptyDir: {}
#      shared-networkcdr-storage:
#        persistentVolumeClaim:
#          claimName: shared-networkcdr-storage

Container Properties specifies the container properties, where each container in the list is identified by [name]:

Table 3. Container Properties
Name Description
deployment.containers.[name] The name of the application container, for example, chf-standalone.
deployment.containers.[name].image The image for running the application, for example:

          image:
          repository: sba-5gc-networkfunctions-chf-standalone
          tag: ${mtx-chf.version}
          pullPolicy: IfNotPresent
deployment.containers.[name].command Defines a command for the container. The default value is [].
deployment.containers.[name].args Arguments for the primary deployment container. The default value is --no-colors.
deployment.containers.[name].ports A map of the ports for the primary container, with each port identified by a port number integer key. This key is used to set the containerPort field.
ports:
  # port number
  8080:
    name: http
    protocol: TCP
  # port number
  443:
    name: https
    protocol: TCP
deployment.containers.[name].envFrom Environment variables to be selected from a configuration map or Secret.
deployment.containers.[name].env Environment variables to be passed to the container, for example:

          env:
          MTX_SBA_LOG_LEVEL:
            value: info
          nrf.leaderSidecar.enabled:
            value: "true"
          gateway.externalUri:
            value: https://chf-release-name:443
          gateway.external.kafka.enabled:
            value: "false"
deployment.containers.[name].startupProbe The start-up probe for checking whether the container starts successfully.
deployment.containers.[name].readinessProbe The probe for checking the container's readiness.
deployment.containers.[name].livenessProbe The probe for checking the container's liveness.
deployment.containers.[name].lifecycle Life cycle hooks for the container.
deployment.containers.[name].resources Resource parameters for the container.
deployment.containers.[name].volumeMounts The mount path for volumes.
deployment.containers.[name].containerSecurityContext A security context at the container level.
deployment.containers.[name].terminationMessagePolicy A customized termination message if the application container stops.

Environment Variable Properties specifies the environment variable properties to be picked from the Kubernetes configuration map and Secret configuration sources:

Table 4. Environment Variable Properties
Name Description
deployment.containers.[name].envFrom Environment variables to be picked from the configuration map or Secret.
deployment.containers.[name].envFrom.type The configuration source type: configmap or secret.
deployment.containers.[name].envFrom.name The name of the configuration map or Secret. If this is empty, set it to the application name.
deployment.containers.[name].envFrom.nameSuffix The suffix of the configuration map or Secret. (The appended prefix is the application name.)

Resource Properties specifies the resource properties:

Table 5. Resource Properties
Name Description
deployment.containers.[name].resources The application pod resource requests and limits, for example:

  resources: 
    limits:
      memory: 256Mi
      cpu: 0.5
    requests:
      memory: 128Mi
      cpu: 0.1
This is an example of a deployment properties configuration for a CHF application:

deployment:
  enabled: true
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
  reloadOnChange: true
  initContainers:
    init-contaner
      image:
        name: busybox
        repository: repos/busybox
        imagePullPolicy: IfNotPresent
      env:
        TZ:
          value: UTC
  additionalPodAnnotations:
    kubectl.kubernetes.io/default-container: busybox-chf
    kubectl.kubernetes.io/default-logs-container: busybox-chf
  replicas: 1
  volumes:
    config-volume:
      configMap:
        name: configmap-name
  containers:
    chf:
      image:
        name: chf
        repository: localhost:32000/sba-5gc-networkfunctions-chf
        tag: "5280"
        pullPolicy: Always
      args: [ '--no-colors','--no-wait' ]
      ports:
        80:
          name: http
          protocol: TCP
        443:
          name: https
          protocol: TCP
      envFrom:
        production-cm:
          type: configmap
          nameSuffix: my-configmap
      env:
        TZ:
          value: UTC
      startupProbe:
        enabled: false
      readinessProbe:
        enabled: true
        initialDelaySeconds: 20
        periodSeconds: 10
        httpGet:
          path: /readycheck
          port: operations
      livenessProbe:
        enabled: true
        initialDelaySeconds: 60
        periodSeconds: 20
        httpGet:
          path: /healthcheck
          port: operations
      lifecycle:
        postStart:
          exec:
            command: [ "/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message" ]
        preStop:
          exec:
            command: [ "/bin/sh","-c","nginx -s quit; while killall -0 nginx; do sleep 1; done" ]
      volumeMounts:
        volume-name:
          mountPath: /path1
      resources:
        limits:
          memory: 4Gi
          cpu: 4
        requests:
          memory: 2Gi
          cpu: 4
 containerSecurityContext:
    readOnlyRootFilesystem: false
    runAsNonRoot: false
  securityContext:
    fsGroup: 1000