Salvatore Calla'
Salvatore Calla'

Reputation: 153

How to use kubeconfig as environment variable in GitLab

I'm creating a GitLab CI/CD pipeline to deploy an application to Azure Kubernetes Services.

  1. How can I specify a kubeconfig file as environment variable?
  2. How can be used in the pipeline?

Upvotes: 2

Views: 7410

Answers (1)

jenigen
jenigen

Reputation: 147

Use the Project/Settings/CICD/Variables section and add a variable there with type "File"enter image description here

Then you can use it in the pipeline:

  before_script:
    - export KUBECONFIG=$KUBECONFIG_FILE

Upvotes: 4

Related Questions