getporter / porter

Porter enables you to package your application artifact, client tools, configuration and deployment logic together as an installer that you can distribute, and install with a single command.
https://porter.sh
Apache License 2.0
1.23k stars 206 forks source link

kubeconfig cannot be passed as credentials #2786

Closed NeK000 closed 1 year ago

NeK000 commented 1 year ago

What is your question? I am creating a porter bundle following this concept. I am using the kubernetes mixing I have uploaded the two files below porter.yaml somefile.yaml

Steps used : porter build porter credentials apply somefile.yaml porter install -c thesecretconfig application:v1.1.1

the install exists as follows 1 error occurred:

What have you tried already? Google, Github Issues and documentation.

Was the existing documentation unclear or had gaps? As far as I can see I am following the documentation however does not seem to be working. creds porter yaml

troy0820 commented 1 year ago

"path": "/home//.kube/config.yaml"

I'm assuming you left the user name out of the above path to hide it? Does your kubeconfig have a .yaml at the end? Typically it is ~/.kube/config

NeK000 commented 1 year ago

Hi Yes you are correct I left the user name out. No it does not I see I have made a mistake in the issue.

With regards to the issue I manage to fix it in another way.

after doing porter explain on the bundle I saw the following :

To install this bundle run the following command, passing --param KEY=VALUE for any parameters you want to customize: porter credentials generate mycreds porter install --credential-set mycreds

Based on this I can do the porter credentials generate mycreds and then I am asked for the kubeconfig credentials. After configuring it that way I am able to interact with the cluster successfully.

NeK000 commented 1 year ago

@troy0820 I have uploaded images from the porter.yaml and somefile.yaml containing the credentials. Apologize for the first attempt at uploading code only :)

troy0820 commented 1 year ago

@troy0820 I have uploaded images from the porter.yaml and somefile.yaml containing the credentials. Apologize for the first attempt at uploading code only :)

No apologies necessary, just trying to help. The first file looks like JSON, was that because you had it outputted as json?

Also in your credential set it shows the user /home/theuser/.kube/config

In your credentials it shows /home/nonroot/.kube/config

This may be your problem.

Let me know if that helps.

troy0820 commented 1 year ago

@NeK000 are you still having this issue? Did you try the above?

AGMETEOR commented 1 year ago

@NeK000 I think the issue is that in your crendential set file the path is not actually pointing to where the k8s config file lives on your machine.

troy0820 commented 1 year ago

@schristoff I think we may be able to close this.

schristoff commented 1 year ago

Thanks! @NeK000 - if you run into this issue again please feel encouraged to open another issue and we'll help ya