zoukankan      html  css  js  c++  java
  • 自动签发https证书工具 cert manager

    最近cert manager进行升级,不再支持0.11以下的版本了,所以进行升级。但是发现不能直接通过更改镜像版本来升级,在Apps里的版本也是旧版本,部署后发现不支持,于是自已动手,根据文档整理了一套部署cert manager的过程。

    Steps
    1. create namespace

    kubectl create namespace cert-manager

    2. install custome resource definition

    kubectl apply -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.11/deploy/manifests/00-crds.yaml

    3. label cert-manager as disable-validation

    kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true

    4. add jetstack helm repos

    helm repo add jetstack https://charts.jetstack.io

    5. update local helm chart repository

    helm repo update

    6. install cert-manager with helm chart

    helm install --name cert-manager --namespace cert-manager --version v0.11.0 jetstack/cert-manager

    7. create a clusterissuer

    kubectl apply -f issuer.yaml
    # issuer.yaml
    apiVersion: v1
    kind: ClusterIssuer
    metadata:
      name: letsencrypt-prod
    spec:
      acme:
        # You must replace this email address with your own.
        # Let's Encrypt will use this to contact you about expiring
        # certificates, and issues related to your account.
        email: admin@arfront.com
        server: https://acme-v02.api.letsencrypt.org/directory
        privateKeySecretRef:
          # Secret resource used to store the account's private key.
          name: issuer-key
        # Add a single challenge solver, HTTP01 using nginx
        solvers:
        - http01:
            ingress:
              class: nginx
    

    8. config annotation in your ingress

    apiVersion: v1
    kind: Ingress
    metadata:
      name: my-nginx
      annotations: 
            # config the cluster issuer defined in issuer.yaml
    	certmanager.k8s.io/cluster-issuer: letsencrypt-prod
    spec:
      rules:
      - host: test.nginx.com # dns for your ingress
        http:
          paths:
          - backend:
              serviceName: my-nginx
              servicePort: 443
            path: /
      tls: #enable tls 
      #secretName for this ingress,this will be stored in certificates
      - secretName: test-nginx-secret 
        hosts:
        - test.nginx.com  # dns for your ingress

    Troubleshooting
    1. serviceaccount Tiller not found

    kubectl apply -f tiller.yaml
    
    #tiller.yaml
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: tiller
      namespace: cert-manager
    ---
    apiVersion: v1
    kind: ClusterRoleBinding
    metadata:
      name: tiller
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cluster-admin
    subjects:
      - kind: ServiceAccount
        name: tiller
        namespace: cert-manager
    
  • 相关阅读:
    8.14 每日课后作业系列之RE正则 模块的运用
    8.13 每日课后作业系列之hashlib shelve xml模块的运用
    8.10 每日课后作业系列之包的建立
    8.9 每日课后作业系列之进度条 and 验证码
    操作系统与python入门
    计算机硬件基础
    MySQL系列
    html5和css (四 布局新增)
    html5和css(三 页面布局)
    html5和css(二 页面组成)
  • 原文地址:https://www.cnblogs.com/flyingaway/p/11811964.html
Copyright © 2011-2022 走看看