Skip to content

Commit 783c8d6

Browse files
Pothulapatiroboquat
authored andcommitted
[kots] remove cert-manager from Gitpod package
Currently, We include `cert-manager` instance into the Gitpod kots package, and install it whenever Gitpod installation is requested. This causes the following problems: - `cert-manager` is a separate beast on its own, There are numerous configurations that might be needed to be set to make it run correctly. - A lot users could have already have it installed, and have to struggle to get Gitpod up and running in those cases. To solve them, We could either provide all the configurations of `cert-manager` into the Gitpod package to cater users with all config needs or remove the package and expect `cert-manager` as a pre-requisite and make sure its documented. The latter feels better as it removes the maintaince of cert-manager for us while also allowing users to have specific configuration. The install path for `cert-manager` is [also pretty well documented](https://cert-manager.io/docs/installation/) with all the [changes needed based on the cluster environment](https://cert-manager.io/docs/installation/compatibility/). This PR also removes the cert-manager issuers and updates the config to allow users to use pre-configured resources Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent 400908c commit 783c8d6

10 files changed

+15
-4329
lines changed

install/kots/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CHANNEL_BETA = Beta
33
CHANNEL_UNSTABLE = Unstable
44
YAML_DIR = manifests
55

6-
all: helm lint create_dev_release
6+
all: lint create_dev_release
77

88
create_dev_release:
99
@if [ "${REPLICATED_DEV_CHANNEL}" = "" ]; then \
@@ -27,8 +27,3 @@ lint:
2727
replicated release lint --yaml-dir ${YAML_DIR}
2828
.PHONY: lint
2929

30-
helm:
31-
@echo "Installing Helm dependencies"
32-
@rm -f manifests/*.tgz
33-
@for f in $(shell ls -d charts/*/); do cd $${f} && helm dep up && helm package . --destination ../../manifests && cd -; done
34-
.PHONY: helm

install/kots/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,8 @@ The following environment variables are required to be able to publish to our Re
3434

3535
- Starts with `kots` - part of the KOTS configuration. Typically, this will follow the KOTS documentation/conventions
3636
- Starts with `gitpod` - part of the Gitpod application. Typically, this will be something we define/own
37-
- Starts with `helm` - a Helm chart
3837
- Starts with `crd` - a Custom Resource Definition
3938

