k8s知识

复制命令

宿主机到pod(单容器)

kubectl cp app-jognx-redis4-ha-server.yaml  -n iot hub12345-iop-dm-replicaset-0:/iot/

统一在   cd /opt/iot 

删除容器,自动创建容器

 dm

更新dm和acl包

 dm源文件chart包
 

cd /var/lib/helmrepo/

helm package --save=false ./dm

helm repo index --url=http://10.17.1.160:8879/charts /var/lib/helmrepo/

helm repo update

 cd /opt/iot

docker build -t registry.iot.com:5000/library/iot/dm-and-acl:0.0.1 .

docker push registry.iot.com:5000/library/iot/dm-and-acl:0.0.1

路由

 kubectl get virtualservice trident-web -n istio-system -oyaml 

 

强制删除pod

kubectl delete pod hub-test0707-emqtt-mysql-0 -n yanhua --force --grace-period=0
 

测试helm命令

helm install --name=yuanqianqian4 --namespace=iop . --debug --dry-run
 

 增加rolebinding

kubectl get rolebinding -n yanhua
kubectl edit  rolebinding trident-yanhua-rolebinding -n yanhua

 更换redis,需要环境支持 新建 clusterrole

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: rds-resources-editor
rules:
- apiGroups:
- ''
resources:
- pods
verbs:
- '*'

 kubectl create -f rds-cluesterrole.yml

原文地址:https://www.cnblogs.com/myfrank/p/9010478.html