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

gardenctl should pass --config to gardenlogin so both use the same config file #332

Open
hendrikKahl opened this issue Aug 23, 2023 · 3 comments
Labels
component/gardenctl Gardener CLI kind/enhancement Enhancement, improvement, extension lifecycle/stale Nobody worked on this for 6 months (will further age)

Comments

@hendrikKahl
Copy link

What would you like to be added:

When I specify --config <path to some specific config file> to gardenctl target and request a kubeconfig for a shoot, the generated file has a users section like this:

users:
- name: my-cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1
      args:
      - get-client-certificate
      command: kubectl-gardenlogin
      env: null
      installHint: Follow the instructions on https://github.com/gardener/gardenlogin#installation
        to install gardenlogin
      interactiveMode: IfAvailable
      provideClusterInfo: true

It would be helpful, if --config <path to some specific config file> could be added as an argument to kubectl-gardenlogin as well.

Why is this needed:

As of now, the behavior is inconsistent and leads to unwanted behavior where gardenctl and gardenlogin use different configuration files.

@hendrikKahl hendrikKahl added component/gardenctl Gardener CLI kind/enhancement Enhancement, improvement, extension labels Aug 23, 2023
@petersutter
Copy link
Member

Interesting, what is your use case for providing a different config file using the path flag?

@hendrikKahl
Copy link
Author

Sometimes, I want to test with a specific setup. To spare me the effort of moving too many files around, I tried to use the --config flag conveniently offered by the cli :)

This happens mostly in the context of debugging / reproducing things with a specific garden kubeconfig. Since Gardener dropped support for static tokens with K8s v1.27, I believe these cases will increase.

@hendrikKahl
Copy link
Author

Maybe I failed to describe the issue resulting from this behavior 🤔 so let me try to rephrase.

When I use the --config flag on gardenctl, it uses this combination of configuration / credentials. Now, when I target a shoot, gardenlogin, invoked via the generated kubeconfig, still uses its default.

This results in adminkubeconfig requests being sent to a totally different cluster or requested with different credentials.

@gardener-robot gardener-robot added the lifecycle/stale Nobody worked on this for 6 months (will further age) label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/gardenctl Gardener CLI kind/enhancement Enhancement, improvement, extension lifecycle/stale Nobody worked on this for 6 months (will further age)
Projects
None yet
Development

No branches or pull requests

3 participants