40-
## Helm charts
41-
42-
KOTS [requires](https://kots.io/reference/v1beta1/helmchart) Helm charts to be uploaded as a `.tgz`
43-
file. The `make helm` command iterates through everything inside `charts`, installs the dependencies
44-
and packages them up as a `.tgz` file.
45-
46-
The `.tgz` files should not be committed to the repository.
47-
4839
# Create a development release
4940

5041
A development release can be created by running `make create_dev_release`. This builds and publishes

install/kots/charts/cert-manager/Chart.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

install/kots/manifests/crd-cert-manager.yaml

Lines changed: 0 additions & 4180 deletions
This file was deleted.

install/kots/manifests/gitpod-certificate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ metadata:
1010
spec:
1111
secretName: https-certificates
1212
issuerRef:
13-
name: '{{repl if (ConfigOptionEquals "tls_self_signed_enabled" "1" ) }}ca-issuer{{repl else }}gitpod-issuer{{repl end }}'
14-
kind: '{{repl if or (ConfigOptionEquals "tls_self_signed_enabled" "1") (ConfigOptionNotEquals "cert_manager_provider" "azure") }}Issuer{{repl else }}ClusterIssuer{{repl end }}'
13+
name: '{{repl if (ConfigOptionEquals "tls_self_signed_enabled" "1" ) }}ca-issuer{{repl else }}{{repl ConfigOption "cert_manager_issuer_name" }}{{repl end }}'
14+
kind: '{{repl if (ConfigOptionEquals "tls_self_signed_enabled" "1" ) }}Issuer{{repl else }}{{repl ConfigOption "cert_manager_issuer" }}{{repl end }}'
1515
dnsNames:
1616
- '{{repl ConfigOption "domain" }}'
1717
- '*.{{repl ConfigOption "domain" }}'

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,6 @@ spec:
1818
spec:
1919
serviceAccountName: installer
2020
restartPolicy: OnFailure
21-
initContainers:
22-
# Checks that the cert-manager installation is complete
23-
- name: cert-manager
24-
image: alpine/helm
25-
command:
26-
- /bin/sh
27-
- -c
28-
args:
29-
- |
30-
set -e
31-
32-
echo "Gitpod: Install jq"
33-
apk add --no-cache jq
34-
35-
echo "Gitpod: Perform the check"
36-
while [ "$(helm status -n {{repl Namespace }} cert-manager -o json | jq '.info.status == "deployed"')" = "false" ];
37-
do
38-
echo "Gitpod: Release not found - will retry in 10s"
39-
sleep 10
40-
done
41-
42-
echo "Gitpod: Release found - goodbye"
4321
containers:
4422
- name: installer
4523
# This will normally be the release tag - using this tag as need the license evaluator

install/kots/manifests/gitpod-issuer-azure.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

install/kots/manifests/gitpod-issuer-gcp.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

install/kots/manifests/helm-cert-manager.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

install/kots/manifests/kots-config.yaml

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -259,60 +259,26 @@ spec:
259259
when: '{{repl ConfigOptionEquals "tls_self_signed_enabled" "0" }}'
260260
help_text: Automate certificate management with [cert-manager](https://cert-manager.io).
261261

262-
- name: cert_manager_acme_url
263-
title: ACME URL
262+
- name: cert_manager_issuer_name
263+
title: Issuer name
264264
type: text
265-
value: https://acme-v02.api.letsencrypt.org/directory
265+
value: gitpod-issuer
266266
required: true
267267
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
268-
help_text: The ACME URL is used to issue the certificates.
268+
help_text: The name of the issuer you wish to use to generate your certificate. This will be the Kubernetes resource name.
269269

270-
- name: cert_manager_email
271-
title: Email address
272-
type: text
273-
required: false
274-
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") }}'
275-
help_text: The email address to send renewal notifications to.
276-
277-
- name: cert_manager_provider
278-
title: DNS01 provider
270+
- name: cert_manager_issuer
271+
title: Issuer type
279272
type: select_one
273+
default: "ClusterIssuer" # Default to ClusterIssuer so it can be stored in a different namespace
280274
required: true
281275
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.
276+
help_text: A [DNS01](https://cert-manager.io/docs/configuration/acme/dns01) `Issuer` or `ClusterIssuer` is required on the cluster to generate the certificate.
283277
items:
284-
- name: azure
285-
title: AzureDNS
286-
- name: gcp
287-
title: Google CloudDNS
288-
289-
- name: cert_manager_azure_subscription_id
290-
title: Subscription ID
291-
type: text
292-
required: true
293-
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
294-
help_text: The Azure subscription ID.
295-
296-
- name: cert_manager_azure_resource_group
297-
title: Resource group
298-
type: text
299-
required: true
300-
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "azure") }}'
301-
help_text: The name of the resource group where the DNS zone exists.
302-
303-
- name: cert_manager_gcp_project
304-
title: Project ID
305-
type: text
306-
required: true
307-
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
308-
help_text: The ID of your GCP project.
309-
310-
- name: cert_manager_gcp_credentials
311-
title: GCP service account key
312-
when: '{{repl and (ConfigOptionEquals "tls_self_signed_enabled" "0") (ConfigOptionEquals "cert_manager_enabled" "1") (ConfigOptionEquals "cert_manager_provider" "gcp") }}'
313-
type: file
314-
required: true
315-
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.
278+
- name: ClusterIssuer
279+
title: Cluster issuer
280+
- name: Issuer
281+
title: Issuer
316282

317283
- name: tls_crt
318284
title: Certificate

0 commit comments

Comments
 (0)