Skip to content

Resolve "Inject Secrets into Runners"

Madou Coulibaly requested to merge 354-inject-secrets-into-runners into main

What does this MR do?

Inject a Secret or a ConfigMap as Environment Variables in the Runner Deployment manifest

Why was this MR needed?

To add the possibility to inject a Secret or a ConfigMap as Environment Variables in the Runner Deployment manifest

What's the best way to test this MR?

  1. kubectl create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret
  2. kubectl create configmap my-config --from-literal=key3=superconfigmap --from-literal=key4=topconfigmap
  3. Edit the values.yaml to add
    envVars:
    - name: VAR1
        value: clearvalue
    - name: SECRET_KEY1
        valueFrom:
        secretKeyRef:
            key: my-secret
            name: key1
    - name: SECRET_KEY2
        valueFrom:
        secretKeyRef:
            key: my-secret
            name: key2
    - name: CONFIG_MAP_KEY3
        valueFrom:
        secretKeyRef:
            key: my-config
            name: key3
    - name: CONFIG_MAP_KEY4
        valueFrom:
        secretKeyRef:
            key: my-config
            name: key4
  4. helm install
  5. Check that the environment variable as well-defined in gitlab-runner deployment manifest and inside the pod.

What are the relevant issue numbers?

Closes #354

Merge request reports