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

Add example for remote cluster without kube client on server #446

Merged
merged 4 commits into from
Oct 31, 2018
Merged

Conversation

charly37
Copy link
Contributor

Propose a new example to demonstrate communication from a server that do not have kube client installed. It show how to create a config object and also setup a barer token to authenticate.

The idea come from a recent issue tracker #430

configuration.api_key = {"authorization": "Bearer " + aToken}

# Use our configuration
client.Configuration.set_default(configuration)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest you an ApiClient and pass it to client.CoreV1Api instead of changing the default.

@mbohlool
Copy link
Contributor

Thanks for the contribution. It looks good except one comment.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 25, 2018
@charly37
Copy link
Contributor Author

Sorry It took me so long to review. I updated and tested (with a cluster on GKE) following the feedback.

@hellt
Copy link

hellt commented Oct 4, 2018

thanks for showing this in your blog, I think basic auth should be included as you explained gere https://djynet.net/?p=918

# See the License for the specific language governing permissions and
# limitations under the License.

# This example demonstrate communication with a remove Kube cluster from a
Copy link

Choose a reason for hiding this comment

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

remove --> remote

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx !

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 27, 2018
@@ -0,0 +1,58 @@
# Copyright 2016 The Kubernetes Authors.
Copy link
Contributor

Choose a reason for hiding this comment

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

May look trivial, but 2016->2018

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix. Thx. Now we just need to hope it is merge before 2019 ;)

@micw523
Copy link
Contributor

micw523 commented Oct 31, 2018

/lgtm

@k8s-ci-robot
Copy link
Contributor

@micw523: changing LGTM is restricted to assignees, and only kubernetes-client/python repo collaborators may be assigned issues.

In response to this:

/lgtm

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.

@roycaihw
Copy link
Member

/lgtm
/approve

Thanks for the PR and reminding ;)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: charly37, roycaihw

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 31, 2018
@k8s-ci-robot k8s-ci-robot merged commit 1efbab9 into kubernetes-client:master Oct 31, 2018
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants