k8s 命令操作

kubectl taint node k8s-master01 key1=value1:NoExecute 添加污点并驱逐pod

etcd 命令操作

etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key member list -w table
1102 alias etcdctl='etcdctl --endpoints=https://[127.0.0.1]:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt --key=/etc/kubernetes/pki/etcd/healthcheck-client.key'

etcdctl member list -w table 查询etc 节点

etcdctl get / --prefix --keys-only 查询 etcd 数据

etcdctl del /registry/events/dev/eureka-cluster-0.17261bc1cd7b20d5 删除etcd 数据

kubectl -n dev edit configmap devops-config 配置域名查询并编辑

etcd 脚本命令

#!/bin/bash
ETCD_VER=v3.3.4
ETCD_DIR=etcd-download
DOWNLOAD_URL=https://github.com/coreos/etcd/releases/download

# Download
mkdir ${ETCD_DIR}
cd ${ETCD_DIR}
wget ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz
tar -xzvf etcd-${ETCD_VER}-linux-amd64.tar.gz

# install
cd etcd-${ETCD_VER}-linux-amd64
cp etcdctl /usr/local/bin/

docker run -it test1:test1 /bin/sh

 

posted @ 2022-11-10 16:28  繁星下的晴空  阅读(45)  评论(0编辑  收藏  举报