mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-14 16:58:58 +03:00
Apply Markdown best practices (block code language specification, spacing between lines, spacing between char, ...
This commit is contained in:
@@ -12,7 +12,7 @@ Each kubeconfig requires a Kubernetes API Server to connect to. To support high
|
||||
|
||||
Retrieve the `kubernetes-the-hard-way` static IP address:
|
||||
|
||||
```
|
||||
```bash
|
||||
KUBERNETES_PUBLIC_ADDRESS=$(gcloud compute addresses describe kubernetes-the-hard-way \
|
||||
--region $(gcloud config get-value compute/region) \
|
||||
--format 'value(address)')
|
||||
@@ -26,7 +26,7 @@ When generating kubeconfig files for Kubelets the client certificate matching th
|
||||
|
||||
Generate a kubeconfig file for each worker node:
|
||||
|
||||
```
|
||||
```bash
|
||||
for instance in worker-0 worker-1 worker-2; do
|
||||
kubectl config set-cluster kubernetes-the-hard-way \
|
||||
--certificate-authority=ca.pem \
|
||||
@@ -51,7 +51,7 @@ done
|
||||
|
||||
Results:
|
||||
|
||||
```
|
||||
```bash
|
||||
worker-0.kubeconfig
|
||||
worker-1.kubeconfig
|
||||
worker-2.kubeconfig
|
||||
@@ -61,7 +61,7 @@ worker-2.kubeconfig
|
||||
|
||||
Generate a kubeconfig file for the `kube-proxy` service:
|
||||
|
||||
```
|
||||
```bash
|
||||
{
|
||||
kubectl config set-cluster kubernetes-the-hard-way \
|
||||
--certificate-authority=ca.pem \
|
||||
@@ -86,7 +86,7 @@ Generate a kubeconfig file for the `kube-proxy` service:
|
||||
|
||||
Results:
|
||||
|
||||
```
|
||||
```bash
|
||||
kube-proxy.kubeconfig
|
||||
```
|
||||
|
||||
@@ -94,7 +94,7 @@ kube-proxy.kubeconfig
|
||||
|
||||
Generate a kubeconfig file for the `kube-controller-manager` service:
|
||||
|
||||
```
|
||||
```bash
|
||||
{
|
||||
kubectl config set-cluster kubernetes-the-hard-way \
|
||||
--certificate-authority=ca.pem \
|
||||
@@ -119,16 +119,15 @@ Generate a kubeconfig file for the `kube-controller-manager` service:
|
||||
|
||||
Results:
|
||||
|
||||
```
|
||||
```bash
|
||||
kube-controller-manager.kubeconfig
|
||||
```
|
||||
|
||||
|
||||
### The kube-scheduler Kubernetes Configuration File
|
||||
|
||||
Generate a kubeconfig file for the `kube-scheduler` service:
|
||||
|
||||
```
|
||||
```bash
|
||||
{
|
||||
kubectl config set-cluster kubernetes-the-hard-way \
|
||||
--certificate-authority=ca.pem \
|
||||
@@ -153,7 +152,7 @@ Generate a kubeconfig file for the `kube-scheduler` service:
|
||||
|
||||
Results:
|
||||
|
||||
```
|
||||
```bash
|
||||
kube-scheduler.kubeconfig
|
||||
```
|
||||
|
||||
@@ -161,7 +160,7 @@ kube-scheduler.kubeconfig
|
||||
|
||||
Generate a kubeconfig file for the `admin` user:
|
||||
|
||||
```
|
||||
```bash
|
||||
{
|
||||
kubectl config set-cluster kubernetes-the-hard-way \
|
||||
--certificate-authority=ca.pem \
|
||||
@@ -186,18 +185,15 @@ Generate a kubeconfig file for the `admin` user:
|
||||
|
||||
Results:
|
||||
|
||||
```
|
||||
```bash
|
||||
admin.kubeconfig
|
||||
```
|
||||
|
||||
|
||||
##
|
||||
|
||||
## Distribute the Kubernetes Configuration Files
|
||||
|
||||
Copy the appropriate `kubelet` and `kube-proxy` kubeconfig files to each worker instance:
|
||||
|
||||
```
|
||||
```bash
|
||||
for instance in worker-0 worker-1 worker-2; do
|
||||
gcloud compute scp ${instance}.kubeconfig kube-proxy.kubeconfig ${instance}:~/
|
||||
done
|
||||
@@ -205,7 +201,7 @@ done
|
||||
|
||||
Copy the appropriate `kube-controller-manager` and `kube-scheduler` kubeconfig files to each controller instance:
|
||||
|
||||
```
|
||||
```bash
|
||||
for instance in controller-0 controller-1 controller-2; do
|
||||
gcloud compute scp admin.kubeconfig kube-controller-manager.kubeconfig kube-scheduler.kubeconfig ${instance}:~/
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user