-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: improve in-cluster-config example #610
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
feat: improve in-cluster-config example #610
Conversation
examples/in_cluster_config.py
Outdated
@@ -14,18 +14,65 @@ | |||
|
|||
# Simple example to show loading config from the cluster | |||
|
|||
# | |||
# If you get 403 errors from API server you will have to configure | |||
# RBAC to add necessary permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"necessary permissions"
maybe more specific about the permission added is "the permission to list pods"
examples/in_cluster_config.py
Outdated
print("%s\t%s\t%s" % | ||
(i.status.pod_ip, i.metadata.namespace, i.metadata.name)) | ||
|
||
while True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure about putting it in a loop, i guess most people would just run it once, see if the pods are listed correctly.
one way to run it in cluster is to start a pod that runs say ubuntu, exec into the pod, install this client library, then try out this example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run tests in different way. I prepared a docker image with the installed library and this example as a command. If the pod works forever I can check logs easily, tune RBAC etc.
Your scenario is simpler, I'll remove the loop and I'll add comments about suggested scenario.
Thanks for reviewing it.
thanks for the pr. could you please sqash the commits? it looks good otherwise. |
5a5424e
to
f9d5c93
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tomplus, yliaog 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 |
I've updated an example - in_cluster_config.py.
Changes:
Thanks.