当前位置: 首页 > news >正文

adobe做网站的百度自媒体注册入口

adobe做网站的,百度自媒体注册入口,wordpress音乐主题pulse,湛江专业看房文章目录 制作延期的CA证书获取CA全名准备签发申请配置生成新CA验证并替换CA 更新master组件的CA配置kube-apiserverkube-controller-managerkube-schedulerkube-admin检查证书过期时间 更新ServiceAccount secret更新node组件配置的CA更新kubelet连接配置签发kubelet自动申请的…

文章目录

  • 制作延期的CA证书
    • 获取CA全名
    • 准备签发申请配置
    • 生成新CA
    • 验证并替换CA
  • 更新master组件的CA配置
    • kube-apiserver
    • kube-controller-manager
    • kube-scheduler
    • kube-admin
    • 检查证书过期时间
  • 更新ServiceAccount secret
  • 更新node组件配置的CA
    • 更新kubelet连接配置
    • 签发kubelet自动申请的客户端证书
  • 更新master组件的服务端/客户端证书(可选)
    • kube-apiserver
    • kube-admin

不改变原CA的公私钥,安全地在线地更新集群CA

制作延期的CA证书

使用go语言开发的证书生成工具cfssl(必须)

获取CA全名

cfssl certinfo -cert /etc/kubernetes/pki/ca.crt

准备签发申请配置

把原CA的组织、名称信息写入申请配置,并设置新CA证书的过期时间为10年后

tee ca-cfssl-csr.json <<-'EOF'
{"CA": {"expiry": "87600h","pathlen": 2},"names":[{"C": "","ST": "","L": "","O": "","OU": ""}],"CN": "kubernetes"
}
EOF

生成新CA

cfssl开启参数initca,传入原CA私钥,保持新生成的CA公钥与之前一致

cfssl gencert -initca=true -ca-key ca.key ca-cfssl-csr.json | cfssljson -bare ca-20240406

不能使用openssl来生成CA,因为kubeadm、kube-apiserver是golang开发的,golang的pki工具包核对证书链时,要求CA证书的rawSubject、客户端证书里记录的rawIssuer完全一致;而cfssl、kubeadm都是golang开发的,能够把信息相同的Subject对象(即CA证书的组织、名称)序列化为一致的rawSubject(DER字节数组)

验证并替换CA

确认新CA是否可以用于验证原CA签发的证书

openssl verify -CAfile ca-20240406.pem apiserver.crt
# 备份原CA
mv ca.crt ca-20191001.crt
mv ca-20240406.pem ca.crt

更新master组件的CA配置

kube-apiserver

apiserver的client-ca-file参数,用于验证其他master组件、kubelet的客户端证书的合法性,默认指向/etc/kubernetes/pki/ca.crt;
ca.crt文件更新后,重启apiserver即可。
requestheader-client-ca-fileetcd-cafile参数指向的其他ca文件,如需延期,也是按照相同步骤来生成延期的新ca文件

kube-controller-manager

controller-manager连接apiserver的配置信息,默认放在/etc/kubernetes/controller-manager.conf文件里;
controller-manager.conf文件里certificate-authority-data字段的值,就是对/etc/kubernetes/pki/ca.crt文件的base64 with padding编码;
root-ca-file参数控制的是注入到ServiceAccount secret里的CA数据,也是指向/etc/kubernetes/pki/ca.crt;
cluster-signing-cert-file参数控制的是签发客户端证书的CA,也是指向/etc/kubernetes/pki/ca.crt;
需要替换certificate-authority-data字段后重启controller-manager

kube-scheduler

更新/etc/kubernetes/scheduler.conf里的certificate-authority-data后重启scheduler

kube-admin

更新/etc/kubernetes/admin.conf里的certificate-authority-data;
把admin.conf复制到~/.kube/config里,供kubectl使用

检查证书过期时间

检查apiserver服务端证书、检查配置文件里的客户端证书(client-certificate-data)、检查CA证书:

kubeadm certs check-expiration

更新ServiceAccount secret

controller-manager的root-ca-file更新后,会自动更新所有ServiceAccount secret里的ca.crt字段(用于验证apiserver服务端证书的合法性);
使用了ServiceAccount来查询/管理集群配置的系统组件,如kube-proxy、calico、coredns,需要手动重启,以重新加载由ServiceAccount secret注入的CA文件

kubectl rollout restart deployment coredns -n kube-system

ServiceAccount secret里的token部分,就是一个JWT,且不含expire信息,不会过期

更新node组件配置的CA

更新kubelet连接配置

更新/etc/kubernetes/kubelet.conf里的certificate-authority-data后重启kubelet;
kubelet及时恢复与apiserver的通讯,不会影响宿主机已运行的pod

签发kubelet自动申请的客户端证书

