Skip to content

Commit

Permalink
Merge pull request #5278 from audrastump/certmanagerInstallationCheck
Browse files Browse the repository at this point in the history
cert manager is only installed if version mismatch or not yet installed
  • Loading branch information
k8s-ci-robot authored Dec 23, 2024
2 parents d2dac62 + 90d711d commit dfc512f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tilt_modules/cert_manager/Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ def deploy_cert_manager(registry="quay.io/jetstack", version="v1.3.1", load_to_k
# NOTE!
# Applying the same manifest twice to same cluster kubectl get stuck with older versions of kubernetes/cert-manager.
# https://github.com/jetstack/cert-manager/issues/3121
print("Installing cert-manager")
local("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml".format(version), quiet=silent, echo_off=silent)

#verify that the installed version is the same as the version parameter and cert-manager is installed
#install the cert-manager if one of these is false
installed_version = local("kubectl get deployment -n cert-manager cert-manager -o=jsonpath='{.spec.template.spec.containers[0].image}' | awk -F':' '{print $2}'")
if str(installed_version).strip()!= version:
print("Cert-manager either not installed or version mismatch, installing...")
local("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml".format(version))

# verifies cert-manager is properly working (https://cert-manager.io/docs/installation/kubernetes/#verifying-the-installation)
# 1. wait for the cert-manager to be running
Expand Down

0 comments on commit dfc512f

Please sign in to comment.