CloudStack Kubernetes Service#3680
Conversation
fd860d5 to
42a8d65
Compare
|
@blueorangutan package |
|
@blueorangutan package |
|
@shwstppr does this also have a doc PR to #apache/cloudstack-documentation? |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Fixed, renamed Kubernetes binaries ISO script Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Support for multi-master Kubernetes cluster for Kubernetes version 1.16 and above Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
refactored response class Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
refactorings logging fixes fix for SSH public key on cluster nodes state scanner improvement list versions api improvement Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Made service pugin configurable using global setting Shared network support changes Added plugin UI strings in English trasaltion file Set minimum Kubernetes version to 1.11 State scanner improvements Code structure, logging related refactorings Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@shwstppr can you address the conflicts? |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
Addressed @rhtyd @blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-995 |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-1003 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
👍 Manual testing of: |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-1017 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
DaanHoogland
left a comment
There was a problem hiding this comment.
12600 lines of code. looks good and works, some refactoring can be done still to reduce complexity, but hey, complex functionality.
|
Trillian test result (tid-1203)
|
|
@shwstppr does it support k8 version 1.17 also? |
|
Hi, |
|
Hi , Another question. Is there a way to start Multiple Kubernetes Cluster at once? When one cluster is already in Running state, adding another cluster gives "Unable to retrieve VMs for Kubernetes cluster" warning then an error message: "Provisioning the master VM failed in the Kubernetes cluster ID" |
Description
Specification document https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+Kubernetes+Service
Kubernetes Service plugin adds Kubernetes integration in the CloudStack. Plugin is disabled by default and an admin can enable it using the Global Setting. It enables users to run containerized services using Kubernetes clusters.
Kubernetes Service plugin uses a CoreOS based template for node VMs for the Kubernetes cluster. For installation of Kubernetes binaries on cluster nodes, a binaries ISO can be created for a particular Kubernetes version and can be added as a supported version by an admin. This allows faster, offline installation Kubernetes binaries and docker images along with support for adding multiple versions of Kubernetes for upgrades and running different clusters.
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, https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/. Weave Net CNI provider plugin is used for cluster netoworking. More about Weave Net provide plugin, https://www.weave.works/docs/net/latest/kubernetes/kube-addon/.
To access Kubernetes dashboard securely, the plugin provides access to kubeconfig file data which allows using the Kubernetes tool, kubectl, to run proxy locally and thereby access dashboard. More about kubectl, https://kubernetes.io/docs/reference/kubectl/overview/
The service allows creation of Kubernetes clusters using UI or API. Both UI and API functionalities to list, delete, scale upgrade, stop and start these clusters.
Enabling the Kubernetes Service
Kubernetes Service plugin is disabled by default. To enable it, go to Global Settings and set the following global configuration to true:
cloud.kubernetes.service.enabledRestart the Management Server to enable the set configuration values.
service cloudstack-management restartOnce the Kubernetes service is running new API will become accessible and UI will start show Kubernetes Service tab.
Kubernetes Supported Versions
For faster and offline installation of Kubernetes and docker images on node virtual machines of a Kubernetes cluster, the service provides the functionality to manage supported Kubernetes versions.
Script named create-kubernetes-binaries-iso.sh has been provided in the cloudstack-common package for creating a new setup iso with the desired version of Kubernetes binaries and corresponding docker images.
Usage,
./create-kubernetes-binaries-iso.sh OUTPUT_PATH KUBERNETES_VERSION CNI_VERSION CRICTL_VERSION WEAVENET_NETWORK_YAML_CONFIG DASHBOARD_YAML_CONFIGeg,
./create-binaries-iso.sh ./ 1.12.5 0.7.1 1.12.0 "https://cloud.weave.works/k8s/net?k8s-version=1.12.5" https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta1/aio/deploy/recommended.yamlISOs created using the script can be added as supported Kubernetes version for Kubernetes service.
Working with Kubernetes supported version
New Kubernetes versions can be added using both UI and API. UI provides the following form to add new supported version,
addKubernetesSupportedVersionAPI can be used by an admin to add a new supported version for the service. It takes following input parameters,Note:
The minimum Kubernetes version that can be added in the service is 1.11.
listKubernetesSupportedVersionAPI can be used to list existing supported versions. It takes id parameter as input to list details of a single supported version.updateKubernetesSupportedVersionAPI has been provided for admins to update an existing supported version to mark them as enabled or disabled.deleteKubernetesSupportedVersionAPI 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.Note:
addKubernetesSupportedVersion,updateKubernetesSupportedVersionanddeleteKubernetesSupportedVersionAPI are available to admin onlyKubernetes clusters
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 trouble to set up Kubernetes on each container node manually. 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.
The provides functionality to create Kubernetes clusters for Shared, Isolated and VPC networks in the CloudStack but such networks must be accessible to CloudStack management server for provisioning virtual machines of the cluster. Template and default network offering must be set Global Settings for the service to create Kubernetes clusters.
Following Global Settings value must be set to the name of Template to be used for deploying node virtual machines while creating a Kubernetes cluster,
cloud.kubernetes.cluster.template.name.hypervcloud.kubernetes.cluster.template.name.kvmcloud.kubernetes.cluster.template.name.vmwarecloud.kubernetes.cluster.template.name.xenserverCoreOS templates for CloudStack can be found here, http://dl.openvm.eu/cloudstack/coreos/x86_64/
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,
cloud.kubernetes.cluster.network.offeringA new network offering named DefaultNetworkOfferingforKubernetesService has been added since 4.14.0
Note:
Managing Kubernetes clusters
For Kubernetes cluster management, service provides create, stop, start, scale, upgrade and delete APIs and similar features in the UI. APIs available,
createKubernetesClusterstopKubernetesClustercan be used to stop a running cluster. It takes id of the cluster as the input parameter.startKubernetesClustercan be used to start a stopped cluster. It takes id of the cluster as the input parameter.scaleKubernetesClustercan be used to scale a running or stopped cluster.Note:
Only upscaling is supported while scaling clusters for service offering.
Olny a running Kubernetes cluster can be scaled for size.
upgradeKubernetesClustercan be used to upgrade a running cluster.deleteKubernetesClustercan be used to delete a cluster. It takes id of the cluster as the input parameter.getKubernetesClusterConfigAPI can be used to retrieve kubeconfig file data for a cluster. It takes id of the cluster as the input parameter.Types of changes
Screenshots (if appropriate):
How Has This Been Tested?