cert-manager-webhook-vultr

by vultr

Helm chartv1.0.0App v0.1.0Verified publisherOfficial

A Vultr cert-manager repo for creating an ACME DNS01 solver webhook

About this chart

Vultr Webhook for Cert Manager

This is a webhook solver for Vultr to be used with Cert-Manager

Prerequisites

There are a few things required before you can start using cert-manager-webhook-vultr.

  • Helm v3+ is required to install the cert-manager-webhook-vultr charts
  • Cert-Manager needs to be running on your cluster prior.

Installation

Get Repo Info

helm repo add vultr https://vultr.github.io/helm-charts
helm repo update

See helm repo for command documentation.

Installing the Chart

First, you will need to deploy a secret with your api key.

kubectl create secret generic "vultr-credentials" --from-literal=apiKey=<VULTR API KEY> --namespace=cert-manager

Second, you will need to deploy the cert-manager-webhook-vultr. We have a helm chart that makes installation of this fairly straightforward.

# Helm
helm install [RELEASE_NAME] vultr/cert-manager-webhook-vultr

This will deploy all necessary services, deployments, rbac, and various other resources required for cert-manager.

Uninstall the Chart

To uninstall the webhook run the following:

# Helm
helm uninstall [RELEASE_NAME]

See helm uninstall for command documentation.

Deploying a ClusterIssuer

Below we will deploy a ClusterIssuer which will use LetsEncrypt staging environment

apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
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: <enter your email address>
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      # Secret resource that will be used to store the account's private key.
      name: letsencrypt-staging
    solvers:
    - dns01:
        webhook:
          groupName: acme.vultr.com
          solverName: vultr
          config:
            apiKeySecretRef:
              key: apiKey
              name: vultr-credentials

We also need to grant permissions for the service account to be able to grab the secret .

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: cert-manager-webhook-vultr:secret-reader
  namespace: cert-manager
rules:
- apiGroups: [""]
  resources: ["secrets"]
  resourceNames: ["vultr-credentials"]
  verbs: ["get", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: cert-manager-webhook-vultr:secret-reader
  namespace: cert-manager
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: cert-manager-webhook-vultr:secret-reader
subjects:
  - apiGroup: ""
    kind: ServiceAccount
    name: cert-manager-webhook-vultr

Request a certificate

The Certificate resource represents a human readable definition of a certificate request that is to be honored by an issuer which is to be kept up-to-date.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: staging-cert-example-com
spec:
  commonName: example.com # REPLACE THIS WITH YOUR DOMAIN
  dnsNames:
  - example.com # REPLACE THIS WITH YOUR DOMAIN
  issuerRef:
    name: letsencrypt-staging
    kind: ClusterIssuer
  secretName: example-com-tls

To check on the certificate run the following:

kubectl describe certificate staging-cert-example-com

To delete a certificate run the following:

kubectl delete certificate staging-cert-example-com

Troubleshooting

Cert-Manager has a great page that describes how to troubleshoot.

Deploy cert-manager-webhook-vultr with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cert-manager-webhook-vultr on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcert-manager-webhook-vultr is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply