Skip to content

Latest commit

 

History

History
159 lines (133 loc) · 22.9 KB

k8s-context管理.md

File metadata and controls

159 lines (133 loc) · 22.9 KB

如果有两套k8s集群, 修改 conf 文件

# 查看第一个 k8s 集群 /root/.kube/config
$ /root/.kube/config
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1USXdOekF5TWpVd09Wb1hEVE14TVRJd05UQXlNalV3T1Zvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTGNpCkZmRDk1WWhjR0tkTGJ6VjVDNmpDVCthN09hWW0yNDFTTnpFMmVTeWNsZEE3YXZnZHQ2elB4RDY3Y2xuTXlxZ04KT2VtUUVUT3pyNitnR21LNzBmZHg4SDFZaVVXVXpJSjFkKzFUT3pSelM2SnkvdUpnaHRrR1dtdll4RjhWenVhcQpGY2MweUhFNzJ3NmJQemNPdk5FQVJaOVJseDE3RkxQdkZIL29pWFIreUo5MUlLU0NGdW5ld0l2WFRIRXB2K2tICmcydTQ3T0ttYzdXeTZFY1ArVWFyNUJwNytFNU12VTNFZCtmLzdFeVFwRE15WWU0NEdvdk5jQmxSTUQ1NGRwaU4KRzdod29BbmZUdGg1a1QzeUpUUmVINUZTSytNRWFDNEEyVFovV2Qwc0EwS0VVYjd6cm9BUUl3Q3BpRmV3V0VtVgpxZ3NuZDZBbEdjdmk1Y1ZacTNzQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZNVzU4ZlhlcHNyMVcwbmtuamh4S2s4aDZqUzBNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCMTJkSXhFQVVsNkpsRXkzcUN1NkRvZ0lTMU8rY1NaZUhVRHd6dEt6bm5sZUJ6YmlZWQo0VnVOZzlHYk93dWlMZW4rdldtOVlOWGhnSEI5a1Y1NlgzV0VrY3JpTDA0TzhzUjVvNFNmbG82TnMybStXTElMClpVM2VVUEhGUGdrWlZVbmVXdVpaaENnemxZa2c0c1ZJaG1MT0lGY3VIQmdURmVWS00yTldKZDM0NmhPcm9uOFcKUk1TbDdIK2llNm9sQ0VMT3hvbWlTb3k4VHVHejh5c20yTzFEbWpwUkJJeWFFNy95QjhWRmMreXBCaVl2TE9vcApsYlAyakM3NjNTaCt0dVZibzFOMGZIdUtYa2FnYVZ6ZlQ5eXVpR1VVRFJjQ0xEcllZeUJoakpSaC9tL3pqOVJQCmlLRGlzcnF2R0xWR3dxaHk3UEFra21UeHRtWVM0dVR3RTlRVgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://192.168.1.122:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lVV3IwWHNkYkdvVVE2ek52dDZLM2prcGJIamdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweU16QTJNakF3TnpVeE1qZGFGdzB6TXpBMgpNVGN3TnpVeE1qZGFNRFF4RnpBVkJnTlZCQW9NRG5ONWMzUmxiVHB0WVhOMFpYSnpNUmt3RndZRFZRUUREQkJyCmRXSmxjbTVsZEdWekxXRmtiV2x1TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0F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VYc090VWFhUEh2blRMWUh0M0hNVVp0Sgp5Rlcrb1ptWGFmNUlnOE5GKy9OVGdWTGVFa0xUV3RWRnR0SWxjRWZNWndBNms4OWthWlord1E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=
    
# 查看第二个 k8s 集群 /root/.kube/config
$ vim /root/.kube/config
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1USXdOVEUxTXpZek0xb1hEVE16TVRJd01qRTFNell6TTFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTFM2Cm5Yd1RRa20wRlpNdjcwMUd4d1M0dit0bzZBczZ1cEg1NEt1OEdiNVB1L3pMMndIOEJjSVZhd1oyeUU5Um54dnUKYkF3R2lHZk11a1FXaEhqRWtyNHY5SGZBODlkY00xSFh6NmFKNU9UaUZpY24yRmlUMWI5TnhvczB6U2t5VWpNVQpIYUZwK1FNSzdSM1NiUjNnMEVveXh6MUtoWFY2Z054UkZlYkZFRnVwUGR6eHgvUWdSRUhocjlyazhIVUFOL2tKCk1xTWFuTnB4bS9mYmZWT3VvNU9heEpjZ1RvK2R6U3N2WTViOVYraVVsSVRZblBad2xsK2pYQ0xFS1FLYmlNS1YKWTB6ZitVVzRVK1hNcUMrL2RuT3ozaDcrRnd1UXdGckZkY2VidFhmNkk0NlhvWHZSUXJRd1pTOEp0MjVOYUdFYgpYeW9jUFFRckxFVTJCN1FhZ29zQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZPSHlVejVMNHd0SGt3NjZvK1JzYUIzR0p4Z0ZNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFDb0JuM0ZyRTVFMmZCWm1XK0YzemtQUFhMcjVJVEljQzRhOUpiOXVWb296Vjdkd1ZwdwovNUZTWXQ2ckJNSHkxQzF0Vm9wMzMxRGRYaFJ3NDR3NXN2MnpGSDZVNGVNeC9qeENGL25UNUsvWlN4UDdoN2lvCmNOV2Njc0FwNng4Wi9mRHpFK214MEdzZ08vYzB2NzNqcTlCbk5ySkwvNy9YeVRWbVpMN0pMbERyeFh1cDZEK3IKN1RmSUdIejVuUHUyQjJ5UXNxYW51RTJ2OHFidG5TN3lJcWF3bWlTMFNZOVU1OW9hN3NmWVBSVHgxM2tMWkM2dApBOWU4dlFwWk1ad09WYU5PTGpmSjN2Um9lb01POWhKK1EzUzRQZkdZKzBGcSs3TjMxZEl6WVZVdWpIUG5qV1RVCjY3WUVJTlN1S05HdGNUZ2ozMTFoWTNoMUo4cDhweXRLSmlIdwotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://192.168.1.122:6444
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lVTlQ3VXZCWmJKaHRocnRQeC9UbmxITThISG1nd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweU16RXlNRFV4TmpReE1ERmFGdzB6TXpFeQpNREl4TmpReE1ERmFNRFF4RnpBVkJnTlZCQW9NRG5ONWMzUmxiVHB0WVhOMFpYSnpNUmt3RndZRFZRUUREQkJyCmRXSmxjbTVsZEdWekxXRmtiV2x1TUlJQklqQU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https://192.168.1.122:6444
  name: kubernetes-new
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: k8s1
- context:
    cluster: kubernetes-new
    user: kubernetes-admin-new
  name: k8s2
current-context: k8s1
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lVV3IwWHNkYkdvVVE2ek52dDZLM2prcGJIamdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweU16QTJNakF3TnpVeE1qZGFGdzB6TXpBMgpNVGN3TnpVeE1qZGFNRFF4RnpBVkJnTlZCQW9NRG5ONWMzUmxiVHB0WVhOMFpYSnpNUmt3RndZRFZRUUREQkJyCmRXSmxjbTVsZEdWekxXRmtiV2x1TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEKNE14d01ZYmJpMjB6NDlSOGw0N0k3TzV3TFQxZ3ZQcE5aN3R0REt4M3VCb0VsUlFYUnRRZ1dhRWVLZ1VKUjBDYgpQNVVMcU0relN1MmVXWlBLczVMR3NnZDAvVTVRSzZ5MTFZdVVpSjBKbWpwblJBVGhpUmkva2l2c2xYRUh0aFA0CmtUaFNUNmhaemV1aStPQUdpMEZsblVTWndESFFtSndoVVR0NUpxQmYzQzZqN2FERHNkTFltZDA2VHFvQy85eVQKQllyOEVrVTNQV1N5d1ZMcWgxZDVXV0F2dkl6NnZIVXBhNnlwS3dhR01xbUtkbEVYd1FjVjBMaTdDcXRkaDlYYQpwOGlpSUgzQWNHbnlsZW9uVlhMVnBGZDBvblZBeUo1VGFLcjR5NEV0WDVCd3FLUUVXaDFVL2ZZOTJQNUo0WDBrCkNYbU5CMTRQYUhBWUFPWDJyMmVRT1FJREFRQUJveWN3SlRBT0JnTlZIUThCQWY4RUJBTUNCYUF3RXd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SjZobXVmd08vVGkKUTE2ZG84Rkd4NUhKdzh1d05jS3kyUDVsdVVRMWp0YnNMTXRLTGVtN0ZKR2J0RThiZ1dGTVg4UisyNGoyZmZYVwpJc2kzSEkyczhVQnAvdmNQZWt1cUc0MVBTaitGQ1VOUHhSNHB2Q2J4UHRPNDBhYlZXSlU9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==

切换上下文:

$ kubectl config --kubeconfig=/root/.kube/config use-context k8s2
or
$ kubectl config use-context k8s2
Switched to context "k8s2".

查看当前上下文

$ kubectl config current-context
k8s2

查看指定上下文配置信息

$ kubectl  config get-contexts k8s2
CURRENT   NAME   CLUSTER          AUTHINFO               NAMESPACE
*         k8s2   kubernetes-new   kubernetes-admin-new

只看当前上下文的配置信息

$ kubectl config  view --minify
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://192.168.1.122:6444
  name: kubernetes-new
contexts:
- context:
    cluster: kubernetes-new
    user: kubernetes-admin-new
  name: k8s2
current-context: k8s2
kind: Config
preferences: {}
users:
- name: kubernetes-admin-new
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED

清理 context 信息

删除用户

$ kubectl --kubeconfig=/root/.kube/config config unset users.<name>

删除集群

$ kubectl --kubeconfig=/root/.kube/config config unset clusters.<name>

删除上下文

$ kubectl --kubeconfig=/root/.kube/config config unset contexts.<name>