Skip to content

Commit f1f735c

Browse files
author
Simon Emms
committed
[kots]: make the self-hosted cert more explicitly selectable
The previous "in-cluster" naming still required the config to receive LetsEncrypt variables. This has now been switched to a "select self-signed" or "use a valid cert" flow
1 parent 103f835 commit f1f735c

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

install/kots/manifests/gitpod-certificate.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ kind: Certificate
33
metadata:
44
name: https-certificates
55
annotations:
6-
kots.io/when: '{{repl ConfigOptionEquals "cert_manager_enabled" "1" }}'
6+
kots.io/when: '{{repl or (ConfigOptionEquals "tls_self_signed_enabled" "1") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
77
spec:
88
secretName: https-certificates
99
issuerRef:
10-
name: '{{repl if (ConfigOptionEquals "cert_manager_provider" "incluster" ) }}ca-issuer{{repl else }}gitpod-issuer{{repl end }}'
11-
kind: '{{repl if (ConfigOptionEquals "cert_manager_provider" "azure") }}ClusterIssuer{{repl else }}Issuer{{repl end }}'
10+
name: '{{repl if (ConfigOptionEquals "tls_self_signed_enabled" "1" ) }}ca-issuer{{repl else }}gitpod-issuer{{repl end }}'
11+
kind: '{{repl if or (ConfigOptionEquals "tls_self_signed_enabled" "1") (ConfigOptionNotEquals "cert_manager_provider" "azure") }}Issuer{{repl else }}ClusterIssuer{{repl end }}'
1212
dnsNames:
1313
- '{{repl ConfigOption "domain" }}'
1414
- '*.{{repl ConfigOption "domain" }}'

install/kots/manifests/kots-config.yaml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,65 +246,70 @@ spec:
246246
title: TLS certificates
247247
description: Certificates are required to maintain a secure connection. The DNS names must be for `$DOMAIN`, `*.$DOMAIN` and `*.ws.$DOMAIN`.
248248
items:
249+
- name: tls_self_signed_enabled
250+
title: Use a self-signed TLS certificate
251+
type: bool
252+
default: "0"
253+
help_text: A self-signed certficate should only be used if applying TLS termination to your load balancer or other proxy.
254+
249255
- name: cert_manager_enabled
250256
title: Use cert-manager
251257
type: bool
252258
default: "1"
259+
when: '{{repl ConfigOptionEquals "tls_self_signed_enabled" "0" }}'
253260
help_text: Automate certificate management with [cert-manager](https://cert-manager.io).
254261

255262
- name: cert_manager_acme_url
256263
title: ACME URL
257264
type: text
258265
value: https://acme-v02.api.letsencrypt.org/directory
259266
required: true
260-
when: '{{repl ConfigOptionEquals "cert_manager_enabled" "1" }}'
267+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
261268
help_text: The ACME URL is used to issue the certificates.
262269

263270
- name: cert_manager_email
264271
title: Email address
265272
type: text
266273
required: false
267-
when: '{{repl ConfigOptionEquals "cert_manager_enabled" "1" }}'
274+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
268275
help_text: The email address to send renewal notifications to.
269276

270277
- name: cert_manager_provider
271278
title: DNS01 provider
272279
type: select_one
273280
required: true
274-
when: '{{repl ConfigOptionEquals "cert_manager_enabled" "1" }}'
275-
help_text: A DNS01 challenge provider is used by cert-manager in order to generate the certificate. See the [specific documentation](https://cert-manager.io/docs/configuration/acme/dns01) for instructions on configuring your provider. In-cluster should only be used if applying TLS termination to your load balancer or other proxy.
281+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
282+
help_text: A DNS01 challenge provider is used by cert-manager in order to generate the certificate. See the [specific documentation](https://cert-manager.io/docs/configuration/acme/dns01) for instructions on configuring your provider.
276283
items:
277284
- name: azure
278285
title: AzureDNS
279286
- name: gcp
280287
title: Google CloudDNS
281-
- name: incluster
282-
title: In-cluster
283288

284289
- name: cert_manager_azure_subscription_id
285290
title: Subscription ID
286291
type: text
287292
required: true
288-
when: '{{repl and (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
293+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
289294
help_text: The Azure subscription ID.
290295

291296
- name: cert_manager_azure_resource_group
292297
title: Resource group
293298
type: text
294299
required: true
295-
when: '{{repl and (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
300+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
296301
help_text: The name of the resource group where the DNS zone exists.
297302

298303
- name: cert_manager_gcp_project
299304
title: Project ID
300305
type: text
301306
required: true
302-
when: '{{repl and (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
307+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
303308
help_text: The ID of your GCP project.
304309

305310
- name: cert_manager_gcp_credentials
306311
title: GCP service account key
307-
when: '{{repl and (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
312+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
308313
type: file
309314
required: true
310315
help_text: Download a [service account key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) with the `roles/dns.admin` role attached.
@@ -313,14 +318,14 @@ spec:
313318
title: Certificate
314319
type: file
315320
required: true
316-
when: '{{repl ConfigOptionEquals "cert_manager_enabled" "0" }}'
321+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "0") }}'
317322
help_text: A file containing the TLS crt.
318323

319324
- name: tls_key
320325
title: Private key
321326
type: file
322327
required: true
323-
when: '{{repl ConfigOptionEquals "cert_manager_enabled" "0" }}'
328+
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "0") }}'
324329
help_text: A file containing the TLS private key.
325330

326331
- name: features

0 commit comments

Comments
 (0)