How to pass my Docker credential before/while running e2e tests on Kubernetes How to pass my Docker credential before/while running e2e tests on Kubernetes kubernetes kubernetes

How to pass my Docker credential before/while running e2e tests on Kubernetes


Welcome to community!

From kubernetes perspective it's possible to pass environment variables to containers running in pods. You'll need to specify them in your yaml file for pods.Here is an example from kubernetes documentation:

apiVersion: v1kind: Podmetadata:  name: envar-demo  labels:    purpose: demonstrate-envarsspec:  containers:  - name: envar-demo-container    image: gcr.io/google-samples/node-hello:1.0    env:    - name: DEMO_GREETING      value: "Hello from the environment"    - name: DEMO_FAREWELL      value: "Such a sweet sorrow"

Please find k8s documentation on how to set it up - define environment variable for containers

Once you manage with this part, you should consider doing it securely. For this matter it's advise to use kubernetes secrets.

In this kubernetes documentation (Distribute Credentials Securely Using Secrets) you will find all steps and examples on how you can do it.

Keeping this in mind, there might be other solutions build-in in e2e ginkgo solution.