Install and deploy KubeSphere management kubernetes

highlight: tomorrow-night

  • Create and grow together! This is the first day of my participation in the "Nuggets day new plan - August update challenge", Click to view activity details

preface

KubeSphere is a multi cluster managed distributed operating system of Kubernetes, and supports DevOps workflow. Its architecture can easily plug and play third-party applications with cloud native ecosystem components.

KubeSphere It provides an operation and maintenance friendly wizard operation interface to help enterprises quickly build a powerful and feature rich container cloud platform.
KubeSphere Provide users with building enterprise level Kubernetes Multiple functions required by the environment,for example:
- Multi cloud and multi cluster management
- Kubernetes Resource management
- DevOps,
- Application lifecycle management
- Microservice governance (service grid)
- Log query and collection, service and network
- Multi tenant management
- Monitoring alarm
- Event and audit query
- Storage management
- Access control
- GPU Support
- Network strategy
- Image warehouse management and security management.

The installation and deployment of kubernetes has always been a pain point, but KubeSphere is open source KubeKey Kubernetes clusters can be quickly built in the public cloud or data center with one click, providing single node, multi node, cluster plug-in installation, cluster upgrade and operation and maintenance.

The next installation is based on kubeKey

1. Environment configuration

Configuration of this chapter:

operating systemhardware configurationquantity
CentOS 7.62-core CPU, 4 GB memory, 60 GB disk space1 set

Officially supported operating system and minimum configuration

operating systemMinimum configuration
Ubuntu 16.04, 18.042-core CPU, 4 GB memory, 40 GB disk space
Debian Buster, Stretch2-core CPU, 4 GB memory, 40 GB disk space
CentOS 7.x2-core CPU, 4 GB memory, 40 GB disk space
Red Hat Enterprise Linux 72-core CPU, 4 GB memory, 40 GB disk space
SUSE Linux Enterprise Server 15/openSUSE Leap 15.22-core CPU, 4 GB memory, 40 GB disk space

Before installation, you'd better ensure that the environment is pure. I have a cloud server here and reinstalled CentOS7.6 system

Support containers

use KubeKey The latest container will be installed by default during installation, and it can also be used in KubeKey Install the designated container before installation

The following are supported container versions

Supported containersedition
Docker19.3.8 +
containerdthe latest version
CRI-O (pilot, not fully tested)the latest version
iSula (trial version, not fully tested)the latest version

Kubernetes dependency

KubeKey Installation can be specified Kubernetes and KubeSphere ,But different versions Kubernetes There are different dependency requirements
DependencyKubernetes version ≥ 1.18Kubernetes version < 1.18
socatmustOptional but recommended
conntrackmustOptional but recommended
ebtablesOptional but recommendedOptional but recommended
ipsetOptional but recommendedOptional but recommended

2. Configure software dependencies

Step 1: turn off the firewall

systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld

Step 2: close the swap partition

swapoff -a
echo "vm.swappiness=0" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

Step 3: configure epel source

rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

Step 4: update yum

yum -y update

Step 5: install dependent components

That is, all the contents in Kubernetes dependency above are installed

yum install -y ebtables socat ipset conntrack

3. Install KubeSphere and kubernetes

Using KubeKey, you can choose to install one or all of KubeSphere and kubernetes

Step 1: Download KubeKey

If the partner with poor network cannot download the default source, execute the following command to set up domestic download

export KKZONE=cn

Download KubeKey:

curl -sfL https://get-kk.kubesphere.io | VERSION=v2.2.1 sh -

Add executable permissions to KubeKey

chmod +x kk

Step 2: install KubeSphere and kubernetes

Please check the hostname before installation. If it does not comply with the rules, the following error will be reported

error: Pipeline[CreateClusterPipeline] execute failed: Module[InitKubernetesModule] exec failed: 
failed: [VM-20-8-centos] [AddWorkerLabel] exec failed after 5 retires: add worker label failed: Failed to exec command: sudo -E /bin/bash -c "/usr/local/bin/kubectl label --overwrite node VM-20-8-centos node-role.kubernetes.io/worker=" 
Error from server (NotFound): nodes "VM-20-8-centos" not found: Process exited with status 1

At this time, you need to modify the hostname, because we are installing on a single machine, so set it as master, and execute the following commands

hostnamectl --static set-hostname master

After setting, use the hostnamectl status command to verify

Execute the following command to install KubeSphere and kubernetes:

./kk create cluster --with-kubernetes v1.22.10 --with-kubesphere v3.3.0

If you only need to install one of KubeSphere or kubernetes, remove the other of – with

This installation takes a long time. Get up and move

Step 3: verification after installation

After installation, execute the following command to view the installation results

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f

The output information will display the IP address and port number of the Web console. The default NodePort is 30880. You can now use the default account and password (admin/ P@88w0rd )Access the console through <nodeip>: 30880.

Step 4: log in to the system

Visit the address of ip+30880 on the browser and the following page will appear

Use the default account and password (admin/ P@88w0rd )Log in, and then you can explore KubeSphere

But really use k8s Cluster single machine is not allowed. The next article is the configuration of multi node cluster

Tags: Kubernetes Container Cloud Native

Posted by mottwsc on Wed, 10 Aug 2022 02:10:41 +0930