GitLab Runner, Kubernetes executor and kubectl to deploy manifest to Kubernetes (K8S)
GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline.
The Kubernetes executor, when used with GitLab CI, connects to the Kubernetes API in the cluster creating a Pod for each GitLab CI Job.
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
Creating a Deployment
The following is an example of a Deployment. It creates a ReplicaSet to bring up three nginx Pods:
Convert kubeconfig file to Base64 format as the Variable.
base64 -w 0 .kube/config
kubectl to deploy manifest to Kubernetes (K8S) in
Waiting for Pod Running
You can use while loop in shell to waiting for Pod status from
base64: invalid input
A likely reason for 76 being the default is that Base64 encoding was to provide a way to include binary files in e-mails and Usenet postings which was intended for humans using monitors with 80 characters width. Having a 76-character width as default made that usecase easier.
-w, --wrap=COLS will wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.
$ base64 -w 0 .kube/config
Variable value is empty
If the variable is marked as
protected, please remember to also mark the corresponding branch as
protected, otherwise the obtained variable value is empty.