Repository navigation
Add startup api check Job - #4234
Conversation
|
Hi @inteon. Thanks for your PR. I'm waiting for a jetstack or cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Inteon <[email protected]>
66e9571 to
4114528
Compare
|
/ok-to-test |
wallrj
left a comment
There was a problem hiding this comment.
A few comments and questions. I'll test it and give some more feedback later.
Signed-off-by: Inteon <[email protected]>
wallrj
left a comment
There was a problem hiding this comment.
This seems to work very well @inteon
I tested locally using helm install --atomic --wait-for-jobs followed immediately by kubectl cert-manager check api and it worked every time.
It confused me for a while why APP_VERSION was explicitly supplied as image tag, for all the other components.
And we should try and see if the cmrel tool needs updating to publish the new ctl Docker image.
| "{STABLE_DOCKER_REGISTRY}/cert-manager-acmesolver:{STABLE_DOCKER_TAG}": "//build:acmesolver.image", | ||
| "{STABLE_DOCKER_REGISTRY}/cert-manager-webhook:{STABLE_DOCKER_TAG}": "//build:webhook.image", | ||
| "{STABLE_DOCKER_REGISTRY}/cert-manager-cainjector:{STABLE_DOCKER_TAG}": "//build:cainjector.image", | ||
| "{STABLE_DOCKER_REGISTRY}/cert-manager-ctl:{STABLE_DOCKER_TAG}": "//build:ctl.image", |
There was a problem hiding this comment.
Will we need to update https://github.com/cert-manager/release to publish the new ctl image?
| Manually fix the 'app' and 'name' labels to 'startupapicheck' to maintain | ||
| compatibility with the v0.9 deployment selector. |
There was a problem hiding this comment.
I see that this comment is copied from other components, but what does "compatibility with the v0.9 deployment selector" mean? Any idea?
There was a problem hiding this comment.
comment was introduced in #2285
- Old logic for determining the name: https://github.com/jetstack/cert-manager/pull/2285/files#diff-0155e087680c2cca7df368d18b701ec550eba7b257f163c6cef0951f6df37c3aL2-L7
- New logic: https://github.com/jetstack/cert-manager/pull/2285/files#diff-6947fa6605ade4cf1c0c462b997945e18b10183fc115953087c41d1ca7ea7f8fR103-R105
So it probably just means that the value is now set to a fixed value (different from before #2285, where it was generated).
This was done to not break the deployment selector, because that might cause pods to get orphaned.
So, in conclusion I think we can do a cleanup and just replace app.kubernetes.io/name: {{ include "cainjector.name" . }} with app.kubernetes.io/name: "cainjector" everywhere.
| bazel build //deploy/charts/cert-manager | ||
|
|
||
| # Pre-compile the kubectl plugin, so it can quickly check the api status | ||
| bazel build //hack/bin:kubectl-cert_manager |
There was a problem hiding this comment.
Doesn't this still apply? I suppose it must already have been compiled in order to create the Docker image.
Signed-off-by: Inteon <[email protected]>
Signed-off-by: Inteon <[email protected]>
wallrj
left a comment
There was a problem hiding this comment.
Is there anything else we can we do to be sure that this is actually going to help and not inconvenience people?
Like will it work with flux fluxcd/helm-controller#271
If we enable it by default how might it break existing CI pipelines?
Does it actually allow people to create a Helm chart containing cert-manager resources that depends on the cert-manager chart?
| --set image.tag="${APP_VERSION}" \ | ||
| --set cainjector.image.tag="${APP_VERSION}" \ | ||
| --set webhook.image.tag="${APP_VERSION}" \ | ||
| --set startupapicheck.image.tag="${APP_VERSION}" \ |
There was a problem hiding this comment.
You probably should make these same changes in the hack/verify-upgrade.sh script.
$ make verify_upgrade
...
$ kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
cert-manager cert-manager-5b4b8574f8-gwvkk 1/1 Running 0 42s
cert-manager cert-manager-cainjector-6c5c7f6c47-2czng 1/1 Running 0 42s
cert-manager cert-manager-startupapicheck-kvght 0/1 ErrImagePull 0 42s
cert-manager cert-manager-webhook-76c4f7d5f8-7p5mk 1/1 Running 0 42s
annotations:
helm.sh/hook: post-install
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded |
Signed-off-by: Inteon <[email protected]>
…finished Signed-off-by: Inteon <[email protected]>
40cd039 to
06e2ac2
Compare
wallrj
left a comment
There was a problem hiding this comment.
The post-install hook approach seems to work nicely, but I think we should change the hook deletion policies to include the failure case too, otherwise the hook resources don't get removed if the chart fails.
https://helm.sh/docs/topics/charts_hooks/#hook-deletion-policies
I'm also not sure whether the confgured timeout will be long enough on deployments where the cert-manager images take a long time to download.
It was difficult to test that without having any published images though, so I propose we merge this as-is so that I can do more thorough testing using the v1.5.0-beta.0 release which is due out this afternoon.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inteon, wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
1 similar comment
|
/retest |
|
/retest |
What this PR does / why we need it:
Add
startupapicheckJob that waits for the cert-manager api to become ready.This Job can be awaited for by adding the
--waitflag to thehelm installcommand.Alternatively, the following kubectl command can be used to wait for the cert-manager api to be ready:
kubectl wait -n cert-manager --for=condition=complete job/cert-manager-startupapicheckWhich issue this PR fixes
fixes #4155
Release note:
/kind feature