当前位置:网站首页>Helm deploy etcd cluster
Helm deploy etcd cluster
2022-07-06 18:46:00 【Development, operation and maintenance Xuande public】
List of articles
1. chart And image preparation
1.1 The official download chart
- Download address
https://artifacthub.io/ - Search for etcd, choice bitnami Version of
1.2 download
Find a server that can access the public network , Refer to the official download chart package
- add to helm Warehouse
# helm repo add bitnami-aks https://marketplace.azurecr.io/helm/v1/repo
- Choose the right version
# helm pull bitnami-aks/etcd --version 6.2.9
so chart The package has been downloaded to the current directory
# ll
-rw-r--r-- 1 root root 34334 7 month 19 14:34 etcd-6.2.10.tgzgz
take chart Copy to the target server .
1.3 Download mirroring
1.3.1 Download mirroring
The following images should be prepared in advance for offline installation :
- etcd Mirror image ( necessary )
docker.io/bitnami/etcd:3.4.15-debian-10-r33
- License related ( It's not necessary )
The image below is for writing licenses , If the license is not enabled, you can not downloaddocker.io/bitnami/bitnami-shell:10-debian-10-r134
1.3.2 Upload private image warehouse
The private image name is as follows :harbocto.xxx.com.cn/bitnami/etcd:3.4.15-debian-10-r33
harbocto.xxx.com.cn/bitnami/bitnami-shell:10-debian-10-r134
2. Modify the configuration file
Enter the generated after decompression etcd Catalog
- Modify the mirror ( Offline installation is necessary )
Change to local image
image:
registry: harbocto.xxx.com.cn
repository: bitnami/etcd
tag: 3.5.0-debian-10-r24
The lower license is not enabled , So it's OK not to modify
volumePermissions:
enabled: false
image:
registry: harbocto.xxx.com.cn
repository: bitnami/bitnami-shell
tag: 10-debian-10-r134
pullPolicy: Always
- Change Password ( It's not necessary )
auth:
rbac:
……
rootPassword: "Boe888888"
- Number of modified copies ( necessary )
replicaCount: 3
- Persistent storage size ( It's not necessary )
Persistent storage is enabled by default :persistence.enabled=true
So we just need to change pvc The size is ok
persistence:
......
size: 50Gi
- It is amended as follows NodePort( It's not necessary )
I didn't actually open , So the back service You can see what I still use ClusterIP
notes ClusterIP
Add the following after :
service:
type: NodePort
#type: ClusterIP
......
nodePorts:
clientPort: "31015"
peerPort: "31016"
3 Start the service
- establish namespace, Get into chart Of etcd Directory startup service
[[email protected] etcd]# kubectl create namespace etcd
[[email protected] etcd]# helm install etcd -n etcd ./
- see pod
[[email protected] etcd]# kubectl get pod -n etcd
NAME READY STATUS RESTARTS AGE
etcd-0 1/1 Running 0 25m
etcd-1 1/1 Running 0 25m
etcd-2 1/1 Running 0 25m
- see service
[[email protected] etcd]# kubectl get service -n etcd
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
etcd ClusterIP 10.1.231.186 <none> 2379/TCP,2380/TCP 25m
etcd-headless ClusterIP None <none> 2379/TCP,2380/TCP 25m
4. test
- Output
The visible data just created is as follows :
[[email protected] etcd]# helm install etcd -n etcd ./
NAME: etcd
LAST DEPLOYED: Mon Jul 19 15:56:47 2021
NAMESPACE: etcd
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **
etcd can be accessed via port 2379 on the following DNS name from within your cluster:
etcd.etcd.svc.cluster.local
To create a pod that you can use as a etcd client run the following command:
kubectl run etcd-client --restart='Never' --image harbocto.boe.com.cn/bitnami/etcd:3.5.0-debian-10-r24 --env ROOT_PASSWORD=$(kubectl get secret --namespace etcd etcd -o jsonpath="{.data.etcd-root-password}" | base64 --decode) --env ETCDCTL_ENDPOINTS="etcd.etcd.svc.cluster.local:2379" --namespace etcd --command -- sleep infinity
Then, you can set/get a key using the commands below:
kubectl exec -it etcd-client -- bash
etcdctl --user root:$ROOT_PASSWORD put /message Hello
etcdctl --user root:$ROOT_PASSWORD get /message
To connect to your etcd server from outside the cluster execute the following commands:
kubectl port-forward --namespace etcd svc/etcd 2379:2379 &
echo "etcd URL: http://127.0.0.1:2379"
* As rbac is enabled you should add the flag `--user root:$ETCD_ROOT_PASSWORD` to the etcdctl commands. Use the command below to export the password:
export ETCD_ROOT_PASSWORD=$(kubectl get secret --namespace etcd etcd -o jsonpath="{.data.etcd-root-password}" | base64 --decode)
- Get into etcd Of pod
[[email protected] etcd]# kubectl exec -it -n etcd etcd-0 bash
- Write data
I have no [email protected]:/opt/bitnami/etcd$ etcdctl --user root:Bxx888888 put /message Hello
OK
- Read the data just written
I have no [email protected]:/opt/bitnami/etcd$ etcdctl --user root:Bxx888888 get /message
/message
Hello
FAQ
1)helm3.0.3 Report errors
helm 3.0.3 An error is as follows :
[[email protected] etcd]# helm version
version.BuildInfo{
Version:"v3.0.3", GitCommit:"ac925eb7279f4a6955df663a0128044a8a6b7593", GitTreeState:"clean", GoVersion:"go1.13.6"}
[[email protected] etcd]# helm install etcd -n etcd-ha ./
Error: parse error at (etcd/charts/common/templates/_secrets.tpl:84): function "lookup" not defined
【 solve 】
I am upgrading directly to 3.5.4 It's solved
边栏推荐
猜你喜欢
None of the strongest kings in the monitoring industry!
The role of applet in industrial Internet
使用cpolar建立一个商业网站(1)
Jushan database was among the first batch of financial information innovation solutions!
10、 Process management
Self-supervised Heterogeneous Graph Neural Network with Co-contrastive Learning 论文阅读
Introduction and case analysis of Prophet model
Noninvasive and cuff free blood pressure measurement for telemedicine [translation]
Solve DoS attack production cases
二叉搜索树
随机推荐
DOM简要
Test 1234
Unity资源顺序加载的一个方法
Summary of performance knowledge points
C#/VB.NET 给PDF文档添加文本/图像水印
The role of applet in industrial Internet
Method of accessing mobile phone storage location permission under non root condition
Bonecp uses data sources
Huawei 0 foundation - image sorting
Handwritten online chat system (principle part 1)
测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
涂鸦智能在香港双重主板上市:市值112亿港元 年营收3亿美元
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
小程序在产业互联网中的作用
Xu Xiang's wife Ying Ying responded to the "stock review": she wrote it!
Interpreting cloud native technology
Binary search tree
helm部署etcd集群
CSRF漏洞分析
用于远程医疗的无创、无袖带血压测量【翻译】