模块一:工业物联环境构建
# 查看节点状态
kubectl get nodes
# 查看所有 pods 状态
kubectl get pods --all-namespaces
cd /data/script/
ls | grep install_openyurt_manager
# ./install_openyurt_manager_v5.sh是搜索到的脚本文件
./install_openyurt_manager_v5.sh > /data/logs/install_openyurt_manager.log 2>&1
2.2自动对了
3.3运行
kubectl get pods -A
启动edge01的虚拟机
cd /data/script
ls | grep yurtadm_join_edge01
# 这里的*根据上一个命令的结果来填写,后面这个VC...是master01虚拟机的密码
./yurtadm_join_edge01_*.sh VCtYS9aA#dB > /data/logs/yurtadm_join.log
# 实时查看安装日志更新
tail -f /data/logs/yurtadm_join.log
kubectl get nodes
kubectl get pods -A
edge02同上
kubectl edit cm -n kube-system kube-proxy
先按i,光标移动到这一行,按shift+#注释掉,按esc,按 : ,输入wq,按回车
kubectl delete pod --selector k8s-app=kube-proxy -n kube-system
kubectl get pods -A -owide | grep kube-proxy
# 下面两行是一条命令,csdn自动换行了
kubectl annotate svc kube-dns -n kube-system openyurt.io/topologyKeys='openyurt.io/nodepool'
kubectl get svc kube-dns -n kube-system -o yaml
cd /data/soft/openyurt/openyurt-helm-main
helm install yurt-iot-dock ./charts/yurt-iot-dockkubectl get crds -A
# 每一大段都全部复制
cat << EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1beta1
kind: NodePool
metadata:
name: beijing
spec:
type: Cloud
EOF
cat << EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1beta1
kind: NodePool
metadata:
name: hangzhou01
spec:
type: Edge
EOF
cat << EOF | kubectl apply -f -
apiVersion: apps.openyurt.io/v1beta1
kind: NodePool
metadata:
name: hangzhou02
spec:
type: Edge
EOF
kubectl label node k8s-master01 apps.openyurt.io/nodepool=beijing
kubectl label node yurt-edge01 apps.openyurt.io/nodepool=hangzhou01
kubectl label node yurt-edge02 apps.openyurt.io/nodepool=hangzhou02
pass