当前位置:网站首页>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-r33harbocto.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

边栏推荐
- [Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
- Brief description of SQL optimization problems
- 使用map函数、split函数一行键入多个元素
- Example of implementing web server with stm32+enc28j60+uip protocol stack
- Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法
- AFNetworking框架_上传文件或图像server
- Certains marchés de l'emploi de Shanghai refusent d'embaucher des personnes qui se rétablissent positives à Xinguan
- First, look at K, an ugly number
- 安装及管理程序
- 上海部分招工市场对新冠阳性康复者拒绝招录
猜你喜欢
![[the 300th weekly match of leetcode]](/img/a7/16b491656863e2c423ff657ac6e9c5.png)
[the 300th weekly match of leetcode]

CSRF vulnerability analysis

None of the strongest kings in the monitoring industry!

重磅硬核 | 一文聊透对象在 JVM 中的内存布局,以及内存对齐和压缩指针的原理及应用

Docker安装Redis

Binary search tree

10、 Process management

Docker installation redis

Collection of penetration test information -- use with nmap and other tools

287. Find duplicates
随机推荐
With the implementation of MapReduce job de emphasis, a variety of output folders
Test 123
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
Splay
Noninvasive and cuff free blood pressure measurement for telemedicine [translation]
The role of applet in industrial Internet
Using block to realize the traditional values between two pages
解读云原生技术
POJ 2208 已知边四面体六个长度,计算体积
同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
echart简单组件封装
RedisSystemException:WRONGTYPE Operation against a key holding the wrong kind of value
测试行业的小伙伴,有问题可以找我哈。菜鸟一枚~
A method of sequentially loading Unity Resources
Deep circulation network long-term blood pressure prediction [translation]
C#/VB.NET 给PDF文档添加文本/图像水印
test about BinaryTree
POJ 2208 six lengths of tetrahedron are known, and the volume is calculated
Easy to use PDF to SVG program
SQL injection - access injection, access offset injection