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

Improve CRD display in kubectl #39985

Merged
merged 3 commits into from Mar 28, 2024
Merged

Improve CRD display in kubectl #39985

merged 3 commits into from Mar 28, 2024

Conversation

hugoShaka
Copy link
Contributor

@hugoShaka hugoShaka commented Mar 28, 2024

This PR adds to crdegen the ability to set additional columns in the CRDs.

Changelog: The role, server and token Teleport operator CRs now display additional information when listed with kubectl get.

This allows to generate more user-friendly outputs.

Before

$ kubectl get teleportprovisiontokens
NAME      AGE
mytoken   67s

$ kubectl get teleportusers
NAME     AGE
myuser   89m

$ kubectl get teleportopensshserverv2
NAME                                   AGE
7c887939-dadf-46c5-9613-14716ab3bfe5   23s

After

$ kubectl get teleportprovisiontokens
NAME      JOIN METHOD   SYSTEM ROLES          AGE
mytoken   iam           ["Node","App","Db"]   67s

$ kubectl get teleportusers
NAME     ROLES                 AGE
myuser   ["myrole","access"]   89m

$ kubectl get teleportopensshserverv2
NAME                                   HOSTNAME                      ADDRESS          AGE
7c887939-dadf-46c5-9613-14716ab3bfe5   hugo-test-openssh-agentless   34.95.39.17:22   23s

This PR was motivated by the poor kubectl output when I wrote the IaC guide for OpenSSH servers. It only displayed a UUID and not the server hostname nor address.

Tip

The first commit contains the code change that must be reviewed (a few lines).

The second commit contains the re-generated CRDs (large diff, not interesting)

Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

1 similar comment
Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@hugoShaka hugoShaka changed the title Improve CRD diplay in kubectl Improve CRD display in kubectl Mar 28, 2024
@hugoShaka hugoShaka added this pull request to the merge queue Mar 28, 2024
Merged via the queue into master with commit 81c512f Mar 28, 2024
39 checks passed
@hugoShaka hugoShaka deleted the hugo/improve-crd-display branch March 28, 2024 21:51
@public-teleport-github-review-bot

@hugoShaka See the table below for backport results.

Branch Result
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants