• Stars
    star
    507
  • Rank 85,107 (Top 2 %)
  • Language Jinja
  • License
    Apache License 2.0
  • Created almost 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Install KubeSphere on existing Kubernetes cluster

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.

More Repositories

1

kubesphere

The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management โŽˆ ๐Ÿ–ฅ โ˜๏ธ
Go
12,855
star
2

kubekey

Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA ๐Ÿ”ฅ โŽˆ ๐Ÿณ
Go
2,027
star
3

kubeeye

KubeEye aims to find various problems on Kubernetes, such as application misconfiguration, unhealthy cluster components and node problems.
Go
786
star
4

console

KubeSphere Console is the web-based UI for KubeSphere clusters.
JavaScript
558
star
5

notification-manager

K8s native notification management with multi-tenancy support
Go
218
star
6

kube-events

K8s Event Exporting, Filtering and Alerting in Multi-Tenant Environment
Go
164
star
7

ks-devops

This is a cloud-native application that focuses on the DevOps area.
Go
158
star
8

community

KubeSphere Community
120
star
9

devops-java-sample

SpringBoot demo for DevOps on KubeSphere
Java
117
star
10

helm-charts

Source & Repo of https://charts.kubesphere.io/main & https://charts.kubesphere.io/test
Mustache
97
star
11

kube-design

Kube Design for KubeSphere Console
JavaScript
96
star
12

tower

Proxy for multiple Kubernetes cluster communication
Go
92
star
13

website

KubeSphere website and documentation 3.x
SCSS
78
star
14

devops-agent

Agents for Kubesphere DevOps
Dockerfile
59
star
15

s2ioperator

Operator for Source to image
Go
41
star
16

devops-maven-sample

Java
36
star
17

alert

Go
27
star
18

logsidecar-injector

A MutatingAdmissionWebhook that adds a sidecar to your pod. This sidecar is just for forwarding file log on the volume.
Go
25
star
19

ks-jenkins

Jenkins distribution for Kubesphere
Python
24
star
20

dev-guide

A set of development guidelines for KubeSphere developers.
HTML
19
star
21

s2irun

Run s2i in pod
Go
18
star
22

monitoring-dashboard

Custom Metrics Monitoring Dashboard for Apps on KubeSphere
Go
16
star
23

s2i-java-container

Java S2I Builder image
Shell
15
star
24

event-rule-engine

Go
10
star
25

tutorial

KubeSphere tutorial repo, include samples code, docs etc.
Shell
10
star
26

storageclass-accessor

The storageclass-accessor webhook is an HTTP callback which responds to admission requests.
Go
9
star
27

client-go

Go
9
star
28

devops-go-sample

Go
8
star
29

image-sync-config

8
star
30

im

A general identity management system
Go
8
star
31

api

Go
7
star
32

ksbuilder

A CLI tool helps you to manage the development of kubesphere extensions
Go
7
star
33

s2i-java-runtimeImage

a java runtime image for s2i
Shell
5
star
34

alert-adapter

Go
5
star
35

s2i-python-container

Shell
5
star
36

pvc-autoresizer

pvc-autoresizer resizes PersistentVolumeClaims (PVCs) when the free amount of storage is below the threshold.
Go
5
star
37

test-infra

Dockerfile
4
star
38

prometheus-example-app

Smarty
4
star
39

devops-python-sample

devops-python-sample for Kubesphere
Python
4
star
40

kubeeye-console

TypeScript
3
star
41

sonargo

Go
3
star
42

cluster-api-provider-qingcloud

The QingCloud provider implementation of the Cluster Management API
Go
3
star
43

create-ks-project

A CLI tool enables you to quickly set up a KubeSphere Console extension project.
TypeScript
3
star
44

s2i-nodejs-container

Shell
3
star
45

ks-prometheus

Jsonnet
2
star
46

aks-kubesphere-linux

KubeSphere on Azure AKS
2
star
47

openpitrix-jobs

Go
2
star
48

alertmanager-kit

alertmanager-kit encapsulates the interface to alertmanager in a neat way.
Go
2
star
49

container-common-scripts

Shell
2
star
50

s2i-binary-container

Dockerfile
1
star
51

devops-docs-sample

JavaScript
1
star
52

springboot-sample

Java
1
star
53

extension-samples

JavaScript
1
star
54

s2i-base-container

Shell
1
star
55

artwork

๐ŸŽจKubeSphere-related logos and artwork
1
star
56

.github

1
star
57

kubeocean-api

Go
1
star
58

kubectl

kubectl docker image used in kubesphere.
Dockerfile
1
star
59

design-prototypes

Design prototypes for kubesphere console.
HTML
1
star