cert-manager-webhook-inwx
by andibraeu
A Helm chart cert-manager ACME Webhook for INWX
About this chart
ACME Webhook for INWX
This project provides a cert-manager ACME Webhook for INWX and a corresponding helm chart.
The helm chart is listed at Artifact Hub in repository andibraeu at https://artifacthub.io/packages/helm/andibraeu/cert-manager-webhook-inwx.
Requirements
- helm >= v3.0.0
- kubernetes >= v1.18.0
- cert-manager >= 1.0.0
Configuration
The following table lists the configurable parameters of the cert-manager chart and their default values.
| Parameter | Description | Default |
|---|---|---|
groupName | Group name of the API service. | cert-manager-webhook-inwx.smueller18.gitlab.com |
credentialsSecretRefs | Names of secrets where INWX credentials are stored. Used for RBAC to allow reading the secret by the service account name of webhook. | ['inwx-credentials'] |
deployment.loglevel | Number for the log level verbosity of webhook deployment | 2 |
certManager.namespace | Namespace where cert-manager is deployed to. | cert-manager |
certManager.serviceAccountName | Service account of cert-manager installation. | cert-manager |
image.repository | Image repository | registry.gitlab.com/smueller18/cert-manager-webhook-inwx |
image.tag | Image tag | v0.6.0 |
image.pullPolicy | Image pull policy | IfNotPresent |
service.type | API service type | ClusterIP |
service.port | API service port | 443 |
resources | CPU/memory resource requests/limits | {} |
nodeSelector | Node labels for pod assignment | {} |
affinity | Node affinity for pod assignment | {} |
tolerations | Node tolerations for pod assignment | [] |
Installation
cert-manager
Follow the instructions using the cert-manager documentation to install it within your cluster.
Webhook
helm repo add andibraeu https://andibraeu.github.io/helmcharts/
helm repo update
helm install --namespace cert-manager cert-manager-webhook-inwx abdibraeu/cert-manager-webhook-inwx
Note: The kubernetes resources used to install the Webhook should be deployed within the same namespace as the cert-manager.
To uninstall the webhook run
helm uninstall --namespace cert-manager cert-manager-webhook-inwx
Issuer
Create a ClusterIssuer or Issuer resource as following:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
# The ACME server URL
server: https://acme-staging-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: [email protected] # REPLACE THIS WITH YOUR EMAIL!!!
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- dns01:
webhook:
groupName: cert-manager-webhook-inwx.smueller18.gitlab.com
solverName: inwx
config:
ttl: 300 # default 300
sandbox: false # default false
# prefer using secrets!
# username: USERNAME
# password: PASSWORD
# otpKey: OTPKEY
usernameSecretKeyRef:
name: inwx-credentials
key: username
passwordSecretKeyRef:
name: inwx-credentials
key: password
otpKeySecretKeyRef:
name: inwx-credentials
key: otpKey
Credentials
For accessing INWX DNS provider, you need the username and password of the account. You have two choices for the configuration for the credentials, but you can also mix them. When username or password are set, these values are preferred, and the secret will not be used.
If you choose another name for the secret than inwx-credentials, ensure to add to or modify the value of credentialsSecretRefs in values.yaml.
The secret for the example above will look like this:
Without 2FA
apiVersion: v1
kind: Secret
metadata:
name: inwx-credentials
stringData:
username: USERNAME
password: PASSWORD
With 2FA enabled
apiVersion: v1
kind: Secret
metadata:
name: inwx-credentials
stringData:
username: USERNAME
password: PASSWORD
otpKey: OTPKEY
Create a certificate
Finally you can create certificates, for example:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: cert-manager
spec:
commonName: example.com
dnsNames:
- example.com
issuerRef:
kind: ClusterIssuer
name: letsencrypt-staging
secretName: example-cert
Deploy cert-manager-webhook-inwx 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-inwx 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcert-manager-webhook-inwx is pinned at v0.9.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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