During a search on updating PODs in a Kubernetes cluster I found a Jenkis plugin called kubernetes-cd, however, I am in doubt about how to establish a secure connection with the plugin and Kubernetes and would like to know how to set up a user and password or register an ssh key in the cluster that allows this external connection?
I found in the Kubernetes documentation on Secrets(link), but I'm not sure if it serves only for internal cluster authentication or if it serves to set up accounts for plugin connections or other external media.
Kubernetes-cd 3 options are supported:
~/.kube/config
file through an SSH connection to the master node.You need configure ~/.kube/config on you runner.
Example:
echo "$KUBE_CA_CERT" > /ca.pem
kubectl config set-cluster cluster --server=${KUBE_MASTER_URL} --certificate-authority=/ca.pem
kubectl config set-credentials user --token=${KUBE_TOKEN}
kubectl config set-context context --cluster=cluster --user=user
kubectl config use-context context
$KUBE_CA_CERT
- usually lies on the master /etc/kubernetes/ssl/ca.pem
$KUBE_MASTER_URL
- you kubernetes master url with port$KUBE_TOKEN
- you token, how get it - Kubernetes Dashboard access using config file Not enough data to create auth info structure.