Browse code

Edited kubernetes.md.

Change-Id: I2975f2be9964e3649d28cf06637d0bf99a9239d7
Reviewed-on: http://photon-jenkins.eng.vmware.com/1145
Reviewed-by: Steve Hoenisch <shoenisch@vmware.com>
Tested-by: Steve Hoenisch <shoenisch@vmware.com>

shoenisch authored on 2016/07/01 06:14:21
Showing 1 changed files
... ...
@@ -16,9 +16,9 @@ This document gets you started using Kubernetes with Photon OS. The instructions
16 16
 
17 17
 The Kubernetes package provides several services: kube-apiserver, kube-scheduler, kube-controller-manager, kubelet, kube-proxy.  These services are managed by systemd. Their configuration resides in a central location: /etc/kubernetes.  
18 18
 
19
-The following instructions break the services up between the hosts.  The first host, photon-master, will be the Kubernetes master.  This host will run the kube-apiserver, kube-controller-manager, and kube-scheduler.  In addition, the master will also run _etcd_ (not needed if _etcd_ runs on a different host but this guide assumes that _etcd_ and Kubernetes master run on the same host).  The remaining host, photon-node will be the node and run kubelet, proxy and docker.
19
+The following instructions break the services up between the hosts.  The first host, `photon-master`, will be the Kubernetes master.  This host will run the kube-apiserver, kube-controller-manager, and kube-scheduler.  In addition, the master will also run `etcd`. Although `etcd` is not needed on the master if `etcd` runs on a different host, this guide assumes that `etcd` and the Kubernetes master run on the same host.  The remaining host, `photon-node`, will be the node; it will run kubelet, proxy and docker.
20 20
 
21
-**System Information:**
21
+**System Information**
22 22
 
23 23
 Hosts:
24 24
 
... ...
@@ -27,13 +27,15 @@ photon-master = 192.168.121.9
27 27
 photon-node = 192.168.121.65
28 28
 ```
29 29
 
30
-**Prepare the hosts:**
30
+**Prepare the hosts**
31
+
32
+The following packages should already be installed on the full version of Photon OS, but you might have to install them on the minimal version of Photon OS. If the `tdnf` command returns "Nothing to do," the package is already installed.
31 33
     
32
-* Install Kubernetes on all hosts - photon-{master,node}.
34
+* Install Kubernetes on all hosts--both `photon-master` and `photon-node`.
33 35
 
34 36
 ```sh
35 37
 tdnf install kubernetes
36
-```
38
+``` 
37 39
 
38 40
 * Install etcd and iptables on photon-master
39 41
 
... ...
@@ -47,14 +49,14 @@ tdnf install etcd iptables
47 47
 tdnf install docker
48 48
 ```
49 49
 
50
-* Add master and node to /etc/hosts on all machines (not needed if hostnames already in DNS). Make sure that communication works between photon-master and photon-node by using a utility such as ping.
50
+* Add master and node to /etc/hosts on all machines (not needed if the hostnames are already in DNS). Make sure that communication works between photon-master and photon-node by using a utility such as ping.
51 51
 
52 52
 ```sh
53 53
 echo "192.168.121.9	photon-master
54 54
 192.168.121.65	photon-node" >> /etc/hosts
55 55
 ```
56 56
 
57
-* Edit /etc/kubernetes/config which will be the same on all hosts (master and node) to contain:
57
+* Edit /etc/kubernetes/config, which will be the same on all the hosts (master and node), so that it contains the following lines:
58 58
 
59 59
 ```sh
60 60
 # Comma separated list of nodes in the etcd cluster
... ...
@@ -70,7 +72,7 @@ KUBE_LOG_LEVEL="--v=0"
70 70
 KUBE_ALLOW_PRIV="--allow_privileged=false"
71 71
 ```
72 72
 
73
-**Configure the Kubernetes services on the master.**
73
+**Configure the Kubernetes services on the master**
74 74
 
75 75
 * Edit /etc/kubernetes/apiserver to appear as such.  The service_cluster_ip_range IP addresses must be an unused block of addresses, not used anywhere else.  They do not need to be routed or assigned to anything.
76 76
 
... ...
@@ -98,9 +100,7 @@ for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do
98 98
 done
99 99
 ```
100 100
 
101
-* Addition of nodes:
102
-
103
-* Create following node.json file on Kubernetes master node:
101
+* To add the other node, create the following node.json file on the Kubernetes master node:
104 102
 
105 103
 ```json
106 104
 {
... ...
@@ -116,7 +116,7 @@ done
116 116
 }
117 117
 ```
118 118
 
119
-Now create a node object internally in your Kubernetes cluster by running:
119
+Now create a node object internally in your Kubernetes cluster by running the following command:
120 120
 
121 121
 ```console
122 122
 $ kubectl create -f ./node.json
... ...
@@ -126,17 +126,17 @@ NAME                LABELS              STATUS
126 126
 photon-node         name=photon-node-label     Unknown
127 127
 ```
128 128
 
129
-Please note that in the above, it only creates a representation for the node
129
+Please note that in the above example, it only creates a representation for the node
130 130
 _photon-node_ internally. It does not provision the actual _photon-node_. Also, it
131 131
 is assumed that _photon-node_ (as specified in `name`) can be resolved and is
132
-reachable from Kubernetes master node. This guide will discuss how to provision
133
-a Kubernetes node (photon-node) below.
132
+reachable from the Kubernetes master node. How to provision
133
+a Kubernetes node (photon-node) is shown in a later section.
134 134
 
135
-**Configure the Kubernetes services on the node.**
135
+**Configure the Kubernetes services on the node**
136 136
 
137 137
 ***We need to configure the kubelet on the node.***
138 138
 
139
-* Edit /etc/kubernetes/kubelet to appear as such:
139
+* Edit /etc/kubernetes/kubelet to appear like this:
140 140
 
141 141
 ```sh
142 142
 ###
... ...
@@ -155,7 +155,7 @@ KUBELET_API_SERVER="--api_servers=http://photon-master:8080"
155 155
 #KUBELET_ARGS=""
156 156
 ```
157 157
 
158
-* Start the appropriate services on the node (photon-node).
158
+* Start the appropriate services on the node (photon-node):
159 159
 
160 160
 ```sh
161 161
 for SERVICES in kube-proxy kubelet docker; do 
... ...
@@ -165,7 +165,7 @@ for SERVICES in kube-proxy kubelet docker; do
165 165
 done
166 166
 ```
167 167
 
168
-* Check to make sure now the cluster can see the photon-node on photon-master, and its status changes to _Ready_.
168
+* Check to make sure that the cluster can now see the photon-node on photon-master and that its status changes to _Ready_.
169 169
 
170 170
 ```console
171 171
 kubectl get nodes
... ...
@@ -173,9 +173,7 @@ NAME                LABELS              STATUS
173 173
 photon-node          name=photon-node-label     Ready
174 174
 ```
175 175
 
176
-* Deletion of nodes:
177
-
178
-To delete _photon-node_ from your Kubernetes cluster, one should run the following on photon-master (Please do not do it, it is just for information):
176
+* Deletion of nodes: To delete _photon-node_ from your Kubernetes cluster, one should run the following on photon-master (please do not do it, it is just for information):
179 177
 
180 178
 ```sh
181 179
 kubectl delete -f ./node.json
... ...
@@ -185,6 +183,6 @@ kubectl delete -f ./node.json
185 185
 
186 186
 **The cluster should be running. Launch a test pod.**
187 187
 
188
-You should have a functional cluster. Check out [101](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/user-guide/walkthrough/README.md).
188
+You should have a functional cluster. Check out [Kubernetes 101](http://kubernetes.io/docs/user-guide/walkthrough/) for an introduction to working with Kubernetes. 
189 189
 
190 190