@@ -140,33 +140,6 @@ COPY --from=tilt-helper /restart.sh .
140
140
COPY manager .
141
141
"""
142
142
143
- cert_manager_test_resources = """
144
- apiVersion: v1
145
- kind: Namespace
146
- metadata:
147
- name: cert-manager-test
148
- ---
149
- apiVersion: cert-manager.io/v1alpha2
150
- kind: Issuer
151
- metadata:
152
- name: test-selfsigned
153
- namespace: cert-manager-test
154
- spec:
155
- selfSigned: {}
156
- ---
157
- apiVersion: cert-manager.io/v1alpha2
158
- kind: Certificate
159
- metadata:
160
- name: selfsigned-cert
161
- namespace: cert-manager-test
162
- spec:
163
- dnsNames:
164
- - example.com
165
- secretName: selfsigned-cert-tls
166
- issuerRef:
167
- name: test-selfsigned
168
- """
169
-
170
143
# Configures a provider by doing the following:
171
144
#
172
145
# 1. Enables a local_resource go build of the provider's manager binary
@@ -234,39 +207,6 @@ def enable_provider(name):
234
207
yaml = str (kustomize_with_envsubst (context + "/config" ))
235
208
k8s_yaml (blob (yaml ))
236
209
237
- # Prepull all the cert-manager images to your local environment and then load them directly into kind. This speeds up
238
- # setup if you're repeatedly destroying and recreating your kind cluster, as it doesn't have to pull the images over
239
- # the network each time.
240
- def deploy_cert_manager ():
241
- registry = settings .get ("cert_manager_registry" , "quay.io/jetstack" )
242
- version = settings .get ("cert_manager_version" , "v0.16.1" )
243
-
244
- # check if cert-mamager is already installed, otherwise pre-load images & apply the manifest
245
- # NB. this is required until https://github.com/jetstack/cert-manager/issues/3121 is addressed otherwise
246
- # when applying the manifest twice to same cluster kubectl get stuck
247
- existsCheck = str (local ("kubectl get namespaces" ))
248
- if existsCheck .find ("cert-manager" ) == - 1 :
249
- # pre-load cert-manager images in kind
250
- images = ["cert-manager-controller" , "cert-manager-cainjector" , "cert-manager-webhook" ]
251
- if settings .get ("preload_images_for_kind" ):
252
- for image in images :
253
- local ("docker pull {}/{}:{}" .format (registry , image , version ))
254
- local ("kind load docker-image --name {} {}/{}:{}" .format (settings .get ("kind_cluster_name" ), registry , image , version ))
255
-
256
- # apply the cert-manager manifest
257
- local ("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml" .format (version ))
258
-
259
- # verifies cert-manager is properly working (https://cert-manager.io/docs/installation/kubernetes/#verifying-the-installation)
260
- # 1. wait for the cert-manager to be running
261
- local ("kubectl wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager" )
262
- local ("kubectl wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-cainjector" )
263
- local ("kubectl wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-webhook" )
264
-
265
- # 2. create a test certificate
266
- local ("cat << EOF | kubectl apply -f - " + cert_manager_test_resources + "EOF" )
267
- local ("kubectl wait --for=condition=Ready --timeout=300s -n cert-manager-test certificate/selfsigned-cert " )
268
- local ("cat << EOF | kubectl delete -f - " + cert_manager_test_resources + "EOF" )
269
-
270
210
# Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will
271
211
# not be checked in to version control.
272
212
def include_user_tilt_files ():
@@ -292,6 +232,8 @@ include_user_tilt_files()
292
232
293
233
load_provider_tiltfiles ()
294
234
235
+ load ("ext://cert_manager" , "deploy_cert_manager" )
236
+
295
237
if settings .get ("deploy_cert_manager" ):
296
238
deploy_cert_manager ()
297
239
0 commit comments