Installing KubeSphere on Minikube

In addition to installing KubeSphere on a Linux machine, you can also deploy it on minikube cluster. This tutorial demonstrates the general steps of completing a minimal KubeSphere installation on Minikube.

Prerequisites

  • To install KubeSphere 3.2.1 on Minikube, your Minikube version must be v1.23.x, v1.24.x, v1.25.x.
  • Make sure your machine meets the minimal hardware requirement: CPU > 2 Core, Memory > 2 GB, 20GB free disk space, Container or virtual machine manager, such as: Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware Fusion/Workstation.
  • A default Storage Class in your Minikube cluster needs to be configured before the installation.

Pre-checks

  1. Make sure your minikube version is compatible by running minikube version in your terminal. The output may look as below:

    1. minikube version
    2. minikube version: v1.24.0
    3. commit: 76b94fb3c4e8ac5062daf70d60cf03ddcc0a741b
  2. Check if the available resources in your cluster meet the minimum requirements.

    1. free -g
    2. total used free shared buff/cache available
    3. Mem: 6 2 2 0 1 3
    4. Swap: 0 0 0
    5. ## Memory > 2GB
    6. lscpu
    7. Architecture: x86_64
    8. CPU op-mode(s): 32-bit, 64-bit
    9. Byte Order: Little Endian
    10. Address sizes: 40 bits physical, 48 bits virtual
    11. CPU(s): 4
    12. ## More than 2 CPUs
    13. df -h
    14. Filesystem Size Used Avail Use% Mounted on
    15. udev 3.4G 0 3.4G 0% /dev
    16. tmpfs 694M 2.6M 692M 1% /run
    17. /dev/sda3 198G 116G 73G 62% / ## Available more than 20GB free disk space
  3. Make sure your Kubectl version is compatible by running kubectl version in your minikube cluster node. The output may look as below:

    1. kubectl version
    2. Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:41:01Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
    3. Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.3", GitCommit:"c92036820499fedefec0f847e2054d824aea6cd1", GitTreeState:"clean", BuildDate:"2021-10-27T18:35:25Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}

    Note

    Pay attention to the Server Version line. If GitVersion shows an older one, you need to upgrade Kubectl first.

  4. Check if there is a default StorageClass in your cluster. An existing default StorageClass is a prerequisite for KubeSphere installation.

    1. $ kubectl get sc
    2. NAME PROVISIONER AGE
    3. glusterfs (default) kubernetes.io/glusterfs 3d4h

If your Minikube cluster environment meets all the requirements above, then you are ready to deploy KubeSphere on your Minikube.

Note

  • The CSR signing feature is activated in kube-apiserver when it is started with the --cluster-signing-cert-file and --cluster-signing-key-file parameters. See RKE installation issue.

Video Demonstration

Deploy KubeSphere

After you make sure your machine meets the conditions, perform the following steps to install KubeSphere.

  1. Start minikube.

    1. minikube start
    2. 😄 minikube v1.24.0 on Debian 10.1
    3. 🎉 minikube 1.25.2 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.25.2
    4. 💡 To disable this notice, run: 'minikube config set WantUpdateNotification false'
    5. Using the docker driver based on existing profile
    6. 👍 Starting control plane node minikube in cluster minikube
    7. 🚜 Pulling base image ...
    8. 🔄 Restarting existing docker container for "minikube" ...
    9. 🐳 Preparing Kubernetes v1.22.3 on Docker 20.10.8 ...
    10. 🔎 Verifying Kubernetes components...
    11. Using image gcr.io/k8s-minikube/storage-provisioner:v5
    12. 🌟 Enabled addons: storage-provisioner, default-storageclass
    13. 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
  2. Run the following commands to start installation:

    1. kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/kubesphere-installer.yaml
    2. kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/cluster-configuration.yaml
  3. After KubeSphere is successfully installed, you can run the following command to view the installation logs:

    1. 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
  4. Use kubectl get pod --all-namespaces to see whether all Pods are running normally in relevant namespaces of KubeSphere. If they are, check the port (30880 by default) of the console by running the following command:

    1. kubectl get svc/ks-console -n kubesphere-system
  5. Make sure port 30880 is opened in your security group and access the web console through the NodePort (IP:30880) with the default account and password (admin/P@88w0rd).

  6. After logging in to the console, you can check the status of different components in System Components. You may need to wait for some components to be up and running if you want to use related services.

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.

Code Demonstration

Uninstall KubeSphere from Minikube

You can uninstall KubeSphere from your existing Minikube cluster by using kubesphere-delete.sh. Copy it from the GitHub source file and execute this script on your local machine.

Warning

Uninstalling will remove KubeSphere from your Minikube cluster. This operation is irreversible and does not have any backup. Please be cautious with this operation.

Feedback

Was this page Helpful?

Yes No