zoukankan      html  css  js  c++  java
  • kubernetes1.18.2 修改证书到期时间

    1.下载kubernetes源码包

    2.修改证书时间

    cd  /opt/kubernetes/cmd/kubeadm/app/util/pkiutil

    修改pki_helpers.go

    [root@k8s-harbor pkiutil]# vi pki_helpers.go

    增加:const duration365d = time.Hour * 24 * 365 * 10

    修改:NotAfter:     time.Now().Add(duration365d).UTC(),

    3.选择需要编译的分支

    [root@k8s-harbor kubernetes]# git checkout -b remotes/origin/release-1.18.2 v1.18.2
    M       cmd/kubeadm/app/util/pkiutil/pki_helpers.go
    M       staging/src/k8s.io/client-go/util/cert/cert.go

    4.编译

    [root@k8s-harbor kubernetes]# make WHAT=cmd/kubeadm GOFLAGS=-v
    warning: ignoring symlink /opt/kubernetes/_output/local/go/src/k8s.io/kubernetes
    go: warning: "k8s.io/kubernetes/vendor/github.com/go-bindata/go-bindata/..." matched no packages
    +++ [0730 08:55:42] Building go targets for linux/amd64:
        cmd/kubeadm
    k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/net
    k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/watch
    k8s.io/kubernetes/vendor/k8s.io/client-go/transport
    k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1
    ...
    ...
    k8s.io/kubernetes/cmd/kubeadm/app/discovery/https
    k8s.io/kubernetes/vendor/k8s.io/client-go/util/certificate/csr
    k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/fake
    k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient
    k8s.io/kubernetes/cmd/kubeadm/app/util/config
    k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/join
    k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade
    k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/upgrade/node
    k8s.io/kubernetes/cmd/kubeadm/app/cmd/upgrade
    k8s.io/kubernetes/cmd/kubeadm/app/cmd
    [root@k8s-harbor kubernetes]# 

    5.拷贝kubeadm

    [root@k8s-harbor kubernetes]# cd _output/bin/
    [root@k8s-harbor bin]# ls
    conversion-gen  deepcopy-gen  defaulter-gen  go2make  go-bindata  kubeadm  openapi-gen  prerelease-lifecycle-gen
  • 相关阅读:
    git httphttpsgit免密设置记住用户名和密码的方法
    WPF部署问题 解决:The application requires that the assembly...be installed in the GAC
    reporting service & wpf
    洪应明《菜根谭》
    焦郁《白云向空尽》
    .net 裁剪图片
    js 本地预览图片和得到图片实际大小
    display: -webkit-box; 做个小小试验
    C# json
    宽域POST提交数据
  • 原文地址:https://www.cnblogs.com/caonw/p/13401889.html
Copyright © 2011-2022 走看看