Skip to content

Decouple yaml file and KubernetesClientConfiguration object #30

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
Oct 23, 2017

Conversation

tg123
Copy link
Member

@tg123 tg123 commented Oct 11, 2017

KubernetesClientConfiguration now can be created without yaml config
first step to address #24

Introduce go client style config creating functions

  • Anonymous
var client = new Kubernetes(new KubernetesClientConfiguration
{
       Host = "http://127.0.0.1:8001"
});
  • InClusterConfig
var k8sClientConfig = KubernetesClientConfiguration.InClusterConfig();
var client = new Kubernetes(k8sClientConfig);
  • BuildConfigFromFlags like
//  BuildConfigFromConfigFile(string masterUrl = null, string kubeconfigPath = null)
var k8sClientConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(k8sClientConfig);

@tg123 tg123 force-pushed the master branch 2 times, most recently from e6fab82 to cfceb89 Compare October 12, 2017 18:25
@tg123 tg123 changed the title introduce go client style config creating functions decouple yaml file and KubernetesClientConfiguration object , introduce go client style config creating functions Oct 12, 2017
@tg123 tg123 changed the title decouple yaml file and KubernetesClientConfiguration object , introduce go client style config creating functions decouple yaml file and KubernetesClientConfiguration object Oct 12, 2017
@tg123 tg123 changed the title decouple yaml file and KubernetesClientConfiguration object Decouple yaml file and KubernetesClientConfiguration object Oct 12, 2017
@tg123 tg123 mentioned this pull request Oct 16, 2017
@krabhishek8260
Copy link
Contributor

LGTM. Thanks for the PR.

{
handler.ServerCertificateCustomValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
}
else
Copy link
Contributor

Choose a reason for hiding this comment

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

combine the else and if into an else if

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, wait, nevermind, I see there's a statement under the if...

"unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined");
}

var token = File.ReadAllText("/var/run/secrets/kubernetes.io/serviceaccount/" + ServiceAccountTokenKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

extract "/var/run/secrets/kubernetes.io/serviceaccount/" and other strings out as constants?

Copy link
Member Author

Choose a reason for hiding this comment

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

another small question
Is this still not supported by windows after 1709?

@brendandburns
Copy link
Contributor

Needs a rebase, but then LGTM.

@tg123 tg123 mentioned this pull request Oct 21, 2017
@brendandburns brendandburns merged commit 65eb2f8 into kubernetes-client:master Oct 23, 2017
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.

3 participants