Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Integrate GK cert as the default internal cert #679

Merged

Conversation

yiqigao217
Copy link
Contributor

@yiqigao217 yiqigao217 commented Apr 28, 2020

Fork the cert management from open-policy-agent/gatekeeper repo to serve
as the default internal cert management for HNC.

Add an "enable-internal-cert-management" flag to switch between using
the internal cert (integrated Gatekeeper cert) or the external cert
"cert-manager".

Update main.go to start the controller manager with internal certs first
and once the cert files are ready, add other controllers and webhooks if
webhook is enabled and internal certs are used.

Refactor the cert generation and validator startup into
pkg/validators/setup.go.

To use external cert-manager, update config/default/kustomization.yaml
and manager_auth_proxy_patch.yaml as instructed. Run 'make deploy-cm'
before 'make deploy'.

Tested on a GKE cluster. The manager restarts 0 times and the webhooks
are working as expected.

Fixes #653

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 28, 2020
@k8s-ci-robot k8s-ci-robot requested review from srampal and tashimi April 28, 2020 21:13
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Apr 28, 2020
@yiqigao217
Copy link
Contributor Author

/assign @adrianludwin

incubator/hnc/Makefile Outdated Show resolved Hide resolved
incubator/hnc/cmd/manager/main.go Outdated Show resolved Hide resolved
@yiqigao217 yiqigao217 force-pushed the self-service-namespace branch 2 times, most recently from ba5c7da to 1b6c5dd Compare April 30, 2020 02:15
@yiqigao217
Copy link
Contributor Author

/assign @rjbez17

Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

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

lgtm after a small documentation change

Fork the cert management from open-policy-agent/gatekeeper repo to serve
as the default internal cert management for HNC.

Add an "enable-internal-cert-management" flag to switch between using
the internal cert (integrated Gatekeeper cert) or the external cert
"cert-manager".

Update main.go to start the controller manager with internal certs first
and once the cert files are ready, add other controllers and webhooks if
webhook is enabled and internal certs are used.

Refactor the cert generation and validator startup into
pkg/validators/setup.go.

To use external cert-manager, update config/default/kustomization.yaml
and manager_auth_proxy_patch.yaml as instructed. Run 'make deploy-cm'
before 'make deploy'.

Tested on a GKE cluster. The manager restarts 0 times and the webhooks
are working as expected. The switch to use cert-manager is tested too.
@yiqigao217 yiqigao217 force-pushed the self-service-namespace branch from 1b6c5dd to c34afd6 Compare April 30, 2020 17:21
@adrianludwin adrianludwin added this to the hnc-v0.4 milestone May 1, 2020
Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
/hold
/assign @rjbez17

Hey Ryan, how does this look to you?

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm Indicates that a PR is ready to be merged. labels May 1, 2020
@yiqigao217 yiqigao217 force-pushed the self-service-namespace branch from 4ee9810 to c34afd6 Compare May 1, 2020 21:39
@rjbez17
Copy link

rjbez17 commented May 4, 2020

/lgtm
/approve
/hold cancel

@k8s-ci-robot k8s-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels May 4, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin, rjbez17, yiqigao217

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:
  • OWNERS [adrianludwin,rjbez17]

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 merged commit 05f7dc4 into kubernetes-retired:master May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HNC: let HNC run without cert-manager
4 participants