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

connect to GCP GKE from local machine #92

Merged
merged 3 commits into from
Feb 13, 2018

Conversation

mac2000
Copy link
Contributor

@mac2000 mac2000 commented Feb 7, 2018

explanation of how to connect from lacal machine to Google Cloud Kubernetes without headache, close #91

explanation of how to connect from lacal machine to Google Cloud Kubernetes without headache, close kubernetes-client#91
@mac2000
Copy link
Contributor Author

mac2000 commented Feb 7, 2018

Hm, I have signed PR, should I do something next with it? or it will mark as ok in a while?

@tg123
Copy link
Member

tg123 commented Feb 7, 2018

you can try push -f to force it rerun on your side. project admin may retrigger it too.

just wait for review

README.md Outdated
@@ -46,6 +46,21 @@ cd csharp\examples\simple
dotnet run
```

## Connecting to GCP GKE from local machine
Copy link
Contributor

Choose a reason for hiding this comment

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

These instructions are generic to any cloud provider, so it likely should be:

Connecting to a cluster from a local machine

or somesuch.

README.md Outdated
Start proxy to access kubernetes cluster:

```bash
$ kubectl proxy
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think connecting through the proxy is the preferred way to sugest that people connect.

README.md Outdated
In code use following config:

```csharp
var config = new KubernetesClientConfiguration { Host = "http://127.0.0.1:8001" };
Copy link
Contributor

@brendandburns brendandburns Feb 8, 2018

Choose a reason for hiding this comment

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

The preferred way to connect is to use the config file on disk as follows:

var k8SClientConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile();
IKubernetes client = new Kubernetes(k8SClientConfig);

https://github.com/kubernetes-client/csharp/blob/master/examples/namespace/Namespace.cs#L52

@brendandburns
Copy link
Contributor

Thanks for the PR. I made some comments. Can you adapt the example to use the preferred way of connecting to a cluster:

var k8SClientConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile();
IKubernetes client = new Kubernetes(k8SClientConfig);

Then I think we can merge it in.

Thanks!

add preferred way of connecting to cluster, add alternative way with proxy for non supported auth providers
@mac2000
Copy link
Contributor Author

mac2000 commented Feb 8, 2018

I do agree with your point about Connecting to a cluster from a local machine reason why I called it like so is just because GKE is only one cloud provider who has stable K8S not in preview, but it gonna change fast so you are right

As about preferred way - yep it definitely should be like you have written, but unfortunately it will not always work - this PR is all about work around so people can still play with K8S api without headache

So I have changed description to "here is how you should do it normally and here is workaround"

Thank you in advance

@brendandburns
Copy link
Contributor

brendandburns commented Feb 8, 2018 via email

@mac2000
Copy link
Contributor Author

mac2000 commented Feb 8, 2018

Yep, it was first thing I did, here it is: #91 (comment)

I totally agree with your point, especially for something running in production, but it is a alternative for a temporary playground, e.g. in my case simple hello world application

@brendandburns
Copy link
Contributor

brendandburns commented Feb 8, 2018 via email

@brendandburns
Copy link
Contributor

LGTM, many thanks for the patience.

@brendandburns brendandburns merged commit 4f80289 into kubernetes-client:master Feb 13, 2018
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

Successfully merging this pull request may close these issues.

BuildConfigFromConfigFile explanation missing
3 participants