kubeadm重新生成admin.conf

一条指令搞定,

kubeadm init phase kubeconfig admin 

如果有多个网卡,需要用–apiserver-advertise-address指定apiserver监听地址,证书地址可以用–cert-dir指定,默认/etc/kubernetes/pki,生成的admin.conf默认为/etc/kubernetes/admin.conf

[root@master ~]# kubeadm init phase kubeconfig admin --help
Generate the kubeconfig file for the admin and for kubeadm itself, and save it to admin.conf file.

Usage:
  kubeadm init phase kubeconfig admin [flags]

Flags:
      --apiserver-advertise-address string   The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.
      --apiserver-bind-port int32            Port for the API Server to bind to. (default 6443)
      --cert-dir string                      The path where to save and store the certificates. (default "/etc/kubernetes/pki")
      --config string                        Path to a kubeadm configuration file.
      --control-plane-endpoint string        Specify a stable IP address or DNS name for the control plane.
  -h, --help                                 help for admin
      --kubeconfig-dir string                The path where to save the kubeconfig file. (default "/etc/kubernetes")
      --kubernetes-version string            Choose a specific Kubernetes version for the control plane. (default "stable-1")

Global Flags:
      --add-dir-header           If true, adds the file directory to the header of the log messages
      --log-file string          If non-empty, use this log file
      --log-file-max-size uint   Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
      --one-output               If true, only write logs to their native severity level (vs also writing to each lower severity level)
      --rootfs string            [EXPERIMENTAL] The path to the 'real' host root filesystem.
      --skip-headers             If true, avoid header prefixes in the log messages
      --skip-log-headers         If true, avoid headers when opening log files
  -v, --v Level                  number for the log level verbosity
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值