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

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

推荐的方式,是保留/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. 【Eureka篇三】Eureka自我保护机制(3)

    1. 自我保护机制演示 eureka在频繁修改微服务名称的时候,可以会出现如下现象: 2. 什么是自我保护模式? 默认情况下,如果EurekaServer在一定时间内没有接收到某个微服务实例的心跳,E ...

  2. 【新特性速递】树控件结构由单层 TR 改为 TR-TD-TABLE 层级嵌套

    FineUIPro/Mvc/Core的下个版本(v6.1.0),我们对树控件进行了优化,由原来的单层 TR 改为 TR-TD-TABLE 层级嵌套,从而做到表里如一. 上个版本(v6.0.0),我们对 ...

  3. 【08月28日】A股滚动市盈率PE历史新低排名

    2010年01月01日 到 2019年08月28日 之间,滚动市盈率历史新低排名. 上市三年以上的公司,2019年08月28日市盈率在300以下的公司. 1 - 文山电力(SH600995) - 历史 ...

  4. 在Anaconda中使用linux的命令

    在Anaconda中使用linux的命令 1.在anaconda中执行以下命令即可(要先activation 想用的环境): conda install m2-base 2.安装git.添加环境变量即 ...

  5. 快速认识springcloud微服务

    这周浅显的学习了springcloud.简单聊一下微服务.所谓的微服务远远没有我想想的那么高端难以理解,简单说,就是多个服务分布在不同的服务器上,由这些服务互相配合完成某一项任务.那服务和服务之间调用 ...

  6. oracle中如何更改一个表的一个字段属性(名称,类型)

    修改字段的属性,名称方法 --修改某一个字段的类型,当该字段不为null时alter table 表名add 字段NUMBER(11,0) default 0 not null;--添加表一个字段 A ...

  7. vulnhub之GoldenEye-v1靶机

    靶机:virtualbox  自动获取 攻击:kali linux    自动获取 设置同一张网卡开启dhcp ifconfig攻击IP是那个网段(也可以netdiscpver,不过毕竟是自己玩懒得等 ...

  8. 漫谈微服务架构:什么是Spring Cloud,为何要选择Spring Cloud

        Spring Cloud是基于Spring Boot的,因此还在使用SpringMVC的同学要先了解Spring Boot.先上一段官话,Spring Cloud是一个基于Spring Boo ...

  9. CentOS7系统yum方式安装MySQL5.7

    参考:https://www.cnblogs.com/bigbrotherer/p/7241845.html#top 1.在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要, ...

  10. C# iText split PDF C# 拆分PDF

    Nuget install iText7 using iText.Kernel.Pdf; using System.Linq; using System.Text; using System.Thre ...