项目作者: 4nx

项目描述 :
A cert-manager repository for creating an ACME DNS01 solver webhook for joker.com.
高级语言: Go
项目地址: git://github.com/4nx/cert-manager-webhook-joker.git
创建时间: 2021-01-22T13:49:32Z
项目社区:https://github.com/4nx/cert-manager-webhook-joker

开源协议:Apache License 2.0

下载


cert-manager webhook for joker.com DNS

cert-manager ACME DNS01 webhook provider for joker.com.

Prequesites

The following components needs to be already installed on a Kubernetes cluster:

  • Kubernetes (>= v1.11.0)
  • cert-manager (>= v0.14.0)
  • helm (>= v3.0.0)

At joker.com you need to enable Dynamic DNS to get credentials for API access. You can find the documentation here.

Installation

  1. Create a Kubernetes secret which will hold your joker DynDNS authentication credentials (base64 representation):
  1. cat <<EOF | kubectl apply -f -
  2. apiVersion: v1
  3. kind: Secret
  4. metadata:
  5. name: joker-credentials
  6. namespace: kube-system
  7. data:
  8. username: <joker Username>
  9. password: <joker Password>
  10. EOF
  1. Grant permission to get the secret to cert-manager-webhook-joker service account:

    ```yaml
    cat <<EOF | kubectl apply -f -
    apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata:
    name: cert-manager-webhook-joker:secret-reader
    namespace: kube-system
    rules:

    • apiGroups: [“”]
      resources: [“secrets”]
      resourceNames: [“joker-credentials”]
      verbs: [“get”, “watch”]

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cert-manager-webhook-joker:secret-reader
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cert-manager-webhook-joker:secret-reader
subjects:

  • apiGroup: “”
    kind: ServiceAccount
    name: cert-manager-webhook-joker
    EOF
    ```

    1. Clone the github repository:
  1. git clone https://github.com/4nx/cert-manager-webhook-joker.git
  1. Install the Helm chart with:
  1. helm upgrade --install cert-manager-webhook-joker --namespace cert-manager deploy/cert-manager-webhook-joker
  1. Create a certificate issuer with the letsencrypt staging ca for testing purposes (you must insert your e-mail address):
  1. cat <<EOF | kubectl apply -f -
  2. apiVersion: cert-manager.io/v1
  3. kind: ClusterIssuer
  4. metadata:
  5. name: letsencrypt-staging-dns01
  6. spec:
  7. acme:
  8. # Change to your letsencrypt email
  9. email: <your email>
  10. server: https://acme-staging-v02.api.letsencrypt.org/directory
  11. privateKeySecretRef:
  12. name: letsencrypt-staging-account-key
  13. solvers:
  14. - dns01:
  15. webhook:
  16. groupName: acme.yourcompany.com
  17. solverName: joker
  18. config:
  19. baseURL: https://svc.joker.com/nic/replace
  20. dnsType: TXT
  21. userNameSecretRef:
  22. name: joker-credentials
  23. key: username
  24. passwordSecretRef:
  25. name: joker-credentials
  26. key: password
  27. EOF
  1. Issue a test certificate (replace the test urls in here):
  1. cat <<EOF | kubectl apply -f -
  2. apiVersion: cert-manager.io/v1alpha2
  3. kind: Certificate
  4. metadata:
  5. name: example-tls
  6. spec:
  7. secretName: example-com-tls
  8. commonName: example.com
  9. dnsNames:
  10. - example.com
  11. - "*.example.com"
  12. issuerRef:
  13. name: letsencrypt-staging-dns01
  14. kind: ClusterIssuer
  15. EOF

Development

All DNS providers must run the DNS01 provider conformance testing suite, else they will have undetermined behaviour when used with cert-manager.

It is essential that you configure and run the test suite when creating a DNS01 webhook.

Before you can run the test suite, you need to download the test binaries:

  1. ./scripts/fetch-test-binaries.sh

Then duplicate the .sample files in testdata/joker/ and update the configuration with the appropriate Joker.com credentials.

Now you can run the test suite with:

  1. TEST_ZONE_NAME=example.com. go test .