mirror of
				https://github.com/kelseyhightower/kubernetes-the-hard-way.git
				synced 2025-11-04 10:12:35 +03:00 
			
		
		
		
	adding windows commands
Signed-off-by: Mike Stevenson <Mike.Stevenson@us.logicalis.com>
This commit is contained in:
		@@ -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:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user