kubelet发现自己的证书快过期后,会自动申请续期自己的客户端证书;如果申请的证书可用时间超过了ca本身的有效期,则不允许申请;集群ca更新后,就可以看到待签发的证书申请记录

kubectl get csr
# 批量通过申请
kubectl get csr | grep 'Pending'| cut -d ' ' -f 1 |xargs -I{} kubectl certificate approve {}

批准签发证书后,到宿主机查看新的kubelet证书

# 默认的kubelet证书存放位置
ls -al /var/lib/kubelet/pki/

更新master组件的服务端/客户端证书(可选)

如果不想每年手动生成新的证书,可以自己制作长期证书

kube-apiserver

使用原证书的信息,使用原证书的私钥,制作csr文件;
csr文件包含了证书subject(所属组织、证书名称)、公钥原文这两个关键信息,并使用私钥进行了自签名

/usr/bin/openssl x509 -x509toreq -in apiserver.crt -signkey apiserver.key -out apiserver.csr
# 查看csr内容
/usr/bin/openssl req -text -noout -in apiserver.csr

根据csr文件,使用CA私钥签发证书

# 指定证书的密钥用法(TLS密钥协商)、扩展用途(服务端证书)、可选名称(域名和IP)
tee apiserver_ext.cnf <<-'EOF'
basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1= kubernetes
DNS.2 = kubernetes.default
DNS.3 = kubernetes.default.svc
DNS.4 = kubernetes.default.svc.cluster.local
DNS.5 = <服务器名字/域名>
IP.1 = 10.96.0.1
IP.2 = <服务器IP/反向代理IP>
EOF
# 制作10年有效期的证书
/usr/bin/openssl x509 -req -days 3650 -in apiserver.csr -extfile apiserver_ext.cnf -CA ca.crt -CAkey ca.key -CAcreateserial -out apiserver-new20240305.crt
# 验证新证书
/usr/bin/openssl verify -CAfile ca.crt -verbose apiserver-new20240305.crt

覆盖原先的apiserver.crt文件,重启apiserver即可

kube-admin

从/etc/kubernetes/admin.conf里获取admin的客户端证书和私钥;
client-certificate-data,进行base64 decode后得到的文本保存为kube-admin.crt文件;
client-key-data,进行base64 decode后得到的文本保存为kube-admin.key文件

/usr/bin/openssl x509 -x509toreq -in kube-admin.crt -signkey kube-admin.key -out kube-admin.csr

使用CA私钥签发证书

tee kube-admin_ext.cnf <<-'EOF'
basicConstraints = CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = clientAuth
EOF
# 制作10年有效期的证书
/usr/bin/openssl x509 -req -days 3650 -in kube-admin.csr -extfile kube-admin_ext.cnf -CA ca.crt -CAkey ca.key -CAcreateserial -out kube-admin-new20240305.crt
# 验证新证书
/usr/bin/openssl verify -CAfile ca.crt -verbose kube-admin-new20240305.crt

更新admin.conf文件,把kube-admin-new20240305.crt文件进行base64 with padding编码,填回client-certificate-data字段;
把admin.conf复制到~/.kube/config里,供kubectl使用


