kubeconfig
kubeconfig is the file that permits to connect to a Kubernetes cluster.
How To
Section titled “How To”How to see the kubeconfig file
Section titled “How to see the kubeconfig file”kubee kubectl config viewHow to test a connection
Section titled “How to test a connection”kubee kubectl cluster-infoHow to encrypt
Section titled “How to encrypt”We allow encryption with pass
Check expiration
Section titled “Check expiration”kubee cert config-clientExample of expired cert
0: CertificateCertificate: Data: Version: 3 (0x2) Serial Number: 6180918950649418648 (0x55c70909a6f05398) Signature Algorithm: ecdsa-with-SHA256 Issuer: CN=k3s-client-ca@1719221384 Validity Not Before: Jun 24 09:29:44 2024 GMT Not After : Jun 24 09:29:44 2025 GMTHow to take a new k3s config if expired
Section titled “How to take a new k3s config if expired”- Grab the file
/etc/rancher/k3s/k3s.yamland copy it to$HOME/.kube - Modify the
serverproperties with your server ip - Test
KUBECONFIG=~/.kube/k3s.yaml ./kubee kubectl cluster-infoMore info: https://docs.k3s.io/cluster-access
Optionally:
- you can rename it to the default:
$HOME/.kube/config - you can update the client cert if you use pass to store it
# set your namesKUBEE_PASS_HOME=kubeeKUBEE_CLUSTER_NAME=beau # cluster nameKUBEE_USER_NAME=default # user name
# Save the new clientKUBECONFIG=~/.kube/k3s.yaml kubectl config view --minify --raw --output 'jsonpath={$.users[0].user.client-certificate-data}' | pass insert -m "$KUBEE_PASS_HOME/users/$KUBEE_USER_NAME/client-certificate-data"KUBECONFIG=~/.kube/k3s.yaml kubectl config view --minify --raw --output 'jsonpath={$.users[0].user.client-key-data}' | pass insert -m "$KUBEE_PASS_HOME/users/$KUBEE_USER_NAME/client-key-data"
# Test./kubee kubectl cluster-info