Environment from configmap

Looking at this post it looks like I can use a config map for the environment file, but I think I cant do it through the GUI. I think I will have to use the Deploy raw Kubernetes YAML. If I do it this way would my YAML look like this:

apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh", "-c", "env" ]
      envFrom:
      - configMapRef:
          name: #{Octopus.Action.KubernetesContainers.ComputedConfigMapName}

I would prefer to do it through the UI for readability, but is that right?

Hi Samuel,

I am terribly sorry about the delay in getting back to you.

Your yaml looks absolutely correct.

I also have some good news! There is a kubernetes step available called “Deploy Kubernetes config map resource”. When you click on “ADD STEP” for a project or runbook - type in “kubernetes” within the search box and you will see various kubernetes steps listed.

It has sections for Config Map Names, Items Labels and Kubernetes Namespaces. It will also work with all of the Octopus variables as well as allowing you to use RAW YAML as well.

Again, I am sorry for the delayed reply. If you have any issues getting this implemented, feel free to reach out and I will aim to get a reply back to you much sooner than this one.

Regards,

Dane.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.