06 Prepare Kubeconfig file for CI/CD
Since the certificate, don’t match the external ip of your Kubernetes cluster, it wont work. To fix this, we will remove the certificate section, and add a Insecure tag into it.
- To allow connectivity external, without verifying the certificate run
sed "s/certificate-authority-data:.*/insecure-skip-tls-verify: true/g" /home/ubuntu/.kube/config > kubeconfig.yml
This created a new file in your
5.CICD
directory namedkubeconfig.yml
We also need to change the Kubernetes ip from the local to the external, since GitHub actions are running external in our enviroment.
Open
kubeconfig.yml
and change the local ip under server to the public ip of the K8S server (Same port and protocol)