Having some trouble finding this information. For example if my Kubernetes is already hooked up in the dashboard and I have in .gitlab-ci.yml
:
deploy_staging:
stage: deploy
script:
- echo "Deploy to staging server"
environment:
name: staging
url: https://stage.mywebsite.com
only:
- gitlab
That isn’t enough, right? Would I have to do add the kubectl apply
like:
deploy_staging:
stage: deploy
before_script:
- do
- kubernetes
- authentication
- stuff
script:
- echo "Deploy to staging server"
- kubectl apply -n stage -f mydeployment.yaml
environment:
name: staging
url: https://stage.mywebsite.com
only:
- gitlab
And do I even need to authenticate when it’s already in the dashboard with the proper K8s API url and token?
What’s the actual pipeline look like to deploy? Haven’t seen an example that uses kubectl create/apply
.