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

kube-apiserver: fix TLS handshake errors on Packet #297

Merged
merged 2 commits into from
Apr 21, 2020

Conversation

invidian
Copy link
Member

See commit messages for details.

Refs #278

@invidian
Copy link
Member Author

Note: the documentation for that will be added as part of #295, as currently we don't have a good place to document it.

Copy link
Contributor

@iaguis iaguis left a comment

Choose a reason for hiding this comment

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

some questions

@invidian invidian force-pushed the invidian/fix-apiserver-tls-handshake branch from 5a06b73 to 2415e3b Compare April 16, 2020 12:18
@iaguis
Copy link
Contributor

iaguis commented Apr 17, 2020

CI is broken.

As we always have only one backend, it doesn't make sense to perform
those checks. Backend health checks in HAProxy should be used, when
there is multiple backends and you want to exclude unhealthy ones from
receiving traffic. In our case, we only have one backend AND we don't do
any caching or custom error messages via HAProxy, so we can just always
try to pass the traffic to the kube-apiserver, making HAProxy even more
transparent in the setup.

Perhaps in the future, we should add liveness probes for both
containers, so if any of the process gets stuck, kubelet will restart
it, but this is rather out of scope of this commit.

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
To avoid TLS handshake errors being logged extensively on Packet.

As we set --anonymous-auth=false and we don't want to change it, we need to
set readiness probes to do authentication. The easiest way of doing that
is via --token-auth-file with static user named nobody. The access token
is generated by Helm by calculating SHA256 of secrets template, meaning
the token will be different for each cluster and will be changed on any
certificate change. The nobody user has no RBAC grants, so it has only
access to /healthz endpoint as far as I know (I checked getting pods and
/metrics too and got 401).

For AWS, the TLS handshake errors cannot be resolved, as they are caused
by AWS Load Balancer, which is configured to only TCP checks and in HTTP
mode, it does not support authentication header, so we would have to
remove --anonymous-auth=false kube-apiserver option, which we shouldn't
do.

Refs #278

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
@invidian invidian force-pushed the invidian/fix-apiserver-tls-handshake branch from 2415e3b to c0d3403 Compare April 17, 2020 11:28
@invidian
Copy link
Member Author

CI is broken.

Oops, I think I fixed it now.

Copy link
Contributor

@iaguis iaguis left a comment

Choose a reason for hiding this comment

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

LGTM

@invidian invidian requested a review from surajssd April 17, 2020 12:51
Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

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

👍

@invidian invidian merged commit d010246 into master Apr 21, 2020
@invidian invidian deleted the invidian/fix-apiserver-tls-handshake branch April 21, 2020 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants