美文网首页
2023-02-03 k8s 恢复cluster-info

2023-02-03 k8s 恢复cluster-info

作者: carvin | 来源:发表于2023-02-02 10:23 被阅读0次

当名称空间kube-public 的configmap下面cluster-info 被误删除

  • 1.寻找 一个cluster-info的模板
vim cluster-info.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-info
  namespace: kube-public
data:
  kubeconfig: |
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data: xxxxxxxxxxxx
        server: https://192.168.68.111:6443
      name: ""
    contexts: null
    current-context: ""
    kind: Config
    preferences: {}
    users: null
  • 2.寻找certificate-authority-data
    在主节点的/etc/kubernetes/kubelet.conf里面有


    0BA29A47-87B3-4ec6-8D9B-E2EF6A9F2DAE.png
  • 3.将文件中的token填写上去
apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-info
  namespace: kube-public
data:
  kubeconfig: |
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1ETXlNakE0TWpBd04xb1hEVE14TURNeU1EQTRNakF3TjFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmd2Cm9lWXZQb3NVWFkrNWQ0OHUxU1lINmZPMlQxanRDa0N4alNSTitVUi9EY2RHL3VqazhSbkZRN29ETnVjWGdqNUIKOVhXNXc4RTZMcXVLL2FIRXlLMytoODB5ZDgwWCsvZVpKNVRQQjZwZGpMN1J1NkoyRDE2WGVTeFBHVmptaUZ6cAo1NVZ1ZW16UjNsaTNJallrd3BIVDNadlg1cnVZNk9TQTZCMTNOWlhUSlFpTHUrb01zSVd2VXRvcXJXTkRkaUtqCm9rdHI4YVNQR05LSktHNWxmazN4cnZqaitrL3ZCSVR4OVo3VzNBWWxvWG9CL2I0Mmg2RXRDUHBTTFlMTXhLMG0KUC9QeVlLSk9hOFIwS0dHb2tENU40b3QxSFpPSVpYdjE0K3pCQmI1V09pdnN1ZjcrQThUU3lPWkhYekJTWitwRgpmcGlVT0ZUSGJHeS9FdFZWbWVjQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFFVVpNeno2SEc5YU5Qd2RQemovQ0tqLzhGb1MKMjVSR3lvcHVyeHgwMStNY1VCK045MFFDVlJtOHZ6ekpwYzllcDV6Ti91MmhraVpPQ05NdG5zTTZyWkVpOGd4QworNnhlMUZIY2FoT0tTUjNHNjZLU242OHlNbnVyNVRweGZ1U1lsNmk1cWtzZTRJN2tKWFhFZy9XRERMaWVjVVVEClQxMWFDckVVTTMybU5aaEtyblhpZmppWThzcEVlanlWaUQ0ZDZsZmpSMm8vTVdyRWlPcTBmM3hrYmVKU3NyTn\SZlZOSFNOSHVNckZraXgvQnB4OTBiT3JEUnpTMy9STmtiND0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
        server: https://192.168.68.111:6443
      name: ""
    contexts: null
    current-context: ""
    kind: Config
    preferences: {}
    users: null

相关文章

网友评论

      本文标题:2023-02-03 k8s 恢复cluster-info

      本文链接:https://www.haomeiwen.com/subject/vcvwhdtx.html