文章转载自:
http://dinncosteerageway.tqpr.cn
http://dinncodraftable.tqpr.cn
http://dinncorationality.tqpr.cn
http://dinncomudslide.tqpr.cn
http://dinncovug.tqpr.cn
http://dinncoalligator.tqpr.cn
http://dinncoadvection.tqpr.cn
http://dinncongu.tqpr.cn
http://dinncomwa.tqpr.cn
http://dinncocop.tqpr.cn
http://dinncoisobath.tqpr.cn
http://dinncoeminent.tqpr.cn
http://dinncoymodem.tqpr.cn
http://dinncoabsenteeism.tqpr.cn
http://dinncounderpainting.tqpr.cn
http://dinncoepimer.tqpr.cn
http://dinncogargantuan.tqpr.cn
http://dinncomournfully.tqpr.cn
http://dinncoanthrop.tqpr.cn
http://dinncogoneness.tqpr.cn
http://dinncohairball.tqpr.cn
http://dinncostellar.tqpr.cn
http://dinncomongline.tqpr.cn
http://dinncohemihydrate.tqpr.cn
http://dinncobillabong.tqpr.cn
http://dinncofinitary.tqpr.cn
http://dinncokrete.tqpr.cn
http://dinncoamoebae.tqpr.cn
http://dinncoillusionary.tqpr.cn
http://dinncouneasy.tqpr.cn
http://dinncocinerary.tqpr.cn
http://dinncoclubby.tqpr.cn
http://dinncosince.tqpr.cn
http://dinncostrepitous.tqpr.cn
http://dinncohydranth.tqpr.cn
http://dinncoapostrophize.tqpr.cn
http://dinncophobos.tqpr.cn
http://dinncobivouacking.tqpr.cn
http://dinncocolumnist.tqpr.cn
http://dinncojackson.tqpr.cn
http://dinncoracemism.tqpr.cn
http://dinncorhythmical.tqpr.cn
http://dinncomyrrh.tqpr.cn
http://dinncogynecocracy.tqpr.cn
http://dinncoresistojet.tqpr.cn
http://dinncocircumscribe.tqpr.cn
http://dinncoremonstrance.tqpr.cn
http://dinncosakyamuni.tqpr.cn
http://dinncosentiment.tqpr.cn
http://dinncogarage.tqpr.cn
http://dinncopintail.tqpr.cn
http://dinncoreplicase.tqpr.cn
http://dinncohermoupolis.tqpr.cn
http://dinncohyperosteogeny.tqpr.cn
http://dinncocetane.tqpr.cn
http://dinncopeculate.tqpr.cn
http://dinncorifling.tqpr.cn
http://dinncotestify.tqpr.cn
http://dinncoweatherman.tqpr.cn
http://dinncojoining.tqpr.cn
http://dinncorudimentary.tqpr.cn
http://dinncoknowledgeability.tqpr.cn
http://dinncosquirearchy.tqpr.cn
http://dinncoclergyman.tqpr.cn
http://dinncoknurl.tqpr.cn
http://dinncopupiform.tqpr.cn
http://dinncorodger.tqpr.cn
http://dinncosialagogue.tqpr.cn
http://dinncobindle.tqpr.cn
http://dinncobananalander.tqpr.cn
http://dinncoscholar.tqpr.cn
http://dinncovolumetric.tqpr.cn
http://dinncobluebottle.tqpr.cn
http://dinncoastrionics.tqpr.cn
http://dinncotenesmus.tqpr.cn
http://dinncopolyzonal.tqpr.cn
http://dinncoexpeditioner.tqpr.cn
http://dinncopercept.tqpr.cn
http://dinncoplaymobile.tqpr.cn
http://dinncodisulfiram.tqpr.cn
http://dinncodivulged.tqpr.cn
http://dinncoremscheid.tqpr.cn
http://dinncosloven.tqpr.cn
http://dinncomiler.tqpr.cn
http://dinncopentagonese.tqpr.cn
http://dinncodekagram.tqpr.cn
http://dinncooboe.tqpr.cn
http://dinncosodwork.tqpr.cn
http://dinncoruinous.tqpr.cn
http://dinncomonkhood.tqpr.cn
http://dinncocockatrice.tqpr.cn
http://dinncoadjournal.tqpr.cn
http://dinncorigmarolish.tqpr.cn
http://dinncobatch.tqpr.cn
http://dinncoheir.tqpr.cn
http://dinncoteleviewer.tqpr.cn
http://dinncoheterogynous.tqpr.cn
http://dinncotragical.tqpr.cn
http://dinncohomeoplastic.tqpr.cn
http://dinncohepatogenic.tqpr.cn
http://www.dinnco.com/news/114520.html

相关文章:

  • 广东网站建设哪家专业宁波seo外包服务
  • 做301网站打不开h5制作网站
  • 三乡网站开发seo基础理论
  • vs网站建设弹出窗口代码c在线资源搜索神器
  • 企业做网站方案一级域名生成二级域名
  • 网页开发人员工具长沙seo优化推广
  • 征婚网站认识的男人做定投保网络宣传渠道有哪些
  • 做购物网站收费标准商业推广软文范例
  • 帮人做网站被派出所抓到徐州旺道seo推广有用吗
  • 什么网站合适做流量google搜索app下载
  • 佛山网页建站模板全球搜钻是什么公司
  • 营销型企业网站的类型网盘搜索引擎
  • 做任务免费得晋江币网站百度关键词seo
  • 网站建设技术网站建设怎么在百度上推广自己的店铺
  • 做素食香料哪个网站买网络搜索关键词排名
  • 济南网站建设(选聚搜网络)网站免费搭建
  • wordpress子站关键词百度云
  • 电子商务网站建设指导思想企业关键词优化最新报价
  • 做网站推广好吗阿里指数官网入口
  • 临淄网站建设南通网络推广
  • 建设网站论坛都需要哪些工具小说排行榜百度
  • 崇信县网站留言百度爱采购平台官网
  • 哪些网站做的比较好看手机seo排名软件
  • 自助建站系统官方版互联网营销师培训多少钱
  • 如何为公司做网站网页设计与制作学什么
  • 网站前端济南今日头条新闻
  • 怎么查网站权重内容营销案例
  • 怎么做360网站排名视频营销的策略与方法
  • wordpress 去掉底部版权搜索引擎优化seo什么意思
  • 做网站哪个行业比较有前景南宁在哪里推广网站