From b2921f5be923ad1d7d55a7c3500ff29809198465 Mon Sep 17 00:00:00 2001 From: Mike Stevenson Date: Tue, 24 Oct 2017 15:53:00 -0700 Subject: [PATCH] adding windows commands Signed-off-by: Mike Stevenson --- docs/10-configuring-kubectl.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/10-configuring-kubectl.md b/docs/10-configuring-kubectl.md index d7258fa..2597757 100644 --- a/docs/10-configuring-kubectl.md +++ b/docs/10-configuring-kubectl.md @@ -10,14 +10,23 @@ Each kubeconfig requires a Kubernetes API Server to connect to. To support high Retrieve the `kubernetes-the-hard-way` static IP address: +#### Linux & OS X ``` KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \ --region $(gcloud config get-value compute/region) \ --format 'value(address)') ``` +#### Windows +``` +$KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way ` + --region $(gcloud config get-value compute/region) ` + --format 'value(address)') +``` + Generate a kubeconfig file suitable for authenticating as the `admin` user: +#### Linux & OS X ``` kubectl config set-cluster kubernetes-the-hard-way \ --certificate-authority=ca.pem \ @@ -41,6 +50,30 @@ kubectl config set-context kubernetes-the-hard-way \ kubectl config use-context kubernetes-the-hard-way ``` +#### Windows +``` +kubectl config set-cluster kubernetes-the-hard-way ` + --certificate-authority=ca.pem ` + --embed-certs=true ` + --server=https://${KUBERNETES_PUBLIC_ADDRESS}:6443 +``` + +``` +kubectl config set-credentials admin ` + --client-certificate=admin.pem ` + --client-key=admin-key.pem +``` + +``` +kubectl config set-context kubernetes-the-hard-way ` + --cluster=kubernetes-the-hard-way ` + --user=admin +``` + +``` +kubectl config use-context kubernetes-the-hard-way +``` + ## Verification Check the health of the remote Kubernetes cluster: