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

new post on using client-go library and kubernetes authentication #764

Merged
merged 3 commits into from
Jul 16, 2021
Merged

new post on using client-go library and kubernetes authentication #764

merged 3 commits into from
Jul 16, 2021

Conversation

xphyr
Copy link
Contributor

@xphyr xphyr commented Jul 8, 2021

What this PR does / why we need it:

The following is a new blog post for the kubevirt.io blog. It is based on some work I did for a customer who was asking about how to handle authentication when using the client-go library. Post is designed to show how the client-go library can leverage both KUBECONFIG as well as detect it is running inside k8s and leverage the auth token of the service account it is running as. It also discusses the use of k8s service accounts, and how to create them.

Special notes for your reviewer:

Use of a service account and token is based on my understanding of the best way to handle k8s authentication from an application. Please review and let me know if there is a better or more secure way to handle this sort of request.

Signed-off-by: Mark DeNeve markd@xphyr.net

xphyr added 2 commits July 8, 2021 12:59
Signed-off-by: Mark DeNeve <markd@xphyr.net>
@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jul 8, 2021
@kubevirt-bot kubevirt-bot added kind/blog Label for blog entries needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 8, 2021
@kubevirt-bot
Copy link
Contributor

Hi @xphyr. Thanks for your PR.

I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mazzystr
Copy link
Contributor

mazzystr commented Jul 9, 2021

/ok-to-test

@kubevirt-bot kubevirt-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 9, 2021
@mazzystr
Copy link
Contributor

mazzystr commented Jul 9, 2021

@xphyr Would you like to become a KubeVirt org member? One of the benefits is CI tests will automatically run for your pull reqs

@xphyr
Copy link
Contributor Author

xphyr commented Jul 9, 2021

Yes, that would be great. Thank you. Please let me know what is required from me to join.

@dhiller
Copy link
Contributor

dhiller commented Jul 14, 2021

Yes, that would be great. Thank you. Please let me know what is required from me to join.

@xphyr please have a look at this document: https://github.com/kubevirt/community/blob/master/membership_policy.md#member

Here's an example membership onboarding PR: kubevirt/project-infra#1424

Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great post, thanks for your work!


## Creating Custom RBAC Roles

In this demo we used RBAC roles created as part of the KubeVirt install. You can also create custom RBAC roles for KubeVirt. Documentation on how this can be done is available in the KubeVirt documentation [Creating Customer RBAC Roles](https://kubevirt.io/user-guide/operations/authorization/#creating-custom-rbac-roles)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this demo we used RBAC roles created as part of the KubeVirt install. You can also create custom RBAC roles for KubeVirt. Documentation on how this can be done is available in the KubeVirt documentation [Creating Customer RBAC Roles](https://kubevirt.io/user-guide/operations/authorization/#creating-custom-rbac-roles)
In this demo we used RBAC roles created as part of the KubeVirt install. You can also create custom RBAC roles for KubeVirt. Documentation on how this can be done is available in the KubeVirt documentation [Creating Custom RBAC Roles](https://kubevirt.io/user-guide/operations/authorization/#creating-custom-rbac-roles)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhiller I have fixed the typo, thanks for the catch. I believe this should be all set.

@dhiller
Copy link
Contributor

dhiller commented Jul 14, 2021

Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages.

The list of commits with invalid commit messages:

* [2c8a115](https://github.com/kubevirt/kubevirt.github.io/commits/2c8a115562e4ddda128b53a0453aa2b3399e86b2) fixing typo per @dhiller review

@xphyr can you amend the commit message as requested, please! Thanks!

/approve
/hold

@kubevirt-bot kubevirt-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 14, 2021
Signed-off-by: Mark DeNeve <markd@xphyr.net>
@xphyr
Copy link
Contributor Author

xphyr commented Jul 14, 2021

@dhiller sorry about that. I have amended the commit message, and removed the offending characters. it should be all set now.

Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2021
@mazzystr
Copy link
Contributor

mazzystr commented Jul 15, 2021 via email

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhiller, mazzystr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mazzystr
Copy link
Contributor

mazzystr commented Jul 16, 2021 via email

@mazzystr mazzystr removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2021
@kubevirt-bot kubevirt-bot merged commit cbd302c into kubevirt:master Jul 16, 2021
@xphyr xphyr deleted the xphyr-clientgo branch July 19, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/blog Label for blog entries lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants