devops-etcdctl
时间: 2023-11-26 15:48:04 浏览: 97
devops-etcdctl是一个命令行工具,用于与etcd集群进行交互。以下是一些常用的devops-etcdctl命令:
1. 查看etcd集群节点状态:
```shell
etcdctl endpoint status -w table
```
2. 检查etcd集群健康状态:
```shell
etcdctl endpoint health -w table
```
3. 获取etcd中的键值:
```shell
etcdctl get <key>
```
4. 设置etcd中的键值:
```shell
etcdctl put <key> <value>
```
5. 删除etcd中的键值:
```shell
etcdctl del <key>
```
6. 监听etcd中的键值变化:
```shell
etcdctl watch <key>
```
7. 创建Pod使用pvc挂载cephfs数据盘:
```yaml
cat test-pvc-cephfs.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
name: nginx-pod
spec:
containers:
- name: nginx-pod
image: nginx:alpine
ports:
- name: web
containerPort: 80
volumeMounts:
- name: cephfs
mountPath: /usr/share/nginx/html
volumes:
- name: cephfs
persistentVolumeClaim:
claimName: cephfs-claim
```
```shell
kubectl create -f test-pvc-cephfs.yaml
```
阅读全文