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

🐛 Fix frontproxy #3023

Merged
merged 1 commit into from
Oct 17, 2023
Merged

🐛 Fix frontproxy #3023

merged 1 commit into from
Oct 17, 2023

Conversation

mjudeikis
Copy link
Contributor

Summary

Fix frontproxy deployment

Related issue(s)

Fixes #

Release Notes

NONE

Signed-off-by: Mangirdas Judeikis <[email protected]>
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 12, 2023
@@ -117,6 +117,7 @@ func (c *Authentication) ApplyTo(authenticationInfo *genericapiserver.Authentica
versionedInformers.Core().V1().Secrets().Lister(),
versionedInformers.Core().V1().ServiceAccounts().Lister(),
)
authenticatorConfig.SecretsWriter = tokenGetterClient.CoreV1().Secrets()
Copy link
Member

Choose a reason for hiding this comment

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

what does a writer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used in LegacyServiceAccount validator. It just fails to start if this is not set and APIServer fails .
I think its for SA management of secrets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"ts":1697038810878.5505,"caller":"dynamiccertificates/dynamic_serving_content.go:113","msg":"Loaded a new cert/key pair","v":2,"name":"serving-cert::/etc/kcp-front-proxy/tls/tls.crt::/etc/kcp-front-proxy/tls/tls.key"}
{"ts":1697038811067.4224,"caller":"dynamiccertificates/dynamic_cafile_content.go:119","msg":"Loaded a new CA Bundle and Verifier","v":2,"name":"client-ca-bundle::/etc/kcp-front-proxy/client-ca/tls.crt"}
{"ts":1697038811067.9343,"caller":"transport/cert_rotation.go:137","msg":"Starting client certificate rotation controller\n","v":3}
{"ts":1697038811068.258,"caller":"cli/run.go:74","msg":"command failed","err":"while creating legacy validator, err: SecretsWriter must be provided"}

API server fails to start with this. We missed this in rebase

Copy link
Member

Choose a reason for hiding this comment

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

k

Copy link
Member

Choose a reason for hiding this comment

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

Though cert rotation also worries me. Why in the frontproxy? Or in general: why is this part of the authentication plugin? Seems odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be how the front proxy was worried together. At this point it's not even starting. But you say authentication plugin should not even be there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is the case, this means we have wrong api-server flavor config in frontproxy case.
Maybe worth merging this for now as it blocks usage of main branch all together with front proxy and looking how to get rid of it as followup?

Copy link
Member

Choose a reason for hiding this comment

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

The auth plugin is expected to be there. We use it in the proxy. I just wonder what else ppl have put into the auth plugins and whether we want to inherit it.

Copy link
Member

Choose a reason for hiding this comment

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

It's used to set kubernetes.io/legacy-token-last-used on the service account secret. It's properly cluster-scoped, and only active when we enable service account lookup (which we do it seems, and that's probably not a good idea from the front-proxy).

@mjudeikis
Copy link
Contributor Author

/retest

@mjudeikis
Copy link
Contributor Author

ping @sttts

@sttts
Copy link
Member

sttts commented Oct 17, 2023

/lgtm
/approve

I think this shows that we have to rethink service account handling in the front-proxy. The front-proxy will never know all serviceaccounts in an informer, and it changing last-used annotations is also questionable. In sharded, potentially multi-region mode this needs more thought.

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2023
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c57d07e5284f4666dff89707d6cf043d8f7750d2

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2023
@kcp-ci-bot kcp-ci-bot merged commit 0070af1 into kcp-dev:main Oct 17, 2023
16 checks passed
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. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants