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

⚠️ Run webhooks with managers #3985

Conversation

fabriziopandini
Copy link
Member

@fabriziopandini fabriziopandini commented Dec 3, 2020

What this PR does / why we need it:
Given that #3042 for v1alpha4 requires single controllers managing all namespaces, this PR moves the webhooks back in the main manager and run them behind RBAC in case we'll need a client in the future.

Which issue(s) this PR fixes:
Fixes #3822

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 3, 2020
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 3, 2020
@fabriziopandini fabriziopandini marked this pull request as draft December 3, 2020 18:39
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2020
@fabriziopandini
Copy link
Member Author

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone Dec 3, 2020
@fabriziopandini fabriziopandini marked this pull request as ready for review December 3, 2020 18:42
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 3, 2020
@fabriziopandini
Copy link
Member Author

/hold
while doing some more testing

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 3, 2020
Comment on lines +1 to +4
# This configuration is for teaching kustomize how to update name ref and var substitution
varReference:
- kind: Deployment
path: spec/template/spec/volumes/secret/secretName
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually needed? I feel like this was something that we previously used to hack together the separate manager and webhook deployments. I'm not seeing this in the upstream kubuebuilder examples: https://github.com/kubernetes-sigs/kubebuilder/tree/63b35350fe8b4d133c0bdb8fdd9a9a61fe30ac61/testdata/project-v3/config/default

Copy link
Member Author

Choose a reason for hiding this comment

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

This is not in the kubuilder example, but I felt that we are on the safe path if we ensure all the webhook services get a different name for each provider, so during the reshuffle I preserved:

secretName: $(SERVICE_NAME)-cert # this secret will not be prefixed since it's not managed by kustomize

in bootstrap/kubeadm/config/certmanager/certificate.yaml and made the necessary changes for it being resolved in config/default/kustomize.yaml which basically consist of creating this file and referencing it

bootstrap/kubeadm/main.go Outdated Show resolved Hide resolved
bootstrap/kubeadm/main.go Show resolved Hide resolved
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

@fabriziopandini fabriziopandini force-pushed the run-webhooks-with-managers branch from 51427d3 to c2c839a Compare December 3, 2020 21:03
@fabriziopandini
Copy link
Member Author

@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
docs/book/src/developer/providers/v1alpha3-to-v1alpha4.md Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
@fabriziopandini fabriziopandini mentioned this pull request Dec 4, 2020
2 tasks
@vincepri
Copy link
Member

vincepri commented Dec 4, 2020

LGTM pending squash

@fabriziopandini fabriziopandini force-pushed the run-webhooks-with-managers branch from 2b9da96 to df4014d Compare December 4, 2020 19:57
@fabriziopandini
Copy link
Member Author

@vincepri squashed!

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
/assign @CecileRobertMichon @detiber
for approval

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 4, 2020
@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@fabriziopandini fabriziopandini force-pushed the run-webhooks-with-managers branch from a196908 to 3533800 Compare January 18, 2021 18:16
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 18, 2021
@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@fabriziopandini
Copy link
Member Author

rebase & fixed error on machine pools test
@vincepri this PR should be ready to go now

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.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 19, 2021
@wfernandes
Copy link
Contributor

/lgtm

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm overall

sorry for not getting to this earlier @fabriziopandini

docs/book/src/developer/providers/v1alpha3-to-v1alpha4.md Outdated Show resolved Hide resolved
docs/book/src/developer/providers/v1alpha3-to-v1alpha4.md Outdated Show resolved Hide resolved
bootstrap/kubeadm/main.go Show resolved Hide resolved
@fabriziopandini fabriziopandini force-pushed the run-webhooks-with-managers branch from 3533800 to fa9edea Compare February 3, 2021 15:55
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2021
@fabriziopandini
Copy link
Member Author

fabriziopandini commented Feb 3, 2021

Rebased + adressed @CecileRobertMichon comments

@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

/test pull-cluster-api-e2e-full-main

The panic should be resolved in 1.21

@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

/test pull-cluster-api-test-main

@fabriziopandini
Copy link
Member Author

/retest

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 3, 2021
@vincepri
Copy link
Member

vincepri commented Feb 3, 2021

/retest

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-e2e-full-main 280db9a link /test pull-cluster-api-e2e-full-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions 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. I understand the commands that are listed here.

@CecileRobertMichon
Copy link
Contributor

/retest
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 Feb 3, 2021
@k8s-ci-robot k8s-ci-robot merged commit 53d4091 into kubernetes-sigs:master Feb 3, 2021
@fabriziopandini fabriziopandini deleted the run-webhooks-with-managers branch February 10, 2021 13:38
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run webhooks as part of the main manager
6 participants