Skip to content

connect to GCP GKE from local machine #92

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

Merged
merged 3 commits into from
Feb 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


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.

Starting to serve on 127.0.0.1:8001
```

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

```

## Testing

The project uses [XUnit](https://xunit.github.io) as unit testing framework.
Expand Down