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

Suppress config warning #2503

Closed
jiningh opened this issue Sep 20, 2020 · 4 comments
Closed

Suppress config warning #2503

jiningh opened this issue Sep 20, 2020 · 4 comments

Comments

@jiningh
Copy link

jiningh commented Sep 20, 2020

Hi,

I'm running an app outside of the cluster, everytime I make a config object the following warning happens:

WARN io.fabric8.kubernetes.client.Config - Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring.

Obviously this wouldn't exist outside the cluster. This is my code making the client:

val config: Config = Config.fromKubeconfig("kubectl file contents"); val client: KubernetesClient = DefaultKubernetesClient(config)

I have to remake the config object everytime there is a k8s call since EKS has expiring tokens and I haven't found a better way to programatically configure it.

Everything works, it's just really annoying. Is there a way to suppress this warning?

@manusa
Copy link
Member

manusa commented Sep 21, 2020

Relates to: #2271

@rohanKanojia
Copy link
Member

@jiningh : Hi, Our library uses SLF4J for logging. It can be configured to send output to a variety of destinations. Were you able to resolve this by tuning SLF4J log levels? If not, maybe we can make this line a log.debug statement rather than log.warn:

LOGGER.warn("Error reading service account token from: [{}]. Ignoring.", KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH);

@jiningh
Copy link
Author

jiningh commented Oct 21, 2020

@jiningh : Hi, Our library uses SLF4J for logging. It can be configured to send output to a variety of destinations. Were you able to resolve this by tuning SLF4J log levels? If not, maybe we can make this line a log.debug statement rather than log.warn:

LOGGER.warn("Error reading service account token from: [{}]. Ignoring.", KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH);

Yes, I filtered log levels to only show errors.

Thanks!

@jiningh jiningh closed this as completed Oct 21, 2020
@rohanKanojia
Copy link
Member

@jiningh : cool, Thanks a lot!

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

No branches or pull requests

3 participants