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
+29-46Lines changed: 29 additions & 46 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, control 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,10 @@ 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
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.
42
42
43
-
Once the Kubernetes service is running the new APIs will become accessible and the UI will start show a Kubernetes Service tab.
43
+
**NOTE:**
44
+
From ACS 4.16 onwards, if a CKS cluster is to be deployed on VMware, the 'vmware.create.full.clone' configuration parameter will need to be set to true, so as to allow resizing of root volumes of the cluster nodes.
From ACS 4.16 onwards, Kubernetes versions >= 1.20.x are only supported (https://endoflife.date/kubernetes).
72
+
69
73
Working with Kubernetes supported version
70
74
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
75
@@ -128,29 +132,14 @@ Deleting supported Kubernetes version
128
132
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
133
130
134
.. note::
131
-
addKubernetesSupportedVersion, updatedKubernetesSupportedVersion and deleteKubernetesSupportedVersion APIs are available to admin only
135
+
addKubernetesSupportedVersion, updateKubernetesSupportedVersion and deleteKubernetesSupportedVersion APIs are available to root admins only
132
136
133
137
Kubernetes clusters
134
138
--------------------
135
139
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
-
.. note::
141
-
In case of isolated and VPC networks, if egress rules and ACLs don't allow traffic the setup of the Kubernetes cluster and deployment of pods may fail due to inability of fetching the images from public network.
142
-
143
-
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:
144
-
145
-
- **cloud.kubernetes.cluster.template.name.hyperv** (Name of the template to be used for creating Kubernetes cluster nodes on HyperV)
146
-
- **cloud.kubernetes.cluster.template.name.kvm** (Name of the template to be used for creating Kubernetes cluster nodes on KVM)
147
-
- **cloud.kubernetes.cluster.template.name.vmware** (Name of the template to be used for creating Kubernetes cluster nodes on VMware)
148
-
- **cloud.kubernetes.cluster.template.name.xenserver** (Name of the template to be used for creating Kubernetes cluster nodes on Xenserver)
140
+
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.
149
141
150
-
Using a CoreOS template is required - you can find CoreOS templates for CloudStack here, http://dl.openvm.eu/cloudstack/coreos/x86_64/
151
-
152
-
.. note::
153
-
For VMware, CoreOS template must be registered with root disk controller as **pvscsi** and NIC adapter type as **Vmxnet3**.
142
+
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.
154
143
155
144
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:
156
145
@@ -172,7 +161,7 @@ For Kubernetes cluster management, the service provides create, stop, start, sca
172
161
Creating a new Kubernetes cluster
173
162
##################################
174
163
175
-
New Kubernetes clusters can be create using API or from UI. User will be provided with a Add Kubernetes Cluster form as shown below,
164
+
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,
176
165
177
166
|cks-create-cluster-form.png|
178
167
@@ -227,13 +216,13 @@ For example:
227
216
}
228
217
}
229
218
230
-
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:
219
+
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:
231
220
- Alert – When node virtual machines were successfully provisioned, and cluster API server is accessible but further provisioning steps could not be completed.
232
-
- Error – When the service has unable to provision node virtual machines for the cluster or cluster API server is not accessible.
221
+
- Error – When the service was unable to provision the node virtual machines for the cluster or if the cluster API server is not accessible.
233
222
234
223
.. note::
235
-
- 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.
236
-
- 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.
224
+
- 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.
225
+
- 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.
237
226
238
227
Listing Kubernetes clusters
239
228
############################
@@ -245,18 +234,14 @@ listKubernetesCluster API can be used to list existing Kubernetes clusters. id p
245
234
Stopping Kubernetes cluster
246
235
############################
247
236
248
-
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.
249
-
250
-
stopKubernetesCluster can be used to stop a running cluster. It takes id of the cluster as the input parameter.
237
+
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.
251
238
252
239
Starting a stopped Kubernetes cluster
253
240
######################################
254
241
255
-
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.
242
+
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.
256
243
257
-
startKubernetesCluster can be used to start a stopped cluster. It takes id of the cluster as the input parameter.
258
-
259
-
When the service fails to start a stopped cluster, the cluster will show in Alert state else it will show in Running state.
244
+
When the service fails to start a stopped cluster, the cluster will show in Alert state else it will show up as Running.
260
245
261
246
Scaling Kubernetes cluster
262
247
###########################
@@ -265,15 +250,15 @@ A running or stopped Kubernetes cluster can be scaled using both API and UI. |ck
265
250
266
251
|cks-scale-cluster-form.png|
267
252
268
-
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,
253
+
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:
269
254
270
255
- **id** (the ID of the Kubernetes cluster to be scaled; Required)
271
256
- **serviceofferingid** (the ID of the new service offering for the virtual machines in the cluster)
272
257
- **size** (number of Kubernetes cluster worker nodes)
273
258
274
-
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.
259
+
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.
275
260
276
-
Note: Only upscaling is supported while scaling clusters for service offering.
261
+
Note: Only up scaling is supported while scaling clusters for service offering.
277
262
278
263
Upgrading Kubernetes cluster
279
264
#############################
@@ -282,30 +267,28 @@ A running Kubernetes cluster can be upgraded using both API and UI. |cks-upgrade
282
267
283
268
|cks-upgrade-cluster-form.png|
284
269
285
-
upgradeKubernetesCluster API can be used to upgrade a running cluster. It takes following parameters as input:
270
+
upgradeKubernetesCluster API can be used to upgrade a running cluster. It takes the following parameters as input:
286
271
287
272
- **id** (the ID of the Kubernetes cluster to be upgraded; Required)
288
273
- **kubernetesversionid** (Kubernetes version with which cluster to be launched; Required)
289
274
290
-
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.
275
+
When the service fails to upgrade the cluster, the cluster will show up in Alert state, else if successful, the cluster appears Running state.
291
276
292
277
.. 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.
293
278
294
279
Deleting Kubernetes cluster
295
280
############################
296
281
297
-
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.
298
-
299
-
deleteKubernetesCluster can be used to delete a cluster. It takes id of the cluster as the input parameter.
282
+
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.
300
283
301
-
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.
284
+
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.
302
285
303
286
Working with Kubernetes cluster
304
287
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
305
288
306
289
|cks-cluster-details-tab.png|
307
290
308
-
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/
291
+
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/
309
292
310
293
Accessing Kubernetes cluster
311
294
#############################
@@ -331,15 +314,15 @@ The following command can be used, while passing the correct path to kubeconfig
0 commit comments