當(dāng)名稱空間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
在主節(jié)點的/etc/kubernetes/kubelet.conf里面有
- 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