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

Deploy shoot-cert-service on garden runtime cluster #314

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MartinWeindel
Copy link
Member

How to categorize this PR?

/area control-plane
/kind enhancement

What this PR does / why we need it:
With the introduction of operation extensions, it is possible to deploy an extension on the Garden runtime cluster.
Adjustments both to the deployment of the shoot-cert-service itself and the deployment of the cert-management are needed to deal with the different environment on the Garden runtime cluster. In contrast to the deployment in the shoot namespace on the seed, deploy host and target are the same here. Moreover, some features like shootIssuers, dnsChallengeOnShoot, alerting are not relevant in this context. Prometheus scraping and Plutono dashboards are also not supported.

Addtionally, the default issuer can now be a CA issuer instead a ACME issuer to support test and private cloud scenarios.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Part of gardener/gardener#9635

Release note:

Support for deploying the shoot-cert-service extension on the Garden runtime cluster.
Support for using a `CA` issuer as default issuer.

@gardener-robot gardener-robot added kind/api-change API change with impact on API users needs/second-opinion Needs second review by someone else area/control-plane Control plane related kind/enhancement Enhancement, improvement, extension needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) labels Nov 14, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 14, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 26, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Nov 26, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 26, 2024
@timuthy
Copy link
Member

timuthy commented Dec 9, 2024

/assign

@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Dec 10, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 11, 2024
@MartinWeindel MartinWeindel changed the title [WIP] Deploy shoot-cert-service on garden runtime cluster Deploy shoot-cert-service on garden runtime cluster Dec 11, 2024
@MartinWeindel MartinWeindel marked this pull request as ready for review December 11, 2024 10:23
@MartinWeindel MartinWeindel requested review from a team as code owners December 11, 2024 10:23
@marc1404
Copy link
Member

/assign

Copy link
Member

@marc1404 marc1404 left a comment

Choose a reason for hiding this comment

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

I'm not qualified for an in-depth review but took a look at the things that I could understand based on the context anyway. Just a few suggestions and clarification questions.

Comment on lines +87 to +89
if !strings.HasPrefix(s, "-----BEGIN CERTIFICATE-----") || !strings.HasSuffix(s, "-----END CERTIFICATE-----") {
allErrs = append(allErrs, field.Invalid(fldPath.Child("certificate"), shorten(s), "invalid certificate, expected PEM format)"))
}
Copy link
Member

Choose a reason for hiding this comment

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

The same code is repeated below, and it could be extracted into a 🤏 helper function such as validateCertificates.
Just as a thought: It'd be more thorough trying to decode the PEM content to validate or do you think that's too much for a quick validation?

Comment on lines +153 to +178
Entry("Valid specification of CA", config.Configuration{
IssuerName: "gardener",
CA: validCA,
}, BeEmpty()),
Entry("Invalid specification of both ACME and CA", config.Configuration{
IssuerName: "gardener",
ACME: validACME,
CA: validCA,
}, ConsistOf(
PointTo(MatchFields(IgnoreExtras, Fields{
"Type": Equal(field.ErrorTypeInvalid),
"Field": Equal("acme"),
"Detail": Equal("only one of ACME or CA can be specified"),
})),
)),
Entry("Invalid specification of none of ACME and CA", config.Configuration{
IssuerName: "gardener",
ACME: nil,
CA: nil,
}, ConsistOf(
PointTo(MatchFields(IgnoreExtras, Fields{
"Type": Equal(field.ErrorTypeRequired),
"Field": Equal("acme"),
"Detail": Equal("at least one of ACME or CA must be specified"),
})),
)),
Copy link
Member

Choose a reason for hiding this comment

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

Unless I missed something the unhappy paths of validateCA could be covered as well.

Comment on lines +59 to +61
extensionscontroller.GetCluster = func(context.Context, client.Reader, string) (*extensions.Cluster, error) {
return nil, nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Just for me to understand the changes better: Why should extensionscontroller.GetCluster always return nil when running on the Garden Runtime cluster?

Comment on lines +8 to +10
# TODO: This label approach is deprecated and no longer needed in the future. Remove them as soon as gardener/[email protected] has been released.
networking.resources.gardener.cloud/from-policy-pod-label-selector: all-scrape-targets
networking.resources.gardener.cloud/from-policy-allowed-ports: '[{"port":{{ .Values.configuration.serverPortHttp }},"protocol":"TCP"}]'
Copy link
Member

Choose a reason for hiding this comment

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

🧹 Can we act on this TODO since gardener/gardener has just hit v1.110? :)

replicaCount: 1

images:
cert-management: any-repo:any-tag
Copy link
Member

Choose a reason for hiding this comment

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

Again, just for me to understand: I assume the image value is overridden somewhere else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Control plane related kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants