Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically create kubectl config #8

Open
Jules-7 opened this issue Aug 3, 2023 · 0 comments
Open

Dynamically create kubectl config #8

Jules-7 opened this issue Aug 3, 2023 · 0 comments

Comments

@Jules-7
Copy link

Jules-7 commented Aug 3, 2023

Docker workflow (actions) contains a kubectl step, which is necessary to restart API deployment when a new Docker image is built and pushed.

To properly function, kubectl needs a config file:

 - name: Install and configure kubectl
   uses: actions-hub/kubectl@master
   env:
      KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}

KUBE_CONFIG is a base64 representation of configuration obtained with: az aks get-credentials --resource-group dh-notify-rg --name dh-notify-aks.

Having KUBE_CONFIG hardcoded into secrets is not a problem unless the resource group (dh-notify-rg) or cluster name (dh-notify-aks) change.

In order to avoid having to manually replace the secret (which is not that much work), a step can be added to the workflow to obtain the configuration and update the secret in the repository (for inspiration check this docs https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant