| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Facilitate a webhook integration for leveraging the STACKIT DNS alongside its API to act as a DNS01 ACME Issuer with cert-manager.
helm repo add stackit-cert-manager-webhook https://stackitcloud.github.io/stackit-cert-manager-webhook
helm install stackit-cert-manager-webhook --namespace cert-manager stackit-cert-manager-webhook/stackit-cert-manager-webhookInitiation of STACKIT Service Account Secret:
kubectl create secret generic stackit-sa-authentication \
-n cert-manager \
--from-literal=sa.json='{
"id": "4e1fe486-b463-4bcd-9210-288854268e34",
"publicKey": "-----BEGIN PUBLIC KEY-----\nPUBLIC_KEY\n-----END PUBLIC KEY-----",
"createdAt": "2024-04-02T13:12:17.678+00:00",
"validUntil": "2024-04-15T22:00:00.000+00:00",
"keyType": "USER_MANAGED",
"keyOrigin": "GENERATED",
"keyAlgorithm": "RSA_2048",
"active": true,
"credentials": {
"kid": "kid",
"iss": "iss",
"sub": "sub",
"aud": "aud",
"privateKey": "-----BEGIN PRIVATE KEY-----\nPRIVATE-KEY==\n-----END PRIVATE KEY-----"
}
}'You now need to adjust the deployment via helm to use the secret:
helm upgrade stackit-cert-manager-webhook \
--namespace cert-manager \
stackit-cert-manager-webhook/stackit-cert-manager-webhook \
--set stackitSaAuthentication.enabled=trueConfiguration of ClusterIssuer/Issuer:
For scenarios wherein zones and record sets are encapsulated within a singular project, utilize a ClusterIssuer:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: example@example.com # Replace this with your email address
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- dns01:
webhook:
solverName: stackit
groupName: acme.stackit.de
config:
projectId: <STACKIT PROJECT ID>For diverse project architectures where zones are spread across varying projects, use an Issuer (namespaces are separate):
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-prod
namespace: default
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: example@example.com # Replace this with your email address
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- dns01:
webhook:
solverName: stackit
groupName: acme.stackit.de
config:
projectId: <STACKIT PROJECT ID>Note on service accounts and namespaces:
kubectl create secret generic stackit-sa-authentication \
-n <issuer-namespace> \
--from-literal=sa.json='{"id":"...","credentials":{...}}'Demonstration of Ingress Integration with Wildcard SSL/TLS Certificate Generation
Given the preceding configuration, it is possible to exploit the capabilities of the Issuer or ClusterIssuer to
dynamically produce wildcard SSL/TLS certificates in the following manner:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: wildcard-example
namespace: default
spec:
secretName: wildcard-example-tls
issuerRef:
name: letsencrypt-prod
kind: Issuer
commonName: '*.example.runs.onstackit.cloud' # project must be the owner of this zone
duration: 8760h0m0s
dnsNames:
- example.runs.onstackit.cloud
- '*.example.runs.onstackit.cloud'
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
namespace: default
annotations:
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: "app.example.runs.onstackit.cloud"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webapp
port:
number: 80
tls:
- hosts:
- "app.example.runs.onstackit.cloud"
secretName: wildcard-example-tlsThe following table delineates the configuration options available for the STACKIT Cert Manager Webhook:
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-prod
namespace: default
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: example@example.com # Replace this with your email address
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- dns01:
webhook:
solverName: stackit
groupName: acme.stackit.de
config:
projectId: string
apiBasePath: string
serviceAccountKeyPath: string
serviceAccountBaseUrl: string
acmeTxtRecordTTL: int64make testmake coveragemake lintRuns the official cert-manager Go solver test suite in memory against the STACKIT API:
STACKIT_TOKEN="<token>" TEST_ZONE_NAME="example.com" make test-e2e-conformanceFollow the comprehensive guide available here.
Spins up a local Kind cluster, installs cert-manager, builds and deploys the webhook, and executes Kuttl integration tests (testing single-record lifecycle and wildcard certificates against Let's Encrypt Staging):
make test-e2e-local \
PROJECT_ID="<your-project-id>" \
ZONE_NAME="<your-test-zone>" \
AUTH_KEY_PATH="<path-to-sa-key.json>"Follow the comprehensive guide available here.
Our release pipeline leverages goreleaser for the generation and publishing of release assets. This sophisticated approach ensures the streamlined delivery of:
However, one should be cognizant of the fact that goreleaser doesn't inherently support Helm chart distributions
as part of its conventional workflow. Historically, the incorporation of Helm charts into our releases demanded manual
intervention. Post the foundational release generation via goreleaser, the Helm chart was affixed as an asset through
manual processes.
For those interested in the Helm chart creation mechanics, the process was facilitated via the command:
helm package deploy/stackitTo release a new version of the Helm chart, one must meticulously update the appVersion and (chart)version delineation in the Chart.yaml. Post this modification, initiate a new release to encompass these changes.
| Back | FazBrowse Home | New Git URL |