Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Add hack to upgrade cert-manager in Tiltfile #3462

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR updates the version of cert-manager used in the Tilfile to v0.16.0 (same installed by clusterctl after #3313 merged)

Additionally, the cert-manager version is now a variable that can be set in the tilt-settings.yaml file, so, no code change are required to test older versions if required (tested with v0.11.0).

Finally, the code that verifies if cert-manager is properly working is now aligned to https://cert-manager.io/docs/installation/kubernetes/#verifying-the-installation (same used in clusterctl)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 6, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 6, 2020
@fabriziopandini fabriziopandini force-pushed the upgrade-cert-manager-in-tiltfile branch from 32f5ea3 to 3c347ae Compare August 6, 2020 12:37
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/assign @ncdc
/milestone v0.3.9

@k8s-ci-robot k8s-ci-robot added this to the v0.3.9 milestone Aug 6, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2020
@ncdc
Copy link
Contributor

ncdc commented Aug 6, 2020

@fabriziopandini does clusterctl init/upgrade have the issue with the cert-manager CRDs & hanging?

@wfernandes
Copy link
Contributor

@ncdc If you are referring to this issue cert-manager/cert-manager#3121,
clusterctl init does a check to see if cert-manager is installed before trying to install cert-manager again.
cluserctl upgrade doesn't upgrade cert-manager, just the providers.

@fabriziopandini
Copy link
Member Author

@ncdc
clusterctl init does not have this problem (see warren comment)
WRT to clusterctl upgrade I have a PR in flight to upgrade cert-manger before upgrading providers, but it already contains a check that the upgrade is executed only if the current version is older than the one embedded in clusterctl; I'm going to execute some focused test now that I'm aware of this problem.

@vincepri
Copy link
Member

vincepri commented Aug 7, 2020

Are we planning to have clusterctl upgrade to upgrade cert-manager at any point?

Nvm, I saw @fabriziopandini 's response above

@vincepri
Copy link
Member

vincepri commented Aug 7, 2020

I wish in the future tilt uses clusterctl in one way or another, instead of re-implementing things

Comment on lines +237 to +250
# check if cert-mamager is already installed, otherwise pre-load images & apply the manifest
# NB. this is required until https://github.com/jetstack/cert-manager/issues/3121 is addressed otherwise
# when applying the manifest twice to same cluster kubectl get stuck
existsCheck = str(local("kubectl get namespaces"))
if existsCheck.find("cert-manager") == -1:
# pre-load cert-manager images in kind
images = ["cert-manager-controller", "cert-manager-cainjector", "cert-manager-webhook"]
if settings.get("preload_images_for_kind"):
for image in images:
local("docker pull {}/{}:{}".format(registry, image, version))
local("kind load docker-image --name {} {}/{}:{}".format(settings.get("kind_cluster_name"), registry, image, version))

# apply the cert-manager manifest
local("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml".format(version))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only happen if you already have a cluster up and running with an older version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my tests this happens when you have a cluster running with v01.6.0 already installed
(tilt up, then exit from tilt without cleaning up your environment, then tilt up again)

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/retitle 🌱 Add hack to upgrade cert-manager in Tiltfile

@k8s-ci-robot k8s-ci-robot changed the title 🌱 Upgrade cert-manager in Tiltfile 🌱 Add hack to upgrade cert-manager in Tiltfile Aug 18, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7eb6c4e into kubernetes-sigs:master Aug 18, 2020
@fabriziopandini fabriziopandini deleted the upgrade-cert-manager-in-tiltfile branch August 19, 2020 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants