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

The get-kubeconfig action could be better #93

Open
evilnick opened this issue May 2, 2024 · 1 comment
Open

The get-kubeconfig action could be better #93

evilnick opened this issue May 2, 2024 · 1 comment

Comments

@evilnick
Copy link

evilnick commented May 2, 2024

Enhancement Proposal

running juju run k8s/0 get-kubeconfig currently outputs text like this:

kubeconfig: |
  apiVersion: v1
  clusters:
  - cluster:
      certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURIRENDQWdTZ0F3SUJBZ0lSQU5mT3JGcXVFZGVyMXkwaUoxNGw5UTh3RFFZSktvWklodmNOQVFFTEJRQXcKR0RFV01CUUdBMVVFQXhNTmEzVmlaWEp1WlhSbGN5MWpZVEFlRncweU5EQTFNREl4TWpVNE1qUmFGdzAwTkRBMQpNREl4TWpVNE1qUmFNQmd4RmpBVUJnTlZCQU1URFd0MVltVnlibVYwWlhNdFkyRXdnZ0VpTUEwR0NTcUdTSWIzCkRRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRQ2wwR3o2YXpvRG0yZVloSzhSZ2xUSDVsaDFIeG9NMUpEa3JGVC8KbThyYnIzRFhTOGhzSkM2OEtlQXBpTzNIWkhEbVBlTmx5MnVDd3BNc1lGY3pCYkhNWDJXWlNNLzE0d3FYM0xsYwp3YTV4UWp5OXMzTEFPeDVnazl4WG8vcW0vNFR5bWFWOEVUSU9RUERONmVRMFZuaXhvZksvak9nM1VQNUFhUmlKCjFHRGZPdXlmUXlXT3VGTUhpUFkrME1EN0FsZ0NqdXJ3ZUxQMGo0M1Q2SWpvTGlidXFWbkRsM2JxOXEvN3NOUTYKajVZd0I0SEpBWk90UUZvbFhqVHhtU2FFUHgvNERkRWxjTGxDMXhMM3BHY1JPc0xUWFVXQllsQ1BtZnF0dERFbQo5dmlDcmlXZmNBdythNHY1enJKbXdHd0VXdUlQUmNvaUYyU2lIZ2MweGxzTU1GcC9BZ01CQUFHallUQmZNQTRHCkExVWREd0VCL3dRRUF3SUNoREFkQmdOVkhTVUVGakFVQmdnckJnRUZCUWNEQWdZSUt3WUJCUVVIQXdFd0R3WUQKVlIwVEFRSC9CQVV3QXdFQi96QWRCZ05WSFE0RUZnUVVNeGsxOG14eXVzaGx2Z2FnY042NDhKa2VqTnd3RFFZSgpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFCQ0M0Z3QrWDBjcmMwLzM2cUc2OVJ6UXJxdkM1cXVnV0lOdVZVeC9nS1NiCmc5a2MxV1pXNWpGSmNBTzdlTzc3U2x6MzVBRS9pRnZ4aDZkME5MVm92NWNSWkd0ODI0K24zTjdoMzg1VnA2M1cKOGVweHFzWnhvQ21RYUxJRE1GWFVEZkR4QWZRYnhsOWwrSFk0cCtaZW4zb3RhZkFaaVZVYjFoWWxmdjFnSnQ0OQphK2tXVnBVbGJ5Mi9RSFNRdTdpeFNNM1JDazh3bkUzemlXZmF3ellqNkprZE5LQ0JXUHhoeWt0OENlS1RFK3VOCnJLY09qNlhoMDZ5VGU2NVFaYUkzVGo1dVk0UStDUjFnazRWbk9qY2hmY01sN2VzV0ptT3hDSmNsNG1MRXN3TSsKT1JFUFlJajJrN2FyVTkrY2lQSmREdXNXdWlIQU5iL1dkbDRiOE1OcTZLND0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
      server: https://10.158.52.126:6443
    name: k8s
  contexts:
  - context:
      cluster: k8s
      user: k8s-user
    name: k8s
  current-context: k8s
  kind: Config
  preferences: {}
  users:
  - name: k8s-user
    user:
      token: token::bfbf74d2d40e9591b53c93118c9f328aede597c3

/sys/firmware/dmi/tables/smbios_entry_point: Permission denied
/dev/mem: No such file or directory
  1. the two lines at the end seem like they are superfluous
  2. Although useful, the dumped yaml requires editing to incorporate into a kube config file

It would be much cleaner and more useful to output only and exacltly what was needed

@evilnick
Copy link
Author

evilnick commented May 2, 2024

NB the extraneous lines were caused by an error on the unit, but we should probably still filter this out?
If the output missed the kubeconfig part and dumped YAMl from one step lower we could just pipe this to a file...

@addyess addyess changed the title The get-cubeconfig action could be better The get-kubeconfig action could be better May 14, 2024
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

1 participant