5

kubeadm生成的token过期后,集群增加节点

 2 years ago
source link: https://tangxusc.github.io/2019/03/kubeadm%E7%94%9F%E6%88%90%E7%9A%84token%E8%BF%87%E6%9C%9F%E5%90%8E%E9%9B%86%E7%BE%A4%E5%A2%9E%E5%8A%A0%E8%8A%82%E7%82%B9/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

kubeadm生成的token过期后,集群增加节点

March 20, 2019

in kubeadm, k8s

kubeadm生成的token过期后,集群增加节点

  1. 重新生成token(默认token24小时后过期)

    kubeadm token create
    TOKEN                     TTL       EXPIRES                     USAGES                   DESCRIPTION                                                EXTRA GROUPS
    36iajs.t016zpxbyqdmivcq   19h       2018-07-04T12:48:32+08:00   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token
    
  2. 获取ca证书sha256编码hash值

    openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
    
  3. 节点加入集群

    kubeadm join <节点IP>:6443 --token 36iajs.t016zpxbyqdmivcq --discovery-token-ca-cert-hash sha256:19246ce11ba3fc633fe0b21f2f8aaaebd7df9103ae47138dc0dd615f61a32d99
    
© 2019 苏连云. All Rights Reserved

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK