You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/plugins/cloudstack-kubernetes-service.rst
+24-44Lines changed: 24 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,13 @@ CloudStack Kubernetes Service
15
15
16
16
The Kubernetes Service plugin adds Kubernetes integration to CloudStack. The plugin is disabled by default and an admin can enable it using a Global Setting. It enables users to run containerized services using Kubernetes clusters.
17
17
18
-
Kubernetes Service plugin uses a CoreOS based template for node VMs for the Kubernetes cluster. CoreOS has been used as it provides docker installation and networking rules needed for Kubernetes by default. In future, different guest OSes might be used. For installation of Kubernetes binaries on cluster nodes, a binaries ISO is used for each Kubernetes version to be made available via CloudStack. This allows faster, offline installation of Kubernetes binaries and docker images along with support for adding multiple versions of Kubernetes for upgrades and running different clusters.
18
+
With CoreOS having reached EOL, from 4.16 the Kubernetes Service Plugin will use the existing SystemVM template for deploying kubernetes clusters. For installation of Kubernetes binaries on the cluster nodes, a binaries ISO is used for each Kubernetes version to be made available via CloudStack. This allows faster, offline installation of Kubernetes binaries and docker images along with support for adding multiple versions of Kubernetes for upgrades and running different clusters.
19
19
20
20
For deployment and setup of Kubernetes on cluster nodes, the plugin uses the Kubernetes tool, 'kubeadm'. kubeadm is the command-line tool for easily provisioning a secure Kubernetes cluster on top of physical or cloud servers or virtual machines. Under the hood, master node(s) of the cluster starts a Kubernetes cluster using kubeadm init command with a custom token, and worker nodes join this Kubernetes cluster using kubeadm join command with the same token. More about kubeadm here: https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/. Weave Net CNI provider plugin is used for cluster networking. More about Weave Net provide plugin here: https://www.weave.works/docs/net/latest/kubernetes/kube-addon/.
21
21
22
22
To access the Kubernetes dashboard securely, the plugin provides access to kubeconfig file data which uses the Kubernetes tool kubectl to run a local proxy and thereby access the dashboard. More about kubectl here: https://kubernetes.io/docs/reference/kubectl/overview/
23
23
24
-
The service allows creation of Kubernetes clusters using the UI or API. Both UI and API provide the ability to list, delete, scale upgrade, stop and start these clusters.
24
+
The service allows creation of Kubernetes clusters using the UI or API. Both UI and API provide the ability to list, delete, scale, upgrade, stop and start these clusters.
25
25
26
26
Enabling the Kubernetes Service
27
27
--------------------------------
@@ -38,9 +38,7 @@ Restart the Management Server to enable the set configuration values.
38
38
39
39
# service cloudstack-management restart
40
40
41
-
# service cloudstack-usage restart
42
-
43
-
Once the Kubernetes service is running the new APIs will become accessible and the UI will start show a Kubernetes Service tab.
41
+
Once the Kubernetes service is running the new APIs will become accessible and the UI will show the Kubernetes tab under the Compute section.
44
42
45
43
Kubernetes Supported Versions
46
44
------------------------------
@@ -128,26 +126,14 @@ Deleting supported Kubernetes version
128
126
deleteKubernetesSupportedVersion API has been provided for admins to delete an existing supported version if it is not used by any Kubernetes cluster in the service. id parameter of the API can be used to pass Kubernetes version to be deleted.
129
127
130
128
.. note::
131
-
addKubernetesSupportedVersion, updatedKubernetesSupportedVersion and deleteKubernetesSupportedVersion APIs are available to admin only
129
+
addKubernetesSupportedVersion, updateKubernetesSupportedVersion and deleteKubernetesSupportedVersion APIs are available to root admins only
132
130
133
131
Kubernetes clusters
134
132
--------------------
135
133
136
-
The Kubernetes service provides the functionality of running and managing Kubernetes clusters. Highly available, scalable Kubernetes clusters can be created to run containerized deployments without having to set up Kubernetes on each container node manually. The service will automatically provision the desired number of virtual machines as per cluster size using the binaries from the given Kubernetes version. Additionally, the service provides the functionality to upgrade and scale clusters. Running clusters can be upgraded to a newer minor or patch Kubernetes version at a time. Running clusters can also be scaled for the number of worker nodes up and down and for the service offering used by each node.
137
-
138
-
This provides functionality to create Kubernetes clusters for Shared, Isolated and VPC networks in CloudStack, but such networks must be accessible to the CloudStack management server for provisioning virtual machines on the cluster. Template and default network offering must be set Global Settings for the service to create Kubernetes clusters.
139
-
140
-
The following Global Settings value must be set to the name of Template to be used for deploying node virtual machines for the respective hypervisor while creating a Kubernetes cluster:
134
+
The Kubernetes service provides the functionality of running and managing Kubernetes clusters. Highly available, scalable Kubernetes clusters can be created to run containerized deployments without having to set up Kubernetes on each container node manually. The service will automatically provision the desired number of virtual machines as per cluster size using the binaries corresponding to the provided Kubernetes version. Additionally, the service provides the functionality to upgrade and scale clusters. Running clusters can be upgraded to a newer minor or patch Kubernetes version at a time. Running clusters can also be scaled up or down based on the number of worker nodes provided and to the service offering used by each node.
141
135
142
-
- **cloud.kubernetes.cluster.template.name.hyperv** (Name of the template to be used for creating Kubernetes cluster nodes on HyperV)
143
-
- **cloud.kubernetes.cluster.template.name.kvm** (Name of the template to be used for creating Kubernetes cluster nodes on KVM)
144
-
- **cloud.kubernetes.cluster.template.name.vmware** (Name of the template to be used for creating Kubernetes cluster nodes on VMware)
145
-
- **cloud.kubernetes.cluster.template.name.xenserver** (Name of the template to be used for creating Kubernetes cluster nodes on Xenserver)
146
-
147
-
Using a CoreOS template is required - you can find CoreOS templates for CloudStack here, http://dl.openvm.eu/cloudstack/coreos/x86_64/
148
-
149
-
.. note::
150
-
For VMware, CoreOS template must be registered with root disk controller as **pvscsi** and NIC adapter type as **Vmxnet3**.
136
+
This provides functionality to create Kubernetes clusters for Shared, Isolated and VPC networks in CloudStack, but such networks must be accessible to the CloudStack management server for provisioning virtual machines on the cluster. The default network offering must be set in the Global Settings for the service to create Kubernetes clusters.
151
137
152
138
The following Global Setting value must be set to the name of Network Offering to be used for creating a new network when no network has been selected while creating a Kubernetes cluster:
153
139
@@ -169,7 +155,7 @@ For Kubernetes cluster management, the service provides create, stop, start, sca
169
155
Creating a new Kubernetes cluster
170
156
##################################
171
157
172
-
New Kubernetes clusters can be create using API or from UI. User will be provided with a Add Kubernetes Cluster form as shown below,
158
+
New Kubernetes clusters can be created using the API or via the UI. User will be provided with an 'Add Kubernetes Cluster' form as shown below,
173
159
174
160
|cks-create-cluster-form.png|
175
161
@@ -224,13 +210,13 @@ For example:
224
210
}
225
211
}
226
212
227
-
On successful creation, the new cluster will be automatically started and will show up in Running state. If creation of the new cluster fails it can be in following states:
213
+
On successful creation, the new cluster will automatically be started and will show up in Running state. If creation of the new cluster fails it can be in following states:
228
214
- Alert – When node virtual machines were successfully provisioned, and cluster API server is accessible but further provisioning steps could not be completed.
229
-
- Error – When the service has unable to provision node virtual machines for the cluster or cluster API server is not accessible.
215
+
- Error – When the service was unable to provision the node virtual machines for the cluster or if the cluster API server is not accessible.
230
216
231
217
.. note::
232
-
- For CoreOS, a minimum of 2 cores of CPU and 2GB of RAM is needed for deployment. Therefore, the serviceofferingid parameter of createKuberntesCluster API must be provided with the ID of such compute offerings that conform to these requirements.
233
-
- Private docker registry related parameters of createKubentesCluster API (dockerregistryusername, dockerregistryusername, dockerregistryurl, dockerregistryemail) provides experimental functionality. To use them during cluster deployment value for global setting, cloud.kubernetes.cluster.experimental.features.enabled, must be set as true by admin beforehand.
218
+
- A minimum of 2 cores of CPU and 2GB of RAM is needed for deployment. Therefore, the serviceofferingid parameter of createKubernetesCluster API must be provided with the ID of such compute offerings that conform to these requirements.
219
+
- Private docker registry related parameters of createKubenetesCluster API (dockerregistryusername, dockerregistryusername, dockerregistryurl, dockerregistryemail) provides experimental functionality. To use them during cluster deployment value for global setting, cloud.kubernetes.cluster.experimental.features.enabled, must be set to true by admin beforehand.
234
220
235
221
Listing Kubernetes clusters
236
222
############################
@@ -242,18 +228,14 @@ listKubernetesCluster API can be used to list existing Kubernetes clusters. id p
242
228
Stopping Kubernetes cluster
243
229
############################
244
230
245
-
A running Kubernetes cluster can be stopped using both the API and |cks-stop-action.png| action icon from UI. action icon is shown for a running cluster in the UI.
246
-
247
-
stopKubernetesCluster can be used to stop a running cluster. It takes id of the cluster as the input parameter.
231
+
A running Kubernetes cluster can be stopped using either the stopKubernetesCluster API which takes id of the cluster as an input parameter or |cks-stop-action.png| action icon from UI. action icon is shown for a running cluster in the UI.
248
232
249
233
Starting a stopped Kubernetes cluster
250
234
######################################
251
235
252
-
A stopped Kubernetes cluster can be started using both API and the |cks-start-action.png| action icon from UI. action icon is shown for a stopped cluster in the UI.
236
+
A stopped Kubernetes cluster can be started using either the startKubernetesCluster API which takes id of the cluster as the input parameter or the |cks-start-action.png| action icon from UI. action icon is shown for a stopped cluster in the UI.
253
237
254
-
startKubernetesCluster can be used to start a stopped cluster. It takes id of the cluster as the input parameter.
255
-
256
-
When the service fails to start a stopped cluster, the cluster will show in Alert state else it will show in Running state.
238
+
When the service fails to start a stopped cluster, the cluster will show in Alert state else it will show up as Running.
257
239
258
240
Scaling Kubernetes cluster
259
241
###########################
@@ -262,15 +244,15 @@ A running or stopped Kubernetes cluster can be scaled using both API and UI. |ck
262
244
263
245
|cks-scale-cluster-form.png|
264
246
265
-
scaleKubernetesCluster API can be used to scale a running (or stopped cluster) for a desired cluster size and service offering. It takes following parameters as input,
247
+
scaleKubernetesCluster API can be used to scale a running (or stopped cluster) to a desired cluster size and service offering. It takes the following parameters as input:
266
248
267
249
- **id** (the ID of the Kubernetes cluster to be scaled; Required)
268
250
- **serviceofferingid** (the ID of the new service offering for the virtual machines in the cluster)
269
251
- **size** (number of Kubernetes cluster worker nodes)
270
252
271
-
Only running Kubernetes clusters can be scaled for size. When the service fails to scale the cluster, the cluster will show in Alert state else if the scaling is successfull cluster will show up in Running state.
253
+
Only running Kubernetes clusters can be scaled in size. When the service fails to scale the cluster, the cluster will show in Alert state else if the scaling is successfull cluster will show up in Running state.
272
254
273
-
Note: Only upscaling is supported while scaling clusters for service offering.
255
+
Note: Only up scaling is supported while scaling clusters for service offering.
274
256
275
257
Upgrading Kubernetes cluster
276
258
#############################
@@ -279,30 +261,28 @@ A running Kubernetes cluster can be upgraded using both API and UI. |cks-upgrade
279
261
280
262
|cks-upgrade-cluster-form.png|
281
263
282
-
upgradeKubernetesCluster API can be used to upgrade a running cluster. It takes following parameters as input:
264
+
upgradeKubernetesCluster API can be used to upgrade a running cluster. It takes the following parameters as input:
283
265
284
266
- **id** (the ID of the Kubernetes cluster to be upgraded; Required)
285
267
- **kubernetesversionid** (Kubernetes version with which cluster to be launched; Required)
286
268
287
-
When the service fails to upgrade the cluster, the cluster will show in Alert state. If the upgrade has been successfulcluster will show in Running state.
269
+
When the service fails to upgrade the cluster, the cluster will show up in Alert state, else if successful, the cluster appears Running state.
288
270
289
271
.. note:: Kubernetes can be upgraded from one MINOR version to the next MINOR version, or between PATCH versions of the same MINOR. That is, you cannot skip MINOR versions when you upgrade. For example, you can upgrade from 1.y to 1.y+1, but not from 1.y to 1.y+2. Therefore, service can upgrade running clusters in the similar manner only.
290
272
291
273
Deleting Kubernetes cluster
292
274
############################
293
275
294
-
Both UI and API can be used to delete a created Kubernetes cluster. |cks-delete-action.png| action icon will be available in UI to delete a cluster.
295
-
296
-
deleteKubernetesCluster can be used to delete a cluster. It takes id of the cluster as the input parameter.
276
+
A kubernetes cluster can be deleted using either the deleteKubernetesCluster API which takes cluster id as the input parameter or the |cks-delete-action.png| action icon from the UI.
297
277
298
-
The Kubernetes service runs a background state scanner process which regularly checks for cluster health. For clusters in Alert state, this background process verifies their state and moves them to Running state if all node virtual machines for the cluster are running and API server for the cluster is accessible.
278
+
The Kubernetes service runs a background state scanner process which regularly checks the cluster health. For clusters in Alert state, this background process verifies their state and moves them to Running state if all node virtual machines of the cluster are running and the API server for the cluster is accessible.
299
279
300
280
Working with Kubernetes cluster
301
281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302
282
303
283
|cks-cluster-details-tab.png|
304
284
305
-
Once a Kubernetes cluster is created successfully and it is running state, it can be accessed using kubectl tool using cluster’s kubeconfig file. The web dashboard can be accessed by running local proxy using kubectl. Deployments in the cluster can be done using kubectl or web dashboard. More about deployment in Kubernetes here: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
285
+
Once a Kubernetes cluster is created successfully and is in Running state, it can be accessed using the kubectl tool using the cluster’s kubeconfig file. The web dashboard can be accessed by running a local proxy using kubectl. Deployments in the cluster can be done using kubectl or web dashboard. More about deployment in Kubernetes here: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
306
286
307
287
Accessing Kubernetes cluster
308
288
#############################
@@ -328,15 +308,15 @@ The following command can be used, while passing the correct path to kubeconfig
0 commit comments