Deploy KubeSphere on GKE
This guide walks you through the steps of deploying KubeSphere on Google Kubernetes Engine.
Prepare a GKE cluster
At first, a standard Kubernetes in GKE is a prerequisite of installing KubeSphere. We create a GKE cluster with 1.14.8-gke.17
in this demo, and choose the n1-standard-2 (2 vCPU, 7.5 GB memory)
and three nodes in Machine configuration.
Note:
n1-standard-2 (2 vCPU, 7.5 GB memory)
is the minimal requirement. It is recommended to choose higher machine configuration for production environment.n1-standard-2 (2 vCPU, 7.5 GB memory)
is used for minimal installation of KubeSphere. If you want to install any pluggable component, you need to provide more machine resource. Please see Enabling pluggable components installation for more information.- Supported Kubernetes versions:
1.15 ≤ K8s version ≤ 1.17
for KubeSphere 2.1.1;1.13.0 ≤ K8s version ≤ 1.15
for KubeSphere 2.1.0.
Create Tiller Service Account
KubeSphere v2.1 requires Helm (>= v2.10.0 and < 3.0, excluding v2.16.0) to continue the installation. By default, Tiller is not installed on GKE, thus we need to install Tiller first.
When GKE cluster is ready, we can connect to Cloud Shell.
Here, we create helm-rbac.yaml
in GKE as follows.
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
Let’s create these resources using kubectl.
kubectl apply -f helm-rbac.yaml
Deploy Tiller
Initialize Helm using the following command.
helm init --service-account=tiller --tiller-image=gcr.io/kubernetes-helm/tiller:v2.14.1 --history-max 300
Check the Tiller status using kubectl. When it displays 1/1
, it means you are ready to continue.
kubectl get deployment tiller-deploy -n kube-system
Install KubeSphere
Install KubeSphere using kubectl. The following command is only to start the default minimal installation.
kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml
Verify the real-time logs, when you see the following outputs, congratulation! You can access KubeSphere in your browser.
$ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
#####################################################
### Welcome to KubeSphere! ###
#####################################################
Console: http://10.128.0.34:30880
Account: admin
Password: P@88w0rd
NOTES:
1. After logging into the console, please check the
monitoring status of service components in
the "Cluster Status". If the service is not
ready, please wait patiently. You can start
to use when all components are ready.
2. Please modify the default password after login.
#####################################################
Access KubeSphere console
In this section, we will show you how to access KubeSphere console by changing service type to LoadBalancer
.
Select Services & Ingress
> ks-console
, then click EDIT
and modify the service type from NodePort
to LoadBalancer
.
Now, you can access KubeSphere console using the endpoint that was generated by GKE.
Note: In addition to changing the service type to LoadBalancer, you can also access KubeSphere console via
NodeIP:NodePort
. You may need to allow port30880
in firewall rules.
Log in KubeSphere console using the default account admin / P@88w0rd
. You will see the dashboard as shown in the following screenshot.
Enable Pluggable Components (Optional)
The installation above is only used for a default minimal installation. Execute the following command to open the configmap in order to enable more pluggable components. Make sure your cluster has enough CPU and memory. Please see Configuration Table for the requirements and Enable Pluggable Components for the instructions.
If you want to enable DevOps or Etcd monitoring, please create CA and Etcd certificates first. See ks-installer for detailed guide.
kubectl edit cm -n kubesphere-system ks-installer