这个证书很重要,不用说。

但手工生成证书,确实工作量大且容易出错。

推荐的方式,是保留/etc/kubernetes/pki目录下的ca.crt,ca.key,sa.crt,sa.key。

这四个文件,前两个是10年过期,后两个没有过期概念,可以保证现有群集的顺利升级证书。

然后,使用kubeadm命令,来解决证书过期问题。

但kubeadm的生成证书和配置的命令,在1.10和1.14之间发生了比较大的变化,

现在作个记录。

一,1.10

This command is not meant to be run on its own. See list of available subcommands.

Usage:
  kubeadm alpha phase [command]

Available Commands:
  addon           Installs required addons for passing Conformance tests
  bootstrap-token Manage kubeadm-specific bootstrap token functions
  certs           Generates certificates for a Kubernetes cluster
  controlplane    Generates all static Pod manifest files necessary to establish the control plane
  etcd            Generates static Pod manifest file for etcd.
  kubeconfig      Generates all kubeconfig files necessary to establish the control plane and the admin kubeconfig file
  mark-master     Mark a node as master
  preflight       Run pre-flight checks
  selfhosting     Makes a kubeadm cluster self-hosted
  upload-config   Uploads the currently used configuration for kubeadm to a ConfigMap

Flags:
  -h, --help   help for phase

Use "kubeadm alpha phase [command] --help" for more information about a command.

时,这些功能还是属于alpha功能,所以使用kubeadm alpha phase -h命令查看帮助信息。

二,1.14之后,此功能已正常,集成到了kubeadm init phase -h功能中。

use this command to invoke single phase of the init workflow

Usage:
  kubeadm init phase [command]

Available Commands:
  addon              Installs required addons for passing Conformance tests
  bootstrap-token    Generates bootstrap tokens used to join a node to a cluster
  certs              Certificate generation
  control-plane      Generates all static Pod manifest files necessary to establish the control plane
  etcd               Generates static Pod manifest file for local etcd.
  kubeconfig         Generates all kubeconfig files necessary to establish the control plane and the admin kubeconfig file
  kubelet-start      Writes kubelet settings and (re)starts the kubelet
  mark-control-plane Mark a node as a control-plane
  preflight          Run pre-flight checks
  upload-certs       Upload certificates to kubeadm-certs
  upload-config      Uploads the kubeadm and kubelet configuration to a ConfigMap

Flags:
  -h, --help   help for phase

Global Flags:
      --log-file string   If non-empty, use this log file
      --rootfs string     [EXPERIMENTAL] The path to the 'real' host root filesystem.
      --skip-headers      If true, avoid header prefixes in the log messages
  -v, --v Level           number for the log level verbosity

Use "kubeadm init phase [command] --help" for more information about a command.

三,生成证书和配置文件两大命令:

1.10

kubeadm alpha phase kubeconfig all --config masterconfiguration.yaml
kubeadm alpha phase certs all  --config masterconfiguration.yaml 

1.14

kubeadm init phase kubeconfig all --config masterconfiguration.yaml
kubeadm init phase certs all  --config masterconfiguration.yaml 

