The aim is to implement Continuous Deployment (CD) to a k8s cluster.
It works to deploy a Nginx image to the k8s.
kubectl run my-nginx --image=nginx --replicas=2 --port=80
When the same command is run in a CD tool then it complains that it cannot find the cluster. Off course it is possible to copy the
~/.kube/config, but is that recommended?
When the Kubeconfig is stored in a variable and kubectl is run by bitbucketpipelines then the following error is thrown:
error: Error loading config file "/root/.kube/config": yaml: mapping values are not allowed in this context
Inspecting the files turns out that the whole file consists of one line instead of multiple.