Lili
Lili

Reputation: 121

add configMap to deployment config on openshift 4

enter image description hereIve recently started using openshift 4 and im a bit lost. I have a running pod and I created config map for it but I cant find a way to conect the two. Ive been told to add the config map to the deployment config of the pod in a specific path. I tried editing the pod's yaml file to add the file as a volume but got an error when I tried to save the changes. anyone has an idea how can I add the config map file so I can access it in a specific path in a pod?

Upvotes: 1

Views: 2979

Answers (1)

Nataraj Medayhal
Nataraj Medayhal

Reputation: 1221

The example of adding configmap as a volume to a pod is explained in official kubernetes documentation

Below is the sample

    volumeMounts:
      - name: config-volume
        mountPath: /etc/config
  volumes:
    - name: config-volume
      configMap:
        # Provide the name of the ConfigMap containing the files you want
        # to add to the container
        name: special-config

Upvotes: 1

Related Questions