Skip to content

Instantly share code, notes, and snippets.

@zarelit
Created April 5, 2024 09:40
Show Gist options
  • Select an option

  • Save zarelit/d08ad9d3d064cf6122eb4508f1a46945 to your computer and use it in GitHub Desktop.

Select an option

Save zarelit/d08ad9d3d064cf6122eb4508f1a46945 to your computer and use it in GitHub Desktop.

Revisions

  1. zarelit created this gist Apr 5, 2024.
    8 changes: 8 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    **Build environment variables on the values of other variables**

    https://kubernetes.io/docs/tasks/inject-data-application/define-interdependent-environment-variables/

    **Expose introspection information to pod**

    https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/

    28 changes: 28 additions & 0 deletions downward-test.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: downward-test
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: nginx
    template:
    metadata:
    labels:
    app: nginx
    spec:
    containers:
    - name: nginx
    image: nginx:latest
    envFrom:
    - configMapRef:
    name: my-configmap
    env:
    - name: DAT_NAMESPACE
    valueFrom:
    fieldRef:
    fieldPath: metadata.namespace
    - name: TEST_URL
    value: "https://$(DAT_NAMESPACE)"