当前位置:网站首页>Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm

Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm

2022-06-27 16:16:00 51CTO

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _Kstone

  author | Li Dabai

 

  This article has participated in 「 Open source star picking program 」, Welcome to join us .

  Activity Links :​ ​https://github.com/weopenprojects/WeOpen-Star​


Deployment environment

  • There is one kubernetes colony ;
  • Installed with Helm;
  • install Git( Optional );
  • operating system : CentOS 7.5 (VMWare Virtual host );


install Helm

Because I use it. Helm Deploy Kstone, All have to be in my kubernetes Clustered master The nodes shall be installed first Helm Package management tools .

      
      
$ wget https://get.helm.sh/helm-v3.7.2-linux-amd64.tar.gz
$ tar -zxvf helm-v3.7.2-linux-amd64.tar.gz
$ mv linux-amd64/helm /usr/local/bin/helm
$ helm version
version.BuildInfo{Version: "v3.7.2", GitCommit: "663a896f4a815053445eec4153677ddc24a0a361",
GitTreeState: "clean", GoVersion: "go1.16.10"}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.

  helm Download the installation package in advance , Because the download process will be slow .


install git

      
      
$ yum install -y git
$ git version
git version 1.8.3.1
  • 1.
  • 2.
  • 3.


download Kstone Chart package

      
      
$ git clone -b release-0.2 git@github.com:tkestack/kstone.git
$ cd kstone
$ cd ./charts
  • 1.
  • 2.
  • 3.

establish Kstone Namespace

      
      
$ kubectl create ns kstone
  • 1.

establish Admin TOKEN

by dashboard-api establish Admin TOKEN To visit Kubernetes

      
      
$ kubectl create serviceaccount kube-admin -n kube-system
$ kubectl create clusterrolebinding kube-admin \
--clusterrole =cluster-admin --serviceaccount =kube-system:kube-admin
  • 1.
  • 2.
  • 3.

obtain Admin TOKEN

from Kubeadm Cluster access Admin TOKEN.

      
      
$ kubectl get secrets -o jsonpath = "{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='kube-admin')].data.token}" -n kube-system|base64 --decode
  • 1.


modify values.yaml To configure

modify charts/dashboard-api/values.yaml In file kube.token Parameter value in , Just get the Token Copy to file .$token It is the access credential of the cluster to be deployed TOKEN, You need to be able to access all the resources in the cluster .

      
      
[[email protected] charts] # vim charts/dashboard-api/values.yaml
kube:
# need to fill
token: $token
target: kubernetes.default.svc.cluster.local:443
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _ Operation and maintenance _02


Helm Deploy Kstone

Helm Install the test environment Kstone,values.test.yaml by Test environment ,values.yaml For the production environment , The difference is that the test environment takes up less resources , If your own kubernetes The cluster resources are sufficient , Production can be deployed .

      
      
$ cd charts/
$ pwd
/app/kstone/charts
$ helm install kstone . -n kstone -f values.test.yaml
  • 1.
  • 2.
  • 3.
  • 4.

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _etcd_03

see Pod resources

      
      
[[email protected] charts] # kubectl -n kstone get pods
NAME READY STATUS RESTARTS AGE
kstone-backup-operator-7664c59c84-n8dmk 1/1 Running 0 23m
kstone-dashboard-5c9587b569-5s6g4 1/1 Running 0 23m
kstone-dashboard-api-546cbf8578-glhdq 1/1 Running 0 23m
kstone-etcd-controller-76d988d96c-g4pxz 1/1 Running 0 23m
kstone-etcd-operator-cb8c9f8b5-btxzg 1/1 Running 0 23m
kstone-grafana-64f86f5b59-dbwpf 2/2 Running 0 23m
kstone-inspection-controller-6c548dd76d-hvkgf 1/1 Running 0 23m
kstone-prometheus-operator-58df5b47cc-dsbvt 1/1 Running 0 23m
prometheus-kstone-prometheus-prometheus-0 2/2 Running 0 19m
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _ Cloud native _04

You can see Pod The services have been deployed successfully , If deployment fails , Self checking .


see Service resources

      
      
[[email protected] charts] # kubectl -n kstone get svc
  • 1.

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _ Cloud native _05

To configure Ingress resources ( Optional )

In the installation Kstone When , By default Ingress resources , But it doesn't work , It needs to be deleted and recreated . Premise is kubernetes The cluster is deployed with Ingress-conroller controller .

1) View deployed Ingress

      
      
$ kubectl -n kstone get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
kstone <none> * 80 33m
  • 1.
  • 2.
  • 3.

2) Delete the old Ingress

      
      
$ kubectl delete ingress kstone -n kstone
ingress.networking.k8s.io "kstone-ingress" deleted
  • 1.
  • 2.

3) Recreate Ingress

      
      
$ kubectl apply -f kstone-ingress.yaml
ingress.networking.k8s.io/kstone-ingress created

$ cat kstone-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kstone-ingress
namespace: kstone
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kstone-dashboard
port:
number: 80
- path: /apis
pathType: Prefix
backend:
service:
name: kstone-dashboard-api
port:
number: 80
- path: /grafana
pathType: Prefix
backend:
service:
name: kstone-grafana
port:
number: 80
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _etcd_06


visit Kstone dashboard

         Enter the domain name or node address in the browser to access Kstone Of UI Management interface . because Kstone-dashboard Service is based on Nodeport Exposed in a way , You can also use nodes IP+ Access through the service port .

Etcd Visualization tools :Kstone Deploy ( One ), be based on Helm Rapid deployment _Kstone_07

【 Next 】: Use Kstone Efficient management etcd colony


原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206271523396230.html

随机推荐