关于k8s集群证书1年过期后,使用kubadm重新生成证书及kubeconfig配置文件的变化的更多相关文章

  1. Kubernetes(k8s)集群安装

    一:简介 二:基础环境安装 1.系统环境 os Role ip Memory Centos 7 master01 192.168.25.30 4G Centos 7 node01 192.168.25 ...

  2. 为K8S集群建立只读权限帐号

    参考URL: https://www.jianshu.com/p/a1a0d64f1245 https://mritd.me/2018/03/20/use-rbac-to-control-kubect ...

  3. K8s集群认证之RBAC

    kubernetes认证,授权概括总结: RBAC简明总结摘要:API Server认证授权过程: subject(主体)----->认证----->授权[action(可做什么)]--- ...

  4. 二进制部署1.23.4版本k8s集群-5-部署Master节点服务

    1.安装Docker 在21.22.200三台机器上安装Docker.安装命令: 在21.22.200三台主机上部署Docker. ~]# curl -fsSL https://get.docker. ...

  5. 企业运维实践-还不会部署高可用的kubernetes集群?使用kubeadm方式安装高可用k8s集群v1.23.7

    关注「WeiyiGeek」公众号 设为「特别关注」每天带你玩转网络安全运维.应用开发.物联网IOT学习! 希望各位看友[关注.点赞.评论.收藏.投币],助力每一个梦想. 文章目录: 0x00 前言简述 ...

  6. Kubeadm安装的K8S集群1年证书过期问题的解决思路

    这个问题,很多使用使用kubeadm的用户都会遇到. 网上也有类似的帖子,从源代码编译这种思路, 在生产环境,有些不现实. 还是使用kubeadm的命令操作,比较自然一点. 当然,自行生成一套证书,也 ...

  7. k8s集群证书过期(kubeadm 1.10.2 )

    1.k8s 集群架构描述 kubeadm v1.10.2创建k8s集群. master节点高可用,三节点(10.18.60.3.10.18.60.4.10.18.60.5). LVS实现master三 ...

  8. Kubernetes(k8s)集群部署(k8s企业级Docker容器集群管理)系列之自签TLS证书及Etcd集群部署(二)

    0.前言 整体架构目录:ASP.NET Core分布式项目实战-目录 k8s架构目录:Kubernetes(k8s)集群部署(k8s企业级Docker容器集群管理)系列目录 一.服务器设置 1.把每一 ...

  9. 使用Kubeadm创建k8s集群之节点部署(三十一)

    前言 本篇部署教程将讲述k8s集群的节点(master和工作节点)部署,请先按照上一篇教程完成节点的准备.本篇教程中的操作全部使用脚本完成,并且对于某些情况(比如镜像拉取问题)还提供了多种解决方案.不 ...

随机推荐

  1. pushgateway

    下载pushgateway wget https://github.com/prometheus/pushgateway/releases/download/v0.9.0/pushgateway-0. ...

  2. Springboot项目启动不了。也不打印任何日志信息。

    Springboot项目启动不了.也不打印任何日志信息. <!-- 在创建Spring Boot工程时,我们引入了spring-boot-starter,其中包含了spring-boot-sta ...

  3. Shiro内置过滤器

    Shiro内置过滤器 DefaultFilter 枚举类定义了shiro所有的默认过滤器. package org.apache.shiro.web.filter.mgt; public enum D ...

  4. Leetcode146-lru-cache

    Leetcode146-lru-cache int capacity; int size; Map<Integer, ListNode> map = new HashMap<Inte ...

  5. ubuntu下vscode认识 system("pause")的解决办法

    linux下运行c++程序时,希望控制台不会输出后马上消失. 在windows系统下,用如下语句: #include <cstdlib> system("pause") ...

  6. 执行flutter doctor后,无任何反应

    flutter运行需要联网,并且由于qiang,会导致访问缓慢,解决办法 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_ ...

  7. hdu6468 dfs剪枝 or char数组 or 构造

    http://acm.hdu.edu.cn/showproblem.php?pid=6468 题意 有一个序列,是1到n的一种排列,排列的顺序是字典序小的在前,那么第k个数字是什么?(\(1 \leq ...

  8. Win10中SVN图标不显示的解决

    团队协作开发,SVN是离不开的.在Win10安装的版本是TortoiseSVN-1.9.5.27581,可检出后图标未显示出来.解决方法是修改注册表: 第一步,打开注册表编辑器位置:HKEY_LOCA ...

  9. 《计算机网络第7版》PDF+《计算机网络释疑与习题解答第7版》PDF

    谢希仁 链接:https://pan.baidu.com/s/1_sM9bFL0y3S1NXBz5rLyvg 提取码:po3i 计算机网络(第7版)谢希仁 · 语雀 https://www.yuque ...

  10. 游戏设计艺术 第2版 (Jesse Schell 著)

    第1章 太初之时,有设计师 (已看) 第2章 设计师创造体验 第3章 体验发生于场景 第4章 体验从游戏中诞生 第5章 游戏由元素构成 第6章 元素支撑起主题 第7章 游戏始于一个创意 第8章 游戏通 ...