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

CAPD requires --anonymous-auth=true for the loadbalancer checks #11

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

neoaggelos
Copy link
Contributor

Summary

Some CIS hardening defaults in k8s-snap break the loadbalancer health checks for CAPD (probably also relevant for other infrastructure providers that provision L7 load balancers, e.g. AWS)

Update the CAPD cluster template to use --anonymous-auth=true on kube-apiserver

Notes

The health check endpoint that capd adds is https://github.com/kubernetes-sigs/cluster-api/blob/6ac336af578367a279018aba03eaedcac83f0e30/test/infrastructure/docker/internal/loadbalancer/config.go#L67

When paired with anonymous-auth, this results in the following error (from docker logs $cluster-lb container):

[WARNING] 170/171536 (78) : Server kube-apiservers/c1-control-plane-m88dx is DOWN, reason: Layer7 wrong status, code: 401, info: "Unauthorized", check duration: 107ms. 0 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.

Notes part 2

An alternative would be to use a custom haproxy config, but that seems far more complex to maintain (and it is not important for CAPD clusters)

@neoaggelos neoaggelos force-pushed the fix/anonymous-auth branch from 983c3cc to 38ec7b7 Compare June 20, 2024 08:22
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

LGTM

@neoaggelos neoaggelos merged commit 7f16b84 into main Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants