Skip to content

Latest commit

 

History

History
150 lines (127 loc) · 18.9 KB

kubeconfig.md

File metadata and controls

150 lines (127 loc) · 18.9 KB

Kubeconfig Nedir?

Kubernetes clusterlarımıza kubectl ile (veya geliştirdiğimiz bir uygulama tarafından) erişmek istediğimizde, cluster bilgilerini barındıracağımız bir yere ihtiyacımız var. Kubeconfig tam bu noktada karşımıza çıkıyor. Default olarak ~/.kube/config pathinde yer alır fakat istersek kubectl'e farklı pathlerde kubeconfig belirtebiliriz.

Örnek bir kubeconfig dosyasına göz atalım. Aşağıda paylaştığım kubeconfig localimde çalıştırdığım kind clusterına ait:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJd01USXdNVEV4TWpBek1sb1hEVE13TVRFeU9URXhNakF6TWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTis4CjRkOGJ1ZTlDS0xjbFJMbzBkby81bmRRQnNqWmlMQVNJRkVBNXRKb0ZZMzY2N1pkNVpiZWt6QjJXNjNuNlJLcE4KZEQ1SXZHOTk4SHNDcUsvcHgvb0lpY2l4VHdFcFU3a0ErNjlidCtDM2J6Rjd6VmZGNkZXSFA4VnM1VWpUaUtYego3MEYwbGJNWFdvVlBOVk91V2V6U2ZNVnl1WHpUSW8zbTljM2tuZ2RSM2lWeTVWMndvbUgwL3VOUVV5Yk5vMldiCkhnNVpNSVZ3MlRMT3NlTGcvRjlPZUZkMTlPYnZTVU1tSmNYMWFoQzhiYk1WWHhpNWJpbEdYemp3Q3JDZFNZU1AKMTgyTnJGbmo4Vk1tOTV6VDFpem1uOGU2R1pDVjdlV0t2anBTZzN0VVUvaWZ5SjRkNU1VbUZjSDZ5ZmJPSHBPRgo3Z0g1ODdYN3dGR0lGNDJKUjlrQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFHdERnRVZTbml0b3ZGa2k4Y0ZINnRYVEo2SGsKcS9tZjlYUTJIR2xaamR6cGFoOEtaN0NseTJFdDczUUthQVYvTkRQUWx4SFV3OFphbnhXWVZXeis4NEtQc0dhaApuQ1hPb1l4cGZOTEFPQ1V2cTJLQW9mU1FjZFRaRE5SK1N3NUNkdVByYU5NZDZXZXpBV2tsMHlHY3FLWnVVaTlMCk1ZSEJyU3dkeWlhdWI0a2NpeTJJSHVIVVFPNjM1eEgzbkswM1BtOE5RVGEyTjZiMyt6SWRlSEtRZ1Zpd3U2SXUKcHNmaEdKdjlxakpOdEFmUGRsRGxTV1ZzS0lDcWlTemxmaDF1SVdEU3hZb1V3V3BVajVDWnVrTnMxWlBoRGZIUAo1L0JjKzhrL1dlOHBhSEdiQzVJdWUwdk0vb2IweWFTQW1yL1k4ZzVOdHhWZmg3eWlFSExRVDVna1ZuYz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    server: https://127.0.0.1:32771
  name: kind-local
contexts:
- context:
    cluster: kind-local
    user: kind-local
  name: kind-local
current-context: kind-local
kind: Config
preferences: {}
users:
- name: kind-local
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJT2pDRVdVblo5Zzh3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURFeU1ERXhNVEl3TXpKYUZ3MHlNVEV5TURFeE1USXdNelJhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1S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aFF1clNVNEhwY1VycE4wK1JJbkRMbGRTdVR5Ri9XVU11d28yR0RDc2xwSnBPdHkKVEU1SlVtd2hFWFhSYnRDU0JSbFBjNXVBcXp1NlU0ZjB1bkdURUFVNEtTYklDWUE3WGtEaCtJdVZtZm5mb2pETQowZVExV1ZkVU1TWVVvR2NPZ2szNVZlNGtjWS91K1l2eFg2dGxTZVFFRXdPWkk2enI3N2NGT0IwPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

Genel itibari ile üç önemli alan bulunuyor. Cluster, context ve user bilgileri. Bunlar dışında current-context alanı kubectl komutlarının uygulanacağı contexti belirtiyor. Bütün contextlerimizi listelemek için kubectl config get-contexts, çalışacağımız contexti seçmek için kubectl config use-context <context-name> ve seçili contexti görüntülemek için kubectl config current-context komutunu kullanabiliriz. Aynı zamanda kubectx toolu yardımıyla bu işlemleri kolaylıkla yapabiliriz.

Cluster

Cluster alanı server ip adresi, varsa certificate-authority ve cluster ismini barındırıyor.

Context

Context alanı bağlanacağımız clusterı seçebilmek için ilgili cluster ismini, clustera bağlanacak user ismini ve contextin ismini barındırıyor. Aynı cluster için farklı userlar ile bağlanmak istediğimiz bir durumda, cluster alanında belirttiğimiz isim için farklı contextler oluşturarak bağlanmayı sağlayabiliriz.

User

User alanında bağlanacağımız clusterlara ait user bilgileri bulunuyor. Bu bilgiler cluster için ayarlanan user/service account bazında farklılık gösterebilir.

Örneğin yukarıda paylaşılan kubeconfig certificate ile authenticate olurken aşağıda paylaştığım config içerisinde token ve username&password ile authenticate olunuyor.

  • Token Authentication
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CR1WbpFS21VWDlWUTlOc0pzODlKWWUKQjRnVHo0S1R0SGo5b2NhYVNjNmRuZ3dzV3ZXZlI5VHRYOW9HS0dWVHJybFovRzUvZmZON3l6VXVXVHlQL0FmcQphTmpaVW1xTnBNUHhjRzJuYkhiMEJYM1FPWjh4L2pNRFlMY05wlpPVE1lcVhEVnkQ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HQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS2lFCY201bGRHVnpNQjRYRFRJd01EWXhNREE1TlRBekQo=
    server: https://127.0.0.1:32771
  name: kind-local
contexts:
- context:
    cluster: kind-local
    user: kind-local
  name: kind-local
current-context: kind-local
kind: Config
preferences: {}
users:
- name: kind-local
  user:
    token: eyJhbeyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvGciOiJSURTdCN3FDNVhsclhSUXRidkI4c2sifQ.dW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiMjNlZjZkNmQtOTUyNy00YzI1NiIsImtpZCI6IjFqSGMwTjBXalVKSVFZV0dYY3hhaFd3jc3LTg2OWQtYTkwOWZmMGZlYThlIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmRldmVsb3BlciJ9.c_Vt3Yszd5u8Fdt4HHDtdZC4hoC5wpryBJUYucmV0Lm5hbWUiOiJkZXZlbG9wZXItdG9rZW4tZjd2dGciLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGV2ZWxvcGVyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWbwovwvc9Su4GtehZ4LmfcpJMqRxyZAZeZSSAnLTIgG4CGBlwjevPl2ir3PN8YVNXTB19uP79M2D4peY4pZxIpJp1gsyshqO_7Ox0qPDTaRWpGbK0RXlpBEo-s-SxY9Jfsh8QEQygb1iv4hxKe4-R_jbD-4LiroA8PkDCwF8oN2mpxyJUIK59JS8SH2ayX_PiTQiuX458T3L5upDvHK2f8OD_ehjkN0nWeIN-omsT-vOiduVVnRf7T6TItorxNGJQ6C21CNvorV9XScRHMUHRAVFMcSUlSDPX0fZoadxW3Q0dhApFD
  • Username Password Authentication
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:32771
  name: kind-local
contexts:
- context:
    cluster: kind-local
    user: kind-local
  name: kind-local
current-context: kind-local
kind: Config
preferences: {}
users:
- name: kind-local
  user:
    username: developer
    password: developer

Multi-cluster Kubeconfig File

Birden fazla cluster ile çalışırken kubeconfig dosyamızın nasıl bir yapıya sahip olduğunu göstermek amacıyla yukarıdaki örneklerde gösterilen clusterları bir araya getiren multi-cluster config'e göz atalım:

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:32771
  name: kind-local-1
