for deploy stage
Nurlan199206 opened this issue · 1 comments
Nurlan199206 commented
Pls you can describe how to use your image for deploy app from docker hub to kubernetes?
i found on some blog... it is right?
deploy:
stage: deploy
image: dtzar/helm-kubectl
script:
- kubectl config set-cluster k8s --server="${SERVER}"
- kubectl config set clusters.k8s.certificate-authority-data ${CERTIFICATE_AUTHORITY_DATA}
- kubectl config set-credentials gitlab --token="${USER_TOKEN}"
- kubectl config set-context default --cluster=k8s --user=gitlab
- kubectl config use-context default
- sed -i "s/<VERSION>/${CI_COMMIT_SHORT_SHA}/g" deployment.yaml
- kubectl apply -f deployment.yaml
dtzar commented
I generally recommend using helm to deploy pods to your kubernetes cluster instead of kubectl
. There are lots and lots of videos and docs on how to do this. Here is one of them: https://docs.microsoft.com/en-us/azure/aks/kubernetes-helm
I would deem this guidance outside of the scope of the image I maintain...