最近又出來個kubesphere的工具用來管理k8s,今天特地來安裝體驗下;
nginx
github地址:https://github.com/pixiake/ks-installer git
官方使用文檔:https://kubesphere.io/docs/advanced-v2.0/zh-CN/installation/all-in-one/github
先放上安裝效果圖,UI界面仍是很清爽的:redis
當前環境:json
k8s集羣已經安裝完成,用kubesphere管理現有的k8s集羣;centos
k8s版本爲1.14api
系統爲centos7.6bash
kubesphere使用要求:app
kubernetes version > 1.13.0ide
helm version > 2.10.0
a default storage class must be in kubernetes cluster
安裝完成後默認用戶名密碼:
用戶名:admin
密碼:P@88w0rd
安裝步驟大概記錄:
kubectl create ns kubesphere-system kubectl create ns kubesphere-monitoring-system #訪問etcd用到的secret kubectl -n kubesphere-monitoring-system create secret generic kube-etcd-client-certs --from-file=etcd-client-ca.crt=ca.pem --from-file=etcd-client.crt=etcd-key.pem --from-file=etcd-client.key=etcd.pem #管理k8s用到的secret kubectl -n kubesphere-system create secret generic kubesphere-ca --from-file=ca.crt=ca.pem --from-file=ca.key=ca-key.pem #clone好github項目,執行下面的這條命令 cd deploy kubectl apply -f kubesphere-installer.yaml #執行完上面的命令,能夠經過下面的命令,查看安裝過程日誌 kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l job-name=kubesphere-installer -o jsonpath='{.items[0].metadata.name}') -f #查看安裝結果,STATUS跟下面保持一致才說明安裝成功 [root@ks-allinone deploy]# kubectl get pods -n kubesphere-system NAME READY STATUS RESTARTS AGE ks-account-6db466d8dc-srrwj 1/1 Running 0 149m ks-apigateway-7d77cb9495-jzmg6 1/1 Running 0 170m ks-apiserver-f8469fd47-b58rm 1/1 Running 0 166m ks-console-54c849bdc9-dfkbf 1/1 Running 0 168m ks-console-54c849bdc9-z2d5q 1/1 Running 0 168m ks-controller-manager-569456b4cd-gngm5 1/1 Running 0 170m ks-docs-6bbdcc9bfb-6jldz 1/1 Running 0 3h7m kubesphere-installer-7ph6l 0/1 Completed 1 3h11m openldap-5c986c5bff-rzqwv 1/1 Running 0 3h25m redis-76dc4db5dd-lv6kg 1/1 Running 0 149m
安裝過程出現的錯誤:
1.在安裝的時提示metrics-server已經安裝,致使安裝中斷;
解析辦法:在kubesphere-installer.yaml的configMap增長配置:metrics_server_enable: False(默認是沒有的)
apiVersion: v1 data: ks-config.yaml: | kube_apiserver_host: 10.10.5.208:6443 etcd_tls_enable: True etcd_endpoint_ips: 10.10.5.169,10.10.5.183,10.10.5.184 disableMultiLogin: True elk_prefix: logstash metrics_server_enable: False # local_registry: 192.168.1.2:5000 kind: ConfigMap metadata: name: kubesphere-config namespace: kubesphere-system
增長Ingress配置:
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: kubesphere namespace: kubesphere-system annotations: #kubernetes.io/ingress.class: traefik kubernetes.io/ingress.class: nginx spec: rules: - host: ks.staplescn.com http: paths: - path: backend: serviceName: ks-console servicePort: 80
訪問界面: