Closed spprichard closed 3 years ago
Some follow up on this...
I think I have narrowed down my issue to this line https://github.com/swiftkube/client/blob/main/Sources/SwiftkubeClient/Config/KubernetesClientConfig.swift#L74
As far as I can tell, when creating a K8sClient, it tries to use the LocalFileConfigLoader
first, which appears to try to load the local /.kube/config
When looking at my local kube config, I see this for the active context's config.
- name: kind-kind
user:
client-certificate-data: <REDACTED>
client-key-data: <REDACTED>
It appears to me that the LocalFileConfigLoader
defaults to use basicAuth
when the kube config does not have that information for the current context.
Not sure if this helps, but wanted to append this to the info above
@spprichard Hey there, thanks for the issue 👍
The function AuthInfo.authentication()
tries all the possible authentication types (basic, token, cert) starting with basic-auth.
The bug is in one of the CodingKeys
in the AuthInfo
struct.
I'll push a fix in a couple of minutes. You can use the main
branch for now instead of version 0.1.0
I am trying to use this package with a local Kind cluster
Initially I tried this
I expected to see each deployment printed out. However, there was no output to the console.
I then tried passing in a Logger..
With this I get some output
I then set those environment variables and get this output
I guess this is a long winded way of saying, how can I get the
KubernetesClient
to use my local.kube/config
? What am I doing wrong? Has anyone tried using Kind with this project? I think the only way for this to work is to have it run in a pod?