kubernetes容器集群管理创建node节点kubeconfig文件
1、创建TLS Bootstrapping Token
2、创建kubelet kubeconfig
3、创建kube-proxy kubeconfig
安装和设置kubectl
[root@master ~]# curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
[root@master ~]# chmod +x ./kubectl
[root@master ~]# mv ./kubectl /opt/kubernetes/bin/
[root@master ~]# cat kuberconfig.sh
#创建TLS Bootstrapping Token
export BOOTSTRAP_TOKEN=$(head -c 16 /dev/urandom|od -An -t x|tr -d ' ')
cat >token.csv <<EOF
${BOOTSTRAP_TOKEN},kubelet-bootstrap,10001,"system:kuberlet-bootstrap"
EOF
#----------------------
#创建kubelet bootstrapping kubeconfig
export KUBE_APISERVER="https://192.168.238.130:6443"
#设置集群参数
kubectl config set-cluster kubernetes \
--certificate-authority=/opt/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=${KUBE_APISERVER} \
--kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
#设置客户端认证参数
kubectl config set-credentials kubelet-bootstrap \
--token=${BOOTSTRAP_TOKEN} \
--kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
#设置上下文参数
kubectl config set-context default \
--cluster=kubernetes \
--user=kubelet-bootstrap \
--kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
#设置默认上下文
kubectl config use-context default --kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
#-------------------------
#创建kube-proxy kubeconfig文件
kubectl config set-cluster kubernetes \
--certificate-authority=/opt/kubernetes/ssl/ca.pem \
--embed-certs=true \
--server=${KUBE_APISERVER} \
--kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
kubectl config set-credentials kube-proxy \
--client-certificate=/opt/kubernetes/ssl/kube-proxy.pem \
--client-key=/opt/kubernetes/ssl/kube-proxy.pem \
--embed-certs=true \
--kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
kubectl config set-context default \
--cluster=kubernetes \
--user=kube-proxy \
--kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
kubectl config use-context default --kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
[root@master ~]# export BOOTSTRAP_TOKEN=$(head -c 16 /dev/urandom|od -An -t x|tr -d ' ')
cat >token.csv <<EOF
${BOOTSTRAP_TOKEN},kubelet-bootstrap,10001,"system:kuberlet-bootstrap"
[root@master ~]# cat >token.csv <<EOF
> ${BOOTSTRAP_TOKEN},kubelet-bootstrap,10001,"system:kuberlet-bootstrap"
> EOF
[root@master ~]# cat token.csv
a53c293d5aaab99101e2cdae3351a2e1,kubelet-bootstrap,10001,"system:kuberlet-bootstrap"
[root@master ~]# export KUBE_APISERVER="https://192.168.238.130:6443"
[root@master ~]# kubectl config set-cluster kubernetes \
> --certificate-authority=/opt/kubernetes/ssl/ca.pem \
> --embed-certs=true \
> --server=${KUBE_APISERVER} \
> --kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
Cluster "kubernetes" set.
[root@master ~]# cat /opt/kubernetes/ssl/bootstrap.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ0lVUHFjY20xOFN1L2lkdFVGWmRVMWwrc29qTGdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTJNekF4TlRRMk1EQmFGdzB5TkRBMgpNamd4TlRRMk1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDWE1HcUU3R2REMFd0RWczcHZmRnNlT2ZBOGNvNUJFQmR5dlRWQjdselkKdGxwR2Y4Zk4yYTVCckRua1VBNzZ0Z3drR0VDOUEvYXRrRys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ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://192.168.238.130:6443
name: kubernetes
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []
[root@master ~]# kubectl config set-credentials kubelet-bootstrap \
> --token=${BOOTSTRAP_TOKEN} \
> --kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
User "kubelet-bootstrap" set.
[root@master ~]# cat /opt/kubernetes/ssl/bootstrap.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ0lVUHFjY20xOFN1L2lkdFVGWmRVMWwrc29qTGdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTJNekF4TlRRMk1EQmFGdzB5TkRBMgpNamd4TlRRMk1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDWE1HcUU3R2REMFd0RWczcHZmRnNlT2ZBOGNvNUJFQmR5dlRWQjdselkKdGxwR2Y4Zk4yYTVCckRua1VBNzZ0Z3drR0VDOUEvYXRrRysxd29CWDNuZFo2Y2k5cTJZbkk4YzAwdzhFbllWZAo5dG43V1c4eS9sWEtXYzZOUkd2bnRtZityMTNvUStZK3BIS3AwdUFSamh5N2h1VTlsUXc1eEVIajNOck1WeG9pCkJSaGkzTy92aHh5VzllbHhML1RmbENkUTdvbTNRbzNiVnkyak5QekUyYnNXdzdMV29BK20xTUN4K2RxVWN4ZFAKMkM4NVdITGVpQ2hhTnhDWkl3cDA2V1JTZlQwOE10bFpPMTdIK3JwOWVGc2ZDQ1RkaXJ3LzFWMCtDa1J0Szc1MQpWTkxPSkZMdHN3ejFaVVhDdVl2MURlS0sycGZlcDg5NjFyTUFzYXl5VW1GeEFnTUJBQUdqWmpCa01BNEdBMVVkCkR3RUIvd1FFQXdJQkJqQVNCZ05WSFJNQkFmOEVDREFHQVFIL0FnRUNNQjBHQTFVZERnUVdCQlNrejJsMWYyOEUKTzZKa0ZyR2dZWm8yam9BYTdUQWZCZ05WSFNNRUdEQVdnQlNrejJsMWYyOEVPNkprRnJHZ1labzJqb0FhN1RBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFHdmxaRzc1anpmRm5qNFpMQ0pCQVVxWFJPc3B0eXRIeE84ZUduRTQvClI5QmNETWE5RjV4WnJpeTVhekRBN3hBT0laTm1nQWIzK2hsYWhLd1NTMFUvelZBRCt2QkN3QU5UeVgzYVl4Zm4KaXJDS0cyS092SGtDNU5sMEJBWWU1eGZyTkZjTkx5NDZJTGVXYklMZ0tyMUQ4MFE4NWhmelFDQ09INUI3bE1XcwoyeHZCZ3V3cXV6RTJQMTdYTjdvU2kvNlJsUUtSbmxJRjJNM0pXdk11djI3YjN1K2Iyc3JNaWs5TTNoeDJ2UHRECnN6U0xoQ2VrbzVzbDVhcHRXd3hYN05STk5SL1A4TWI3V0Z6SEJ5RmwwMjliSVlGMkl5N3BpNVE0L1N2M0l0YzQKT3R2NXp3SmEvWEhPckZad2tMU1h4SmVKNlpGRGhITW5HTldOdkF4L0NZTXdJdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://192.168.238.130:6443
name: kubernetes
contexts: []
current-context: ""
kind: Config
preferences: {}
users:
- name: kubelet-bootstrap
user:
token: a53c293d5aaab99101e2cdae3351a2e1
[root@master ~]# kubectl config set-context default \
> --cluster=kubernetes \
> --user=kubelet-bootstrap \
> --kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
Context "default" created.
[root@master ~]# cat /opt/kubernetes/ssl/bootstrap.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ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sYWhLd1NTMFUvelZBRCt2QkN3QU5UeVgzYVl4Zm4KaXJDS0cyS092SGtDNU5sMEJBWWU1eGZyTkZjTkx5NDZJTGVXYklMZ0tyMUQ4MFE4NWhmelFDQ09INUI3bE1XcwoyeHZCZ3V3cXV6RTJQMTdYTjdvU2kvNlJsUUtSbmxJRjJNM0pXdk11djI3YjN1K2Iyc3JNaWs5TTNoeDJ2UHRECnN6U0xoQ2VrbzVzbDVhcHRXd3hYN05STk5SL1A4TWI3V0Z6SEJ5RmwwMjliSVlGMkl5N3BpNVE0L1N2M0l0YzQKT3R2NXp3SmEvWEhPckZad2tMU1h4SmVKNlpGRGhITW5HTldOdkF4L0NZTXdJdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://192.168.238.130:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubelet-bootstrap
name: default
current-context: ""
kind: Config
preferences: {}
users:
- name: kubelet-bootstrap
user:
token: a53c293d5aaab99101e2cdae3351a2e1
[root@master ~]# kubectl config use-context default --kubeconfig=/opt/kubernetes/ssl/bootstrap.kubeconfig
Switched to context "default".
[root@master ~]# cat /opt/kubernetes/ssl/bootstrap.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ0lVUHFjY20xOFN1L2lkdFVGWmRVMWwrc29qTGdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTJNekF4TlRRMk1EQmFGdzB5TkRBMgpNamd4TlRRMk1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDWE1HcUU3R2REMFd0RWczcHZmRnNlT2ZBOGNvNUJFQmR5dlRWQjdselkKdGxwR2Y4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U1h4SmVKNlpGRGhITW5HTldOdkF4L0NZTXdJdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
server: https://192.168.238.130:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kubelet-bootstrap
name: default
current-context: default
kind: Config
preferences: {}
users:
- name: kubelet-bootstrap
user:
token: a53c293d5aaab99101e2cdae3351a2e1
[root@master ~]# kubectl config set-cluster kubernetes \
> --certificate-authority=/opt/kubernetes/ssl/ca.pem \
> --embed-certs=true \
> --server=${KUBE_APISERVER} \
> --kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
Cluster "kubernetes" set.
[root@master ~]# kubectl config set-credentials kube-proxy \
> --client-certificate=/opt/kubernetes/ssl/kube-proxy.pem \
> --client-key=/opt/kubernetes/ssl/kube-proxy.pem \
> --embed-certs=true \
> --kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
User "kube-proxy" set.
[root@master ~]# cat /opt/kubernetes/ssl/kube-proxy.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ0lVUHFjY20xOFN1L2lkdFVGWmRVMWwrc29qTGdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTJNekF4TlRRMk1EQmFGdzB5TkRBMgpNamd4TlRRMk1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDWE1HcUU3R2REMFd0RWczcHZmRnNlT2ZBOGNvNUJFQmR5dlRWQjdselkKdGxwR2Y4Zk4yYTVCckRua1VBNzZ0Z3drR0VDOUEvYXRrRysxd29CWDNuZFo2Y2k5cTJZbkk4YzAwdzhFbllWZAo5dG43V1c4eS9sWEtXYzZ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jJabmlmWHVkbWxEUndZM1hYV0FmMVZSandvNkJvY3RKL0RoTUYKUGFVNHJ4YTlVaFg3OWxMQ3NYS1pLRVdPbHRMb293Mk94U1NsbFBZOVJUVGx0SkJRc3ErOGZkTlFlQ0VLQ3VoUgp6UEd4dDJMdGUrOTRCcXp4WXlzcXJHNXZ1RVFGLy9GWjNNRlBuZFdoUFpqWEJUTUtwMFVJSGZtYW01VnBQVjEvCnA1bmtsc2c5N3RLemw0RWFvNnl2MGtHbEljNDBuWVZSNXBzNXloaFFCZVRlYk80dFRFMDFaWVlSRkVVRzNRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
[root@master ~]# kubectl config set-context default \
> --cluster=kubernetes \
> --user=kube-proxy \
> --kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
Context "default" created.
[root@master ~]# kubectl config use-context default --kubeconfig=/opt/kubernetes/ssl/kube-proxy.kubeconfig
Switched to context "default".
[root@master ~]# cat /opt/kubernetes/ssl/kube-proxy.kubeconfig
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIakNDQWdhZ0F3SUJBZ0lVUHFjY20xOFN1L2lkdFVGWmRVMWwrc29qTGdnd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTJNekF4TlRRMk1EQmFGdzB5TkRBMgpNamd4TlRRMk1EQmFNQlV4RXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCCkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDWE1HcUU3R2REMFd0RWczcHZmRnNlT2ZBOGNvNUJFQmR5dlRWQjdselkKdGxwR2Y4Zk4yYTVCckRua1VBNzZ0Z3drR0VDOUEvYXRrRysxd29CWDNuZFo2Y2k5cTJZbkk4YzAwdzhFbllWZAo5dG43V1c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:6443
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: kube-proxy
name: default
current-context: default
kind: Config
preferences: {}
users:
- name: kube-proxy
user:
client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURpakNDQW5LZ0F3SUJBZ0lVTGpjOGF3SUdveFhGay9PMDYzdEM1Q2xOcmZvd0RRWUpLb1pJaHZjTkFRRUwKQlFBd0ZURVRNQkVHQTFVRUF4TUthM1ZpWlhKdVpYUmxjekFlRncweE9UQTNNRGN4TlRReE1EQmFGdzB5T1RBMwpNRFF4TlRReE1EQmFNR2d4Q3pBSkJnTlZCQVlUQWtOT01RNHdEQVlEVlFRSUV3VlhkV2hoYmpFT01Bd0dBMVVFCkJ4TUZWM1ZvWVc0eEREQUtCZ05WQkFvVEEyczRjekVQTUEwR0ExVUVDeE1HVTNsemRHVnRNUm93R0FZRFZRUUQKRXhGemVYTjBaVzA2YTNWaVpTMXdjbTk0ZVRDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQwpnZ0VCQUw4UmRmU2s0aW14a0x1UnV6c3VkdkNMR3pxV3MrU282U1BtblRockFEUWZUSGtLQ3g1YzhlTXE2VFJsCkRZekJwa1VzMkFZR0ViRUhhNEIxRHc3UGw3S0FreXZvdnl2SUFOMUlsMG1SRE9adDh1SjMzb2cvMGFQOU44c0wKNURXemorY1lpTndoOGdGdEpRSlkxTFFBQVVPWUsrN1JTV2ZIVzBYYTNxQ3NsR1dLWGxCK2d4c2RKRGVVSHFXSApoakcyT3BReEpBL3pHMFE3c0ZadlE2L1BaYThhelZ4OTFoNW1YZm5vUjZpSzdES0hNQWVWZTg3WVhhbTBSNTdwCkxzU2dQY1gvOHJSbjVxSWtzeFZvSm16ZlNuQkg4ZFhFbWg0OTNublRteWtZVCtFYUVOVGpzeGlZN2N1MTZvb2QKSHpjcVdrTnNpTmR5b1dsa2xjSm1OZWxpLzZrQ0F3RUFBYU4vTUgwd0RnWURW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