Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Conversation

@timmhirsens
Copy link
Contributor

Auto-mounting the serviceaccount-token is sometimes disabled to avoid giving applications
access to the kubernetes api when they don't need it. The current method of constructing
an instance of KubernetesConfig will try to read the information from the mounted serviceaccount
token even if a Service DNS is specified. This will fail in environments described earlier.

The information gathered from reading the serviceaccount-token fields is only relevant
for API mode. This commit will avoid reading the token if DNS Lookup is configured.

This fixes #284

Auto-mounting the serviceaccount-token is sometimes disabled to avoid giving applications
access to the kubernetes api when they don't need it. The current method of constructing
an instance of `KubernetesConfig` will try to read the information from the mounted serviceaccount
token even if a Service DNS is specified. This will fail in environments described earlier.

The information gathered from reading the serviceaccount-token fields is only relevant
for API mode. This commit will avoid reading the token if DNS Lookup is configured.

This fixes hazelcast#284
@devOpsHazelcast
Copy link
Contributor

devOpsHazelcast commented Feb 4, 2021

CLA assistant check
All committers have signed the CLA.

Copy link

@hasancelik hasancelik left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @fr1zle 👍

Actually, we need more clearer separation between API and DNS mode while creating a config and discovery strategy but it is another PR's topic :)

LGTM ✅

@hasancelik hasancelik merged commit 63f8b42 into hazelcast:master Feb 4, 2021
@timmhirsens timmhirsens deleted the no-serviceaccount-token-in-dns-mode branch February 4, 2021 13:36
@timmhirsens
Copy link
Contributor Author

Thanks, if I find some time I will take a look into a clean separation of the configurations. Now we will not have to configure dummy cacerts and tokens at least ;)

@hasancelik
Copy link

It would be great, ping me if you need any help about internals 👍 yes, it is a good starting point :)

@leszko leszko added this to the 2.2.2 milestone Jun 16, 2021
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.

Hazelcast Kubernetes tries to access serviceaccount-token even if DNS Lookup is chosen method

5 participants