# 导出资源
# 工作负载
kubectl get deploy -n yxt -o yaml > yxt_deploy.yaml
kubectl get deployments -n yxt -o yaml > yxt_deployments.yaml
# 服务
kubectl get service -n yxt -o yaml > yxt_service.yaml
# 路由
kubectl get ingress -n yxt -o yaml > yxt_ingress.yaml
# 配置
kubectl get cm -n yxt -o yaml > yxt_cm.yaml
kubectl get configmaps -n yxt -o yaml > yxt_configmaps.yaml
# 密钥
kubectl get secrets -n yxt -o yaml > yxt_secrets.yaml
# 导入资源
kubectl create -f yxt_deployment.yaml
# 如果需要一个一个导出
#!/bin/sh
rm -rf yaml/*.yaml
for a in $(kubectl get deploy -n yst |grep -v NAME |awk '{print $1}')
do
kubectl get deploy $a -n yst -o yaml > "yaml/$a.yaml"
done