What is a KubeSphere
preface
K8s cluster construction reference: kubernetes cluster construction based on centos7
- To install KubeSphere v3.1.0 on Kubernetes, your Version of Kubernetes must be: 1.17.x, 1.18.x, 1.19.x or 1.20.x;
- Make sure your machine meets the minimum hardware requirements: CPU > 2 cores, memory > 2 GB;
- Before installing, you need to configure the default storage type in the Kubernetes cluster.
An overview of the
KubeSphereIs in theKubernetesBuilt for cloud native applicationsDistributed operating system, fully open source, supports multi-cloud and multi-cluster management, provides full-stack IT automated operation and maintenance capabilities, and simplifies enterprise DevOps workflow. Its architecture makes it easy for third-party applications to integrate plug-and-play with cloud native ecosystem components.
As a full-stack multi-tenant container platform, KubeSphere provides an operation-friendly wizard interface to help enterprises quickly build a powerful and feature-rich container cloud platform. KubeSphere provides users with many of the capabilities needed to build an enterprise-level Kubernetes environment, for exampleMulti-cloud and multi-cluster management, Kubernetes resource management, DevOps, Application life cycle management, Micro-service governance (service grid), log query and collection, service and network, multi-tenant management, monitoring alarms, events and audit query, storage management, access control, GPU Support, network policy, mirror warehouse management, and security managementAnd so on.
KubeSphere is also open sourceKubekeyHelp enterprises quickly set up Kubernetes cluster in public cloud or data center with one click, provide single node, multi-node, cluster plug-in installation, and cluster upgrade and operation and maintenance.
Development and operation friendly
KubeSphere shields users from the complex technical details at the bottom of the infrastructure, helping enterprises seamlessly deploy, update, migrate, and manage existing containerized applications on top of various infrastructures. In this way, KubeSphere enables developers to focus on application development, enabling operations teams to speed up DevOps automation workflows and delivery processes with enterprise-class observability and troubleshooting mechanisms, unified monitoring and log query, storage and network management, and easy-to-use CI/CD pipelining.
Support to run KubeSphere on any platform
As a flexible, lightweight container PaaS platform, KubeSphere is very friendly to support different cloud ecosystems because it does not Hack into the native Kubernetes itself. In other words, KubeSphere can be deployed and run on any infrastructure and on all version-compatible Kubernetes clusters, including virtual machines, physical machines, data centers, public clouds, hybrid clouds, etc. You can choose to install KubeSphere on public clouds and hosted Kubernetes clusters (such as Ali Cloud, AWS, QingCloud, Tencent Cloud, Huawei Cloud, etc.), as well as import and manage existing Kubernetes clusters. KubeSphere can be deployed on the existing Kubernetes platform without modifying the user’s current resources or assets and without affecting their business. For more information, see Installing on Linux and Installing on Kubernetes.
Fully open source
With the open source model, the KubeSphere community drives development in an open manner. KubeSphere is 100% open source and free. It has been widely used in Docker and Kubernetes-centered development, testing and production environments, and a large number of services run smoothly on KubeSphere. You can find all the source code, documentation, and discussions on GitHub, and all the major open source project introductions can be found in the Open Source Project list.
Cloud native Landscape
KubeSphere is a member of CNCF Foundation and has passed Kubernetes consistency certification, which further enriches the CNCF cloud ecosystem.
Install kubesphere
Check in advance
1. Run it on the cluster nodekubectl version
To ensure that Kubernetes versions are compatible. The output is as follows:
Please note thatServer Version
This line. ifGitVersion
If the version is old, you need to upgrade Kubernetes first
2. Check whether the available resources in the cluster meet the minimum requirements.
Swap is 0 because kubernetes was disabled before deployment. If kubernetes is currently enabled, it is recommended to disable it
3. Check whether it exists in the clusterThe default StorageClass
If you do not configure the installation directly, the following error occurs
Because this section is not included in the installation documentation, it can be easily overlooked. Let’s look at a separate description of this section
Kubekey is officially recommended for installation and provides a number of persistent storage solutions.portal
However, except for the first cloud storage solution, all other solutions require an additional set of storage services, which are recommended for use in production environments. We’ll use the default storage type hereOpenEBS.
The OpenEBS local PV dynamic provider can use a unique HostPath (directory) on the node to create Kubernetes local persistent volumes for persistent data. If you do not have a specific storage system, you can use the default OpenEBS to get started quickly.
Note: The storage type created with LocalPV based on OpenEBS is only suitable for development test environments and is not recommended for production environments. In the production environment, you are advised to prepare persistent storage that meets Kubernetes requirements (such as GlusterFS, Ceph, NFS, Neonsan distributed storage, or block storage on the cloud) and then create the corresponding StorageClass.
Install OpenEBS persistent storage
GitHub provides two installation methods. We use the second one, but we need to install Helm. Helm is the Kubernetes package manager, which is the most convenient way to install K8S-related components.
Install the Helm
Each Helm release provides binary versions of various operating systems that can be manually downloaded and installed. Note that the installed version of helm is also related to Kubernetes, see Helm Version Support Policy for details.
- Download the required version
- Extract (
Tar - ZXVF helm - v3.0.0 - Linux - amd64. Tar. Gz
) - Locate the HELM program in the unzip directory and move it to the desired directory (
mv linux-amd64/helm /usr/local/bin/helm
)
2. Verify the installationhelm version
Install OpenEBS
Perform Step 3 to install OpenEBS on the Work node. You are advised to install OpenEBS on the Master node.
Solution: Manually cancel the Taint before installing OpenEBS, and after installing OpenEBS and KubeSphere, press Taint on master.
1. Obtain the description information of master node and find that Taint is marked as NoSchedule. This flag means that the master node is not scheduled to install, so it needs to be removed.
2. Remove the Taint from the master node. Note the “-” sign
kubectl taint nodes k8s-node1 node-role.kubernetes.io/master:NoSchedule-
Copy the code
3. Perform the installation
# Add OpenEBS source
helm repo add openebs https://openebs.github.io/charts
# Update warehouse
helm repo update
Create the openEBS namespace
kubectl create ns openebs
# installation OpenEBS
helm install --namespace openebs --name openebs stable/openebs
Copy the code
4. View the created persistent storagekubectl get sc
5. We’re not done here. We have to set oneThe defaultThe StorageClass
Openebs-hostpath is used as the default StorageClass
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
Copy the code
6. The LocalPV of OpenEBS has been created as the default storage type. Can be achieved bykubectl get sc
Command to check whether the default label exists. And then by commandkubectl get pod -n openebs
To view the status of OpenEBS related PODS. If the STATUS of all pods is RUNNING, the storage device is successfully installed.
Install kubesphere
1. Run the following command to download the YML file to the local PC.
Kubectl apply -f kubectl at https://github.com/kubesphere/ks-installer/releases/download/v3.1.0/kubesphere-installer.yaml Apply the -f https://github.com/kubesphere/ks-installer/releases/download/v3.1.0/cluster-configuration.yamlCopy the code
2. Check installation logs
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
Copy the code
If this screen is displayed, the installation is successful
Use 3.kubectl get pods -A
Check to see if all pods are working properly in KubeSphere’s related namespace. If so, check the console port (default: 30880) by using the following command
kubectl get svc -n kubesphere-system
Copy the code
4. Log in to the console and check the node running status