You are viewing documentation for KubeSphere version:v3.0.0

KubeSphere v3.0.0 documentation is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest version.

All-in-one Installation of Kubernetes and KubeSphere on Linux

For those who are new to KubeSphere and looking for a quick way to discover the container platform, the all-in-one mode is your best choice to get started. It features rapid deployment and hassle-free configuration installation with KubeSphere and Kubernetes all provisioned on your machine.

Video Demonstration

Step 1: Prepare a Linux Machine

To get started with all-in-one installation, you only need to prepare one host according to the following requirements for hardware and operating system.

Hardware recommendations

System Minimum Requirements
Ubuntu 16.04, 18.04 CPU: 2 Cores, Memory: 4 G, Disk Space: 40 G
Debian Buster, Stretch CPU: 2 Cores, Memory: 4 G, Disk Space: 40 G
CentOS 7.x CPU: 2 Cores, Memory: 4 G, Disk Space: 40 G
Red Hat Enterprise Linux 7 CPU: 2 Cores, Memory: 4 G, Disk Space: 40 G
SUSE Linux Enterprise Server 15/openSUSE Leap 15.2 CPU: 2 Cores, Memory: 4 G, Disk Space: 40 G

Note

The system requirements above and the instructions below are for the default minimal installation without any pluggable components enabled. If your machine has at least 8 cores and 16G memory, it is recommended that you enable all components. For more information, see Enable Pluggable Components.

Node requirements

  • The node can be accessed through SSH.
  • sudo/curl/openssl should be used.
  • docker can be installed by yourself or by KubeKey.

Note

docker must be installed in advance if you want to deploy KubeSphere in an offline environment.

Dependency requirements

KubeKey can install Kubernetes and KubeSphere together. The dependency that needs to be installed may be different based on the Kubernetes version to be installed. You can refer to the list below to see if you need to install relevant dependencies on your node in advance.

Dependency Kubernetes Version ≥ 1.18 Kubernetes Version < 1.18
socat Required Optional but recommended
conntrack Required Optional but recommended
ebtables Optional but recommended Optional but recommended
ipset Optional but recommended Optional but recommended

Info

Developed in Go language, KubeKey represents a brand-new installation tool as a replacement for the ansible-based installer used before. KubeKey provides users with flexible installation choices, as they can install KubeSphere and Kubernetes separately or install them at one time, which is convenient and efficient.

Network and DNS requirements

  • Make sure the DNS address in /etc/resolv.conf is available. Otherwise, it may cause some issues of DNS in the cluster.
  • If your network configuration uses firewall rules or security groups, you must ensure infrastructure components can communicate with each other through specific ports. It is recommended that you turn off the firewall. For more information, see Port Requirements.

Tip

  • It is recommended that your OS be clean (without any other software installed). Otherwise, there may be conflicts.
  • It is recommended that a registry mirror (a booster) be prepared if you have trouble downloading images from dockerhub.io. For more information, see Configure a Booster for Installation.

Step 2: Download KubeKey

Follow the steps below to download KubeKey.

Download KubeKey from its GitHub Release Page or use the following command directly.

curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

Run the following command first to make sure you download KubeKey from the correct zone.

export KKZONE=cn

Run the following command to download KubeKey:

curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -

Note

After you download KubeKey, if you transfer it to a new machine also with poor network connections to Googleapis, you must run export KKZONE=cn again before you proceed with the steps below.

Note

The commands above download the latest release (v1.0.1) of KubeKey. You can change the version number in the command to download a specific version.

Make kk executable:

chmod +x kk

Step 3: Get Started with Installation

In this tutorial, you only need to execute one command for installation, the template of which is shown below:

./kk create cluster [--with-kubernetes version] [--with-kubesphere version]

To create a Kubernetes cluster with KubeSphere installed, refer to the following command as an example:

./kk create cluster --with-kubernetes v1.17.9 --with-kubesphere v3.0.0

Note

  • Supported Kubernetes versions: v1.15.12, v1.16.13, v1.17.9 (default), v1.18.6.
  • For all-in-one installation, generally speaking, you do not need to change any configuration.
  • If you do not add the flag --with-kubesphere in the command in this step, KubeSphere will not be deployed. KubeKey will install Kubernetes only. If you add the flag --with-kubesphere without specifying a KubeSphere version, the latest version of KubeSphere will be installed.
  • KubeKey will install OpenEBS to provision LocalPV for the development and testing environment by default, which is convenient for new users. For other storage classes, see Persistent Storage Configurations.

After you execute the command, you will see a table as below for environment check. For details, read Node requirements and Dependency requirements above. Input yes to continue.

environment-check

Step 4: Verify the Installation

When you see the output as below, it means the installation of Kubernetes and KubeSphere finishes.

Installation-complete

Input the following command to check the result.

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

The output displays the IP address and port number of the web console, which is exposed through NodePort 30880 by default. Now, you can access the console through EIP:30880 with the default account and password (admin/P@88w0rd).

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://192.168.0.2:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After logging into the console, please check the
     monitoring status of service components in
     the "Cluster Management". If any service is not
     ready, please wait patiently until all components
     are ready.
  2. Please modify the default password after login.

#####################################################
https://kubesphere.io             20xx-xx-xx xx:xx:xx
#####################################################

Note

You may need to configure port forwarding rules and open the port in your security group so that external users can access the console.

After logging in to the console, you can check the status of different components in Components. You may need to wait for some components to be up and running if you want to use related services. You can also use kubectl get pod --all-namespaces to inspect the running status of KubeSphere workloads.

kubesphere-components

Enable Pluggable Components (Optional)

The guide above is used only for the minimal installation by default. To enable other components in KubeSphere, see Enable Pluggable Components for more details.

Code Demonstration