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

    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.

    Note

    The preceding system requirements and the following instructions are for the default minimal installation without any pluggable components enabled. If your machine has at least 8 CPU cores and 16 GB memory, it is recommended that you enable all components. For more information, see .

    • The node can be accessed through .
    • sudo/curl/openssl should be used.

    Your cluster must have an available container runtime. If you use KubeKey to set up a cluster, KubeKey installs the latest version of Docker by default. Alternatively, you can manually install Docker or other container runtimes before you create a cluster.

    Note

    To deploy KubeSphere in an offline environment, you must install a container runtime in advance.

    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 following list to see if you need to install relevant dependencies on your node in advance.

    Info

    Developed in Go, 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.

    • 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.
    • Supported CNI plugins: Calico and Flannel. Others (such as Cilium and Kube-OVN) may also work but note that they have not been fully tested.
    • 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 .

    Perform the following steps to download KubeKey.

    Download KubeKey from its GitHub Release Page or run the following command:

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

    1. export KKZONE=cn

    Run the following command to download KubeKey:

    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 following steps.

    Note

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

    Make kk executable:

    Step 3: Get Started with Installation

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

    1. ./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.0

    Note

    • Recommended Kubernetes versions for KubeSphere 3.2.0: v1.19.x, v1.20.x, v1.21.x and v1.22.x (experimental). If you do not specify a Kubernetes version, KubeKey installs Kubernetes v1.21.5 by default. For more information about supported Kubernetes versions, see Support Matrix.
    • For all-in-one installation, 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 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 run the command, you will see a table for environment check. For details, see and Dependency requirements. Type yes to continue.

    If the following information is displayed, Kubernetes and KubeSphere is successfully installed.

    Run the following command to check the result.

    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 at <NodeIP>:30880 with the default account and password (admin/[[email protected]](https://kubesphere.io/cdn-cgi/l/email-protection)).

    1. #####################################################
    2. ### Welcome to KubeSphere! ###
    3. #####################################################
    4. Console: http://192.168.0.2:30880
    5. Password: [email protected]
    6. NOTES
    7. 1. After you log into the console, please check the
    8. monitoring status of service components in
    9. "Cluster Management". If any service is not
    10. ready, please wait patiently until all components
    11. are up and running.
    12. 2. Please change the default password after login.
    13. #####################################################
    14. 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.

    Enable Pluggable Components (Optional)

    This guide is used only for the minimal installation by default. For more information about how to enable other components in KubeSphere, see Enable Pluggable Components.