Skip to main content

alidns-webhook

ben.wangzLess than 1 minute

alidns-webhook

references

  • https://github.com/DEVmachine-fr/cert-manager-alidns-webhook

prepare

  1. k8s is ready
  2. argocd is ready and logged in
  3. cert-manager is ready

installation

  1. prepare alidns-webhook.yaml
    • apiVersion: argoproj.io/v1alpha1
      kind: Application
      metadata:
        name: alidns-webhook
      spec:
        syncPolicy:
          syncOptions:
          - CreateNamespace=true
        project: default
        source:
          repoURL: https://devmachine-fr.github.io/cert-manager-alidns-webhook
          chart: alidns-webhook
          targetRevision: 0.7.0
          helm:
            releaseName: alidns-webhook
            values: |
              groupName: dev.geekcity.tech
              certManager:
                namespace: basic-components
                serviceAccountName: cert-manager
              image:
                repository: ghcr.io/devmachine-fr/cert-manager-alidns-webhook/cert-manager-alidns-webhook
        destination:
          server: https://kubernetes.default.svc
          namespace: basic-components
      
      
  2. apply to k8s
    • kubectl -n argocd apply -f alidns-webhook.yaml
      
  3. sync by argocd
    • argocd app sync argocd/alidns-webhook
      
  4. create secret of alidns-webhook-secrets
    • #YOUR_ACCESS_KEY_ID=xxxxxxxxxxx
      #YOUR_ACCESS_KEY_SECRET=yyyyyyyyyyy
      kubectl -n basic-components create secret generic alidns-webhook-secrets \
          --from-literal="access-token=$YOUR_ACCESS_KEY_ID" \
          --from-literal="secret-key=$YOUR_ACCESS_KEY_SECRET"
      
  5. prepare alidns-webhook-cluster-issuer.yaml
    • apiVersion: cert-manager.io/v1
      kind: ClusterIssuer
      metadata:
        name: alidns-webhook-letsencrypt
      spec:
        acme:
          email: ben.wangz@foxmail.com
          privateKeySecretRef:
            name: alidns-webhook-letsencrypt
          server: https://acme-v02.api.letsencrypt.org/directory
          solvers:
          - dns01:
              webhook:
                config:
                  accessTokenSecretRef:
                    key: access-token
                    name: alidns-webhook-secrets
                  regionId: cn-beijing
                  secretKeySecretRef:
                    key: secret-key
                    name: alidns-webhook-secrets
                groupName: dev.geekcity.tech
                solverName: alidns-solver
      
      
  6. apply cluster issuer to k8s
    • kubectl apply -f alidns-webhook-cluster-issuer.yaml