Giter Site home page Giter Site logo

liuzhiheng126 / ks-installer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubesphere/ks-installer

0.0 0.0 0.0 93.24 MB

Install KubeSphere on existing Kubernetes cluster

Home Page: https://kubesphere.io

License: Apache License 2.0

Shell 10.06% Python 9.34% Makefile 0.09% Smarty 0.49% Dockerfile 0.11% Mustache 9.46% Jinja 70.43%

ks-installer's Introduction

Install KubeSphere on Existing Kubernetes Cluster

English | δΈ­ζ–‡

In addition to supporting deploying on VM and BM, KubeSphere also supports installing on cloud-hosted and on-premises existing Kubernetes clusters.

Prerequisites

  • Kubernetes Version: 1.20.x, 1.21.x, 1.22.x, 1.23.x (experimental);
  • CPU > 1 Core, Memory > 2 G;
  • An existing default Storage Class in your Kubernetes clusters.
  • 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.
  1. Make sure your Kubernetes version is compatible by running kubectl version in your cluster node. The output looks as the following:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.8", GitCommit:"fd5d41537aee486160ad9b5356a9d82363273721", GitTreeState:"clean", BuildDate:"2021-02-17T12:41:51Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.8", GitCommit:"fd5d41537aee486160ad9b5356a9d82363273721", GitTreeState:"clean", BuildDate:"2021-02-17T12:33:08Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}

Note: Pay attention to Server Version line, if GitVersion is greater than v1.19.0, it's good to go. Otherwise you need to upgrade your Kubernetes first.

  1. Check if the available resources meet the minimal prerequisite in your cluster.
$ free -g
              total        used        free      shared  buff/cache   available
Mem:              16          4          10           0           3           2
Swap:             0           0           0
  1. Check if there is a default Storage Class in your cluster. An existing Storage Class is the prerequisite for KubeSphere installation.
$ kubectl get sc
NAME                      PROVISIONER               AGE
glusterfs (default)               kubernetes.io/glusterfs   3d4h

If your Kubernetes cluster environment meets all requirements mentioned above, then you can start to install KubeSphere.

To Start Deploying KubeSphere

Minimal Installation

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.3.0/kubesphere-installer.yaml
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.3.0/cluster-configuration.yaml

Then inspect the logs of installation.

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

When all Pods of KubeSphere are running, it means the installation is successful. Check the port (30880 by default) of the console service by the following command. Then you can use http://IP:30880 to access the console with the default account admin/P@88w0rd.

kubectl get svc/ks-console -n kubesphere-system

Enable Pluggable Components

Attention:

  • KubeSphere supports enable the pluggable components before or after the installation, you can refer to the cluster-configuration.yaml for more details.
  • Make sure there is enough CPU and memory available in your cluster.
  1. [Optional] Create the secret of certificate for Etcd in your Kubernetes cluster. This step is only needed when you want to enable Etcd monitoring.

Note: Create the secret according to the actual Etcd certificate path of your cluster; If the Etcd has not been configured certificate, an empty secret needs to be created.

  • If the Etcd has been configured with certificates, refer to the following step (The following command is an example that is only used for the cluster created by kubeadm):
$ kubectl -n kubesphere-monitoring-system create secret generic kube-etcd-client-certs  \
--from-file=etcd-client-ca.crt=/etc/kubernetes/pki/etcd/ca.crt  \
--from-file=etcd-client.crt=/etc/kubernetes/pki/etcd/healthcheck-client.crt  \
--from-file=etcd-client.key=/etc/kubernetes/pki/etcd/healthcheck-client.key
  • If the Etcd has not been configured with certificates.
kubectl -n kubesphere-monitoring-system create secret generic kube-etcd-client-certs
  1. If you already have a minimal KubeSphere setup, you still can enable the pluggable components by editing the ClusterConfiguration of ks-installer using the following command.

Note: Please make sure there is enough CPU and memory available in your cluster.

kubectl edit cc ks-installer -n kubesphere-system

Note: When you're enabling KubeEdge, please set advertiseAddress as below and expose corresponding ports correctly before you run or restart ks-installer. Please refer to KubeEdge Guide for more details.

kubeedge:
    cloudCore:
      cloudHub:
        advertiseAddress:
        - xxxx.xxxx.xxxx.xxxx
  1. Inspect the logs of installation.
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-installer -o jsonpath='{.items[0].metadata.name}') -f

Upgrade

Deploy the new version of ks-installer:

# Notice: ks-installer will automatically migrate the configuration. Do not modify the cluster configuration by yourself.

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.3.0/kubesphere-installer.yaml --force

Note: If your KubeSphere version is v3.1.0 or eariler, please upgrade to v3.2.x first.

ks-installer's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.