前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在线更新ingress证书

在线更新ingress证书

作者头像
三杯水Plus
发布2020-07-17 09:57:44
1.1K0
发布2020-07-17 09:57:44
举报
文章被收录于专栏:运维

1.制作新证书

代码语言:javascript
复制
[root@elasticsearch01 yaml]# kubectl  create secret tls ingress-secret2021 --key minminmsn.key --cert minminmsn.crt 

2.在ingress替换secretName 查看ingress

代码语言:javascript
复制
[root@elasticsearch01 yaml]# kubectl get ingress
NAME                    HOSTS                                                     ADDRESS   PORTS     AGE
jenkins                 jenkins.minminmsn.com                                              80, 443   419d
minminmsn-harbor-ingress   core-harbor.minminmsn.com,notary-harbor.minminmsn.com             80, 443   30h

在线编辑ingress,替换secretName的值由ingress-secret2020,替换为ingress-secret2021,保存生效

代码语言:javascript
复制
[root@elasticsearch01 yaml]# kubectl edit ingress minminmsn-harbor-ingress
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/proxy-body-size: "0"
    ingress.kubernetes.io/ssl-redirect: "true"
    nginx.ingress.kubernetes.io/proxy-body-size: "0"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  creationTimestamp: "2020-07-15T03:18:15Z"
  generation: 1
  labels:
    app: harbor
    chart: harbor
    heritage: Tiller
    release: minminmsn
  name: minminmsn-harbor-ingress
  namespace: default
  resourceVersion: "91736348"
  selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/minminmsn-harbor-ingress
  uid: d2bf4b41-c649-11ea-9386-52540089b2b6
spec:
  rules:
  - host: core-harbor.minminmsn.com
    http:
      paths:
      - backend:
          serviceName: minminmsn-harbor-portal
          servicePort: 80
        path: /
      - backend:
          serviceName: minminmsn-harbor-core
          servicePort: 80
        path: /api/
      - backend:
          serviceName: minminmsn-harbor-core
          servicePort: 80
        path: /service/
      - backend:
          serviceName: minminmsn-harbor-core
          servicePort: 80
        path: /v2/
      - backend:
          serviceName: minminmsn-harbor-core
          servicePort: 80
        path: /chartrepo/
      - backend:
          serviceName: minminmsn-harbor-core
          servicePort: 80
        path: /c/
  - host: notary-harbor.minminmsn.com
    http:
      paths:
      - backend:
          serviceName: minminmsn-harbor-notary-server
          servicePort: 4443
        path: /
  tls:
  - hosts:
    - core-harbor.minminmsn.com
    secretName: ingress-secret2021
  - hosts:
    - notary-harbor.minminmsn.com
    secretName: ingress-secret2021
status:
  loadBalancer: {}
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/07/16 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档