Open jakublabno opened 9 months ago
Hi @jakublabno,
Thanks for your feedback.
Could you please elaborate on your request.
If you're suggesting to allow for the path to be provided as a String
instead of a Path
or File
, then you'd really need to make a good case for that. Personally, I see it as polluting the API and I can't really see or understand a good motive for that (but maybe I'm missing something).
Semantically, for me, withKubeConfig(String)
means that you provide the .kube/config
content as a String
.
If this is what you're suggesting, I don't see any reason why we shouldn't provide that. However, it'd be nice to better understand your use case and how you're actually computing or obtaining that .kube/config
content.
If you don't want to enhance your API, which is strange since it's common practice, even in official kubernetes java client. you have multiple options to provide config. It's better to provide withKubeConfig(String), it's always easier to convert kubeconfig to string, rather than saving it to the file and provide as File. Personally, I don't want to store kubeconfig in my project, I store it as base64 in secret and what I have to do now is to crate temporary file which I can later use in withKubeConfig(String)
Also, I'm not telling you to replace Path with String, maybe there would be a good choice to add an abstraction with some king of Kubeconfig object.
Probably I didn't explain myself correctly.
I'm happy to add withKubeConfig(String)
if this method delivers the functionality to provide the .kube/config
content as a String
. After your minor elaboration, this is what I now understand you're requesting (as opposed to withKubeConfig("/home/user/.kube/config")
which is what I won't add unless someone really makes a case for this).
However, you still haven't elaborated on your use case. It's my understanding that you would be running this in a build automation tool and passing the content of .kube/config
by retrieving it from a secret. If this is the case, note that helm-java
is actually leveraging helm libs under the covers, and it's likely that you can pass a lot of information using variables such as: HELM_KUBEAPISERVER
, HELM_KUBECAFILE
, HELM_KUBETOKEN
, and so on).
official kubernetes java client.
I wouldn't use the Official Kubernetes Java Client as an example of API-friendly when you get horrible things such as:
V1PodList list = api.listPodForAllNamespaces(null, null, null, null, null, null, null, null, null);
Especially when you can use the Fabric8 Kubernetes Client that provides completely fluent interfaces :wink:
PodList podList = client.pods().inAnyNamespace().list();
Probably I didn't explain myself correctly.
I'm happy to add
withKubeConfig(String)
if this method delivers the functionality to provide the.kube/config
content as aString
.
May I ask when this idea will be implemented
Hi, as above, it would be nice to use some abstraction for Kubeconfig, not depending only on filesystem Path
Helm.withKubeConfig(String)