当前位置:网站首页>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
边栏推荐
猜你喜欢
手写一个的在线聊天系统(原理篇1)
Medical image segmentation
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
Tree-LSTM的一些理解以及DGL代码实现
Deep circulation network long-term blood pressure prediction [translation]
徐翔妻子应莹回应“股评”:自己写的!
Binary search tree
C#/VB. Net to add text / image watermarks to PDF documents
Human bone point detection: top-down (part of the theory)
helm部署etcd集群
随机推荐
【中山大学】考研初试复试资料分享
Bonecp uses data sources
Unity资源顺序加载的一个方法
人体骨骼点检测:自顶向下(部分理论)
图片缩放中心
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
Collection of penetration test information -- use with nmap and other tools
A method of sequentially loading Unity Resources
当保存参数使用结构体时必备的开发技巧方式
上海部分招工市場對新冠陽性康複者拒絕招錄
AFNetworking框架_上传文件或图像server
随着MapReduce job实现去加重,多种输出文件夹
Huawei 0 foundation - image sorting
Docker安装Redis
helm部署etcd集群
Tree-LSTM的一些理解以及DGL代码实现
Test 123
celery最佳实践
Using block to realize the traditional values between two pages
C#/VB. Net to add text / image watermarks to PDF documents