Skip to content

Commit ca763e8

Browse files
committed
Support ACME certificates for managed ingress domains
Signed-off-by: Ryan Djurovich <git@ryan0x44.com>
1 parent 937e5b6 commit ca763e8

8 files changed

Lines changed: 51 additions & 16 deletions

File tree

charts/platform-certs/templates/ingress-certificate-crp.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ spec:
1717
- "platform-traefik"
1818
allowed:
1919
# Deny commonName - must not be present
20-
# Platform Traefik owns ingress TLS termination; allow any DNS name from
21-
# this namespace while keeping CA and client certificate issuance blocked.
20+
# Platform Traefik owns ingress TLS termination. Permit only the configured
21+
# apex and wildcard names from its namespace.
2222
dnsNames:
2323
required: true
24-
values: ["*"]
24+
validations:
25+
- rule: {{ printf "self in %s" (toJson .Values.platform.certs.ingress.dnsNames) | quote }}
26+
message: "DNS SAN must be one of the configured ingress names"
2527
# Restrict to server auth only
2628
usages:
2729
- "digital signature"

charts/platform-certs/values.schema.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@
105105
}
106106
},
107107
"required": ["issuerName"]
108+
},
109+
"dnsNames": {
110+
"type": "array",
111+
"items": {
112+
"type": "string",
113+
"minLength": 1
114+
}
108115
}
109116
},
110-
"required": ["acme", "selfsigned"]
117+
"required": ["acme", "selfsigned", "dnsNames"]
111118
},
112119
"secretSync": {
113120
"type": "object",

charts/platform-certs/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ platform:
1919
solvers: []
2020
selfsigned:
2121
issuerName: platform-ingress-selfsigned-clusterissuer
22+
dnsNames: []
2223
secretSync:
2324
enabled: false
2425
image:

charts/platform-components/templates/namespaces.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ metadata:
4242
name: {{ $app.namespace }}
4343
annotations:
4444
helm.sh/resource-policy: keep
45+
{{- with $app.namespaceAnnotations }}
46+
{{ toYaml . | indent 4 }}
47+
{{- end }}
4548
labels:
4649
app.kubernetes.io/managed-by: Helm
4750
{{- if and $tbEnabled (eq $app.namespace $tbNamespace) }}

charts/platform-components/values.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
"manageNamespace": {
7878
"type": "boolean"
7979
},
80+
"namespaceAnnotations": {
81+
"type": "object",
82+
"additionalProperties": {
83+
"type": "string"
84+
}
85+
},
8086
"core": {
8187
"type": "boolean",
8288
"description": "When true, the Podplane CLI treats this component as core and will refuse to uninstall it."

charts/platform-components/values.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ platform:
167167
# platform-certs:
168168
# platform:
169169
# certs:
170-
# acme:
171-
# enabled: true
172-
# server: https://acme-v02.api.letsencrypt.org/directory
173-
# email: ops@example.com
174-
# solvers:
175-
# - dnsZones:
176-
# - example.com
177-
# route53:
178-
# hostedZoneID: Z123456789
179-
# roleArn: arn:aws:iam::123456789012:role/podplane-cert-manager-dns01
170+
# ingress:
171+
# acme:
172+
# enabled: true
173+
# server: https://acme-v02.api.letsencrypt.org/directory
174+
# email: ops@example.com
175+
# solvers:
176+
# - dnsZones:
177+
# - example.com
178+
# route53:
179+
# hostedZoneID: Z123456789
180180
# traefik:
181181
# platform:
182182
# traefik:

charts/traefik/templates/traefik-certificates.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{{- $ingress := .Values.platform.traefik.ingress -}}
66
{{- range $ingress.domains }}
77
{{- $zone := include "podplane.traefik.domainName" . }}
8+
{{- $issuerRef := default $ingress.issuerRef .issuerRef }}
89
---
910
apiVersion: cert-manager.io/v1
1011
kind: Certificate
@@ -17,8 +18,8 @@ spec:
1718
size: 256
1819
rotationPolicy: Always
1920
issuerRef:
20-
kind: {{ $ingress.issuerRef.kind }}
21-
name: {{ $ingress.issuerRef.name }}
21+
kind: {{ $issuerRef.kind }}
22+
name: {{ $issuerRef.name }}
2223
dnsNames:
2324
- {{ $zone | quote }}
2425
- {{ printf "*.%s" $zone | quote }}

charts/traefik/values.schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@
6060
},
6161
"default": {
6262
"type": "boolean"
63+
},
64+
"issuerRef": {
65+
"type": "object",
66+
"additionalProperties": false,
67+
"properties": {
68+
"kind": {
69+
"type": "string",
70+
"minLength": 1
71+
},
72+
"name": {
73+
"type": "string",
74+
"minLength": 1
75+
}
76+
},
77+
"required": ["kind", "name"]
6378
}
6479
},
6580
"required": ["zone"]

0 commit comments

Comments
 (0)