- cluster:
    certificate-authority-data: LS0tLS1CR1WbpFS21VWDlWUTlOc0pzODlKWWUKQjRnVHo0S1R0SGo5b2NhYVNjNmRuZ3dzV3ZXZlI5VHRYOW9HS0dWVHJybFovRzUvZmZON3l6VXVXVHlQL0FmcQphTmpaVW1xTnBNUHhjRzJuYkhiMEJYM1FPWjh4L2pNRFlMY05wlpPVE1lcVhEVnkQgQ0VSVElGSUNBVEUtLS0tLUdJTiBFbU9PSXdjRmcrdBVRGt6ZHNCbFdVSkJWYzltZ0V3Z2hLZ3h2M1k2VkMrMk8xazUvCkI1OXBwdHEwRWI3bGhLd25DOTAvSG9oR1pkSDlRbVhFWW56bUExOEl0YnZpQlJobWNKWDVteERZQUFwVHgKbmZSTUdQTjMvTVZ5QXZMMDl4dmpFM3lBYithVTZCS2hGdnQ2bnVnK0RJcDdad0NuZlVMcERPMVFMUGhsL3VSNQpVYXkzT1N6TXE0Z3pIa0lPbVVrQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFCY2g1Umx0R2h4WVl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dWUwdk0vb2IweWFTQW1yL1k4ZzVOdHhWZmg3eWlFSExRVDVna1ZuYz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    server: https://127.0.0.1:32771
  name: kind-local-3
contexts:
- context:
    cluster: kind-local-1
    user: kind-local-password
  name: kind-local-1
- context:
    cluster: kind-local-2
    user: kind-local-token
  name: kind-local-2
- context:
    cluster: kind-local-3
    user: kind-local-ca
  name: kind-local-3
current-context: kind-local-1
kind: Config
preferences: {}
users:
- name: kind-local-password
  user:
    username: developer
    password: developer
- name: kind-local-token
  user:
    token: eyJhbeyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvGciOiJSURTdCN3FDNVhsclhSUXRidkI4c2sifQ.dW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiMjNlZjZkNmQtOTUyNy00YzI1NiIsImtpZCI6IjFqSGMwTjBXalVKSVFZV0dYY3hhaFd3jc3LTg2OWQtYTkwOWZmMGZlYThlIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmUtc3lzdGVtOmRldmVsb3BlciJ9.c_Vt3Yszd5u8Fdt4HHDtdZC4hoC5wpryBJUYucmV0Lm5hbWUiOiJkZXZlbG9wZXItdG9rZW4tZjd2dGciLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGV2ZWxvcGVyIiwia3ViZXJuZXRlcy5pby9zZXJ2aWbwovwvc9Su4GtehZ4LmfcpJMqRxyZAZeZSSAnLTIgG4CGBlwjevPl2ir3PN8YVNXTB19uP79M2D4peY4pZxIpJp1gsyshqO_7Ox0qPDTaRWpGbK0RXlpBEo-s-SxY9Jfsh8QEQygb1i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OE5CUm9ORmtjc2p6VzcrSUVzbHZpNDByM09FSmdLdzlNUDJvdFZiNTNVdGFyNkhwMQozajdQblhQUkRqQzF4UVI2T0MxMGE5RlBPRG5vL2dUWWhNL3pIQWFpdksrRnAxcTBRMEVqUTV2OWRTTGVFbjlrCnFYczBvVGMvZ2dZNllvQm9UazBPWkYwQ2dZRUFpMWZGMFBJaXhFSlZlMkZ3eWxOckpwZ3pDdW5helZFMWVDcksKUnJGOU1KVVNnWWVTRDU4VE1aNzBiTjlBS2pKWEQ3VnZCdCtIQmhOcGY2MGpaUVBDVVdtUFA3bFN6bmEreE1WRwpocmdhaGJ2QjlJTVhkZzNiSDdZR004ZDEvNmlYYTRndGhuaE9xQml4RUwreG03UVp4c0RkVSttZDh5aWxaQ3ZBCnNpaWdiRVVDZ1lFQXZoWDRoaFF1clNVNEhwY1VycE4wK1JJbkRMbGRTdVR5Ri9XVU11d28yR0RDc2xwSnBPdHkKVEU1SlVtd2hFWFhSYnRDU0JSbFBjNXVBcXp1NlU0ZjB1bkdURUFVNEtTYklDWUE3WGtEaCtJdVZtZm5mb2pETQowZVExV1ZkVU1TWVVvR2NPZ2szNVZlNGtjWS91K1l2eFg2dGxTZVFFRXdPWkk2enI3N2NGT0IwPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

Kubectl Kubeconfig Path Belirtmek

Kubectl ile çalışırken birden fazla kubeconfig dosyasını kullanmaya ihtiyacımız olabilir. Bu gibi durumlarda farklı config dosyalarını belirtebilmek amacıyla --kubeconfig parametresini kullanabiliriz.

kubectl get pods --kubeconfig=</.kube/another-config>

Aynı zamanda bulunduğumuz session içerisinde --kubeconfig parametresini tekrar tekrar yazmamak amacıyla export KUBECONFIG=<path> şeklinde environment variable ile de config pathimizi belirtebiliriz.