代码拉取完成,页面将自动刷新
同步操作将从 徐晓伟/k8s.sh 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
stages:
# 准备系统环境
- env
# 内核升级
- kernel-update
# 开机
- power-up
# 安装 k8s
- install
# 测试 k8s
- test
# 代码同步
- sync
centos-7.3:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_3_QEMU_ID/snapshot/$CENTOS_7_3_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_3_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
echo $response
lock=$(echo "$response" | jq -r '.data.lock')
if [ "$lock" = "rollback" ]; then
echo "正在还原中";
sleep 3;
else
echo "还原完成";
break
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_3_IP 22; then
echo "$CENTOS_7_3_IP 正在运行"
else
echo "$CENTOS_7_3_IP 已关机"
break
fi
sleep 3
done
# 休眠一段时间,等待服务器完全还原/关机
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_3_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_3_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "$CENTOS_7_3_IP 已运行";
break
else
echo "$CENTOS_7_3_IP 等待运行";
sleep 3;
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_3_IP 22; then
echo "$CENTOS_7_3_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.3/latest
centos-7.3:kernel-update:
stage: kernel-update
needs:
- centos-7.3:env
script:
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
# 升级内核
- yum -y install kernel
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 升级完成再次查看内核(需要重启才能生效)
- uname -a
# 1分钟后重启
# 升级内核可以在重启后自动生效
- shutdown -r +1
tags:
- ssh-centos-7.3
only:
- test/machine/centos-7.3/latest
centos-7.3:power-up:
stage: power-up
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
needs:
- centos-7.3:kernel-update
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
- |
while true; do
if nc -z -w 1 $CENTOS_7_3_IP 22; then
echo "$CENTOS_7_3_IP 正在运行,等待关机"
else
echo "$CENTOS_7_3_IP 已关机"
break
fi
sleep 3
done
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_3_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
if nc -z -w 1 $CENTOS_7_3_IP 22; then
echo "$CENTOS_7_3_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.3/latest
centos-7.3:
stage: install
needs:
- centos-7.3:power-up
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_3_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_3_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.3
only:
- test/machine/centos-7.3/latest
centos-7.3:test:
stage: test
needs:
- centos-7.3
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.3
only:
- test/machine/centos-7.3/latest
centos-7.4:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_4_QEMU_ID/snapshot/$CENTOS_7_4_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_4_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
echo $response
lock=$(echo "$response" | jq -r '.data.lock')
if [ "$lock" = "rollback" ]; then
echo "正在还原中";
sleep 3;
else
echo "还原完成";
break
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_4_IP 22; then
echo "$CENTOS_7_4_IP 正在运行"
else
echo "$CENTOS_7_4_IP 已关机"
break
fi
sleep 3
done
# 休眠一段时间,等待服务器完全还原/关机
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_4_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_4_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "$CENTOS_7_4_IP 已运行";
break
else
echo "$CENTOS_7_4_IP 等待运行";
sleep 3;
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_4_IP 22; then
echo "$CENTOS_7_4_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.4/latest
centos-7.4:kernel-update:
stage: kernel-update
needs:
- centos-7.4:env
script:
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
# 升级内核
- yum -y install kernel
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 升级完成再次查看内核(需要重启才能生效)
- uname -a
# 1分钟后重启
# 升级内核可以在重启后自动生效
- shutdown -r +1
tags:
- ssh-centos-7.4
only:
- test/machine/centos-7.4/latest
centos-7.4:power-up:
stage: power-up
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
needs:
- centos-7.4:kernel-update
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
- |
while true; do
if nc -z -w 1 $CENTOS_7_4_IP 22; then
echo "$CENTOS_7_4_IP 正在运行,等待关机"
else
echo "$CENTOS_7_4_IP 已关机"
break
fi
sleep 3
done
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_4_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
if nc -z -w 1 $CENTOS_7_4_IP 22; then
echo "$CENTOS_7_4_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.4/latest
centos-7.4:
stage: install
needs:
- centos-7.4:power-up
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_4_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_4_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.4
only:
- test/machine/centos-7.4/latest
centos-7.4:test:
stage: test
needs:
- centos-7.4
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.4
only:
- test/machine/centos-7.4/latest
centos-7.5:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_5_QEMU_ID/snapshot/$CENTOS_7_5_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_5_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
echo $response
lock=$(echo "$response" | jq -r '.data.lock')
if [ "$lock" = "rollback" ]; then
echo "正在还原中";
sleep 3;
else
echo "还原完成";
break
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_5_IP 22; then
echo "$CENTOS_7_5_IP 正在运行"
else
echo "$CENTOS_7_5_IP 已关机"
break
fi
sleep 3
done
# 休眠一段时间,等待服务器完全还原/关机
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_5_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_5_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "$CENTOS_7_5_IP 已运行";
break
else
echo "$CENTOS_7_5_IP 等待运行";
sleep 3;
fi
done
- |
while true; do
if nc -z -w 1 $CENTOS_7_5_IP 22; then
echo "$CENTOS_7_5_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.5/latest
centos-7.5:kernel-update:
stage: kernel-update
needs:
- centos-7.5:env
script:
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
# 升级内核
- yum -y install kernel
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 升级完成再次查看内核(需要重启才能生效)
- uname -a
# 1分钟后重启
# 升级内核可以在重启后自动生效
- shutdown -r +1
tags:
- ssh-centos-7.5
only:
- test/machine/centos-7.5/latest
centos-7.5:power-up:
stage: power-up
image: xuxiaoweicomcn/debian:curl-jq-netcat-openbsd
needs:
- centos-7.5:kernel-update
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
- |
while true; do
if nc -z -w 1 $CENTOS_7_5_IP 22; then
echo "$CENTOS_7_5_IP 正在运行,等待关机"
else
echo "$CENTOS_7_5_IP 已关机"
break
fi
sleep 3
done
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_5_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
if nc -z -w 1 $CENTOS_7_5_IP 22; then
echo "$CENTOS_7_5_IP 正在运行"
break
fi
sleep 3
done
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.5/latest
centos-7.5:
stage: install
needs:
- centos-7.5:power-up
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
# 查看系统版本
- cat /etc/redhat-release
- cat /etc/os-release
# 查看内核
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_5_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_5_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.5
only:
- test/machine/centos-7.5/latest
centos-7.5:test:
stage: test
needs:
- centos-7.5
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.5
only:
- test/machine/centos-7.5/latest
centos-7.6:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_6_QEMU_ID/snapshot/$CENTOS_7_6_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_6_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_6_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.6/latest
centos-7.6:
stage: install
needs:
- centos-7.6:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_6_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_6_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.6
only:
- test/machine/centos-7.6/latest
centos-7.6:test:
stage: test
needs:
- centos-7.6
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.6
only:
- test/machine/centos-7.6/latest
centos-7.7:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_7_QEMU_ID/snapshot/$CENTOS_7_7_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_7_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_7_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.7/latest
centos-7.7:
stage: install
needs:
- centos-7.7:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_7_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_7_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.7
only:
- test/machine/centos-7.7/latest
centos-7.7:test:
stage: test
needs:
- centos-7.7
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.7
only:
- test/machine/centos-7.7/latest
centos-7.8:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_8_QEMU_ID/snapshot/$CENTOS_7_8_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_8_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_8_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.8/latest
centos-7.8:
stage: install
needs:
- centos-7.8:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_8_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_8_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.8
only:
- test/machine/centos-7.8/latest
centos-7.8:test:
stage: test
needs:
- centos-7.8
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.8
only:
- test/machine/centos-7.8/latest
centos-7.9:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_9_QEMU_ID/snapshot/$CENTOS_7_9_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_7_9_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_7_9_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-7.9/latest
centos-7.9:
stage: install
needs:
- centos-7.9:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_7_9_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_7_9_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-7.9
only:
- test/machine/centos-7.9/latest
centos-7.9:test:
stage: test
needs:
- centos-7.9
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-7.9
only:
- test/machine/centos-7.9/latest
centos-8.0:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_0_QEMU_ID/snapshot/$CENTOS_8_0_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_0_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_0_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.0/latest
centos-8.0:
stage: install
needs:
- centos-8.0:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_0_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_0_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.0
only:
- test/machine/centos-8.0/latest
centos-8.0:test:
stage: test
needs:
- centos-8.0
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.0
only:
- test/machine/centos-8.0/latest
centos-8.1:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_1_QEMU_ID/snapshot/$CENTOS_8_1_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_1_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_1_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.1/latest
centos-8.1:
stage: install
needs:
- centos-8.1:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_1_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_1_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.1
only:
- test/machine/centos-8.1/latest
centos-8.1:test:
stage: test
needs:
- centos-8.1
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.1
only:
- test/machine/centos-8.1/latest
centos-8.2:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_2_QEMU_ID/snapshot/$CENTOS_8_2_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_2_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_2_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.2/latest
centos-8.2:
stage: install
needs:
- centos-8.2:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_2_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_2_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.2
only:
- test/machine/centos-8.2/latest
centos-8.2:test:
stage: test
needs:
- centos-8.2
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.2
only:
- test/machine/centos-8.2/latest
centos-8.3:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_3_QEMU_ID/snapshot/$CENTOS_8_3_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_3_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_3_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.3/latest
centos-8.3:
stage: install
needs:
- centos-8.3:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_3_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_3_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.3
only:
- test/machine/centos-8.3/latest
centos-8.3:test:
stage: test
needs:
- centos-8.3
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.3
only:
- test/machine/centos-8.3/latest
centos-8.4:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_4_QEMU_ID/snapshot/$CENTOS_8_4_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_4_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_4_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.4/latest
centos-8.4:
stage: install
needs:
- centos-8.4:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_4_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_4_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.4
only:
- test/machine/centos-8.4/latest
centos-8.4:test:
stage: test
needs:
- centos-8.4
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.4
only:
- test/machine/centos-8.4/latest
centos-8.5:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_5_QEMU_ID/snapshot/$CENTOS_8_5_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$CENTOS_8_5_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$CENTOS_8_5_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/centos-8.5/latest
centos-8.5:
stage: install
needs:
- centos-8.5:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$CENTOS_8_5_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$CENTOS_8_5_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-centos-8.5
only:
- test/machine/centos-8.5/latest
centos-8.5:test:
stage: test
needs:
- centos-8.5
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-centos-8.5
only:
- test/machine/centos-8.5/latest
anolisos-7.7:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_7_7_QEMU_ID/snapshot/$ANOLISOS_7_7_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_7_7_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_7_7_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-7.7/latest
anolisos-7.7:
stage: install
needs:
- anolisos-7.7:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_7_7_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_7_7_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-7.7
only:
- test/machine/anolisos-7.7/latest
anolisos-7.7:test:
stage: test
needs:
- anolisos-7.7
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-7.7
only:
- test/machine/anolisos-7.7/latest
anolisos-7.9:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_7_9_QEMU_ID/snapshot/$ANOLISOS_7_9_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_7_9_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_7_9_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-7.9/latest
anolisos-7.9:
stage: install
needs:
- anolisos-7.9:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_7_9_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_7_9_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-7.9
only:
- test/machine/anolisos-7.9/latest
anolisos-7.9:test:
stage: test
needs:
- anolisos-7.9
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-7.9
only:
- test/machine/anolisos-7.9/latest
anolisos-8.2:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_2_QEMU_ID/snapshot/$ANOLISOS_8_2_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_2_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_8_2_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-8.2/latest
anolisos-8.2:
stage: install
needs:
- anolisos-8.2:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_8_2_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_8_2_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-8.2
only:
- test/machine/anolisos-8.2/latest
anolisos-8.2:test:
stage: test
needs:
- anolisos-8.2
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-8.2
only:
- test/machine/anolisos-8.2/latest
anolisos-8.4:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_4_QEMU_ID/snapshot/$ANOLISOS_8_4_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_4_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_8_4_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-8.4/latest
anolisos-8.4:
stage: install
needs:
- anolisos-8.4:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_8_4_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_8_4_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-8.4
only:
- test/machine/anolisos-8.4/latest
anolisos-8.4:test:
stage: test
needs:
- anolisos-8.4
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-8.4
only:
- test/machine/anolisos-8.4/latest
anolisos-8.6:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_6_QEMU_ID/snapshot/$ANOLISOS_8_6_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_6_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_8_6_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-8.6/latest
anolisos-8.6:
stage: install
needs:
- anolisos-8.6:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/redhat-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_8_6_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_8_6_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-8.6
only:
- test/machine/anolisos-8.6/latest
anolisos-8.6:test:
stage: test
needs:
- anolisos-8.6
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-8.6
only:
- test/machine/anolisos-8.6/latest
anolisos-8.8:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_8_QEMU_ID/snapshot/$ANOLISOS_8_8_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_8_8_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_8_8_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-8.8/latest
anolisos-8.8:
stage: install
needs:
- anolisos-8.8:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/anolis-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_8_8_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_8_8_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-8.8
only:
- test/machine/anolisos-8.8/latest
anolisos-8.8:test:
stage: test
needs:
- anolisos-8.8
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-8.8
only:
- test/machine/anolisos-8.8/latest
anolisos-23:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_23_QEMU_ID/snapshot/$ANOLISOS_23_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$ANOLISOS_23_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$ANOLISOS_23_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/anolisos-23/latest
anolisos-23:
stage: install
needs:
- anolisos-23:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/anolis-release
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$ANOLISOS_23_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$ANOLISOS_23_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-anolisos-23
only:
- test/machine/anolisos-23/latest
anolisos-23:test:
stage: test
needs:
- anolisos-23
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-anolisos-23
only:
- test/machine/anolisos-23/latest
uos-20-1060e:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UOS_20_1060E_QEMU_ID/snapshot/$UOS_20_1060E_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UOS_20_1060E_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$UOS_20_1060E_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/uos-20-1060e/latest
uos-20-1060e:
stage: install
needs:
- uos-20-1060e:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/os-version
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$UOS_20_1060E_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$UOS_20_1060E_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-uos-20-1060e
only:
- test/machine/uos-20-1060e/latest
uos-20-1060e:test:
stage: test
needs:
- uos-20-1060e
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-uos-20-1060e
only:
- test/machine/uos-20-1060e/latest
ubuntu-23.04:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UBUNTU_23_04_QEMU_ID/snapshot/$UBUNTU_23_04_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UBUNTU_23_04_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$UBUNTU_23_04_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/ubuntu-23.04/latest
ubuntu-23.04:
stage: install
needs:
- ubuntu-23.04:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/debian_version
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$UBUNTU_23_04_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$UBUNTU_23_04_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei && ./check.sh"
tags:
- ssh-ubuntu-23.04
only:
- test/machine/ubuntu-23.04/latest
ubuntu-23.04:test:
stage: test
needs:
- ubuntu-23.04
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-ubuntu-23.04
only:
- test/machine/ubuntu-23.04/latest
ubuntu-22.10:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UBUNTU_22_10_QEMU_ID/snapshot/$UBUNTU_22_10_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$UBUNTU_22_10_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$UBUNTU_22_10_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/ubuntu-22.10/latest
ubuntu-22.10:
stage: install
needs:
- ubuntu-22.10:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/debian_version
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$UBUNTU_22_10_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$UBUNTU_22_10_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei docker-ce-install-skip && ./check.sh"
tags:
- ssh-ubuntu-22.10
only:
- test/machine/ubuntu-22.10/latest
ubuntu-22.10:test:
stage: test
needs:
- ubuntu-22.10
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-ubuntu-22.10
only:
- test/machine/ubuntu-22.10/latest
openKylin-1.0:env:
stage: env
image: xuxiaoweicomcn/debian:curl-jq
script:
# 获取凭证
- response=$(curl -k --request POST --url "$PVE_ADDRESS/api2/json/access/ticket?username=$PVE_USERNAME&password=$PVE_PASSWORD")
# 解析凭证
- token=$(echo $response | jq -r '.data.CSRFPreventionToken')
- ticket=$(echo $response | jq -r '.data.ticket')
# 还原服务器快照
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$OPENKYLIN_1_0_QEMU_ID/snapshot/$OPENKYLIN_1_0_SNAPSHOT/rollback" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
# 休眠一段时间,等待服务器还原快照
- sleep 30
# 开机
- curl -k --request POST --url "$PVE_ADDRESS/api2/extjs/nodes/pve/qemu/$OPENKYLIN_1_0_QEMU_ID/status/start" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token"
- |
while true; do
# 查看状态
response=$(curl -k --request GET --url "$PVE_ADDRESS/api2/json/nodes/pve/qemu/$OPENKYLIN_1_0_QEMU_ID/status/current" --header "Cookie:PVEAuthCookie=$ticket" --header "CSRFPreventionToken:$token")
status=$(echo "$response" | jq -r '.data.status')
if [ "$status" = "running" ]; then
echo "服务器已运行";
break
else
echo '等待服务器运行';
sleep 1;
fi
done
- echo '等待一段时间,待服务器完全启动'
- sleep 30
tags:
- plugin-kubernetes
only:
- test/machine/openKylin-1.0/latest
openKylin-1.0:
stage: install
needs:
- openKylin-1.0:env
variables:
KUBECONFIG: /etc/kubernetes/admin.conf
script:
- set -e
- cat /etc/kylin-build
- cat /etc/os-release
- uname -a
- cat /etc/hosts
- echo "$OPENKYLIN_1_0_IP" $(hostname) >> /etc/hosts
- cat /etc/hosts
- chmod +x k8s.sh
- chmod +x check.sh
- echo "$OPENKYLIN_1_0_PASSWORD" | script -qec "sudo -S ./k8s.sh kubernetes-taint calico-mirrors=registry.jihulab.com/xuxiaowei-jihu/xuxiaowei-cloud/spring-cloud-xuxiaowei docker-ce-install-skip && ./check.sh"
tags:
- ssh-openKylin-1.0
only:
- test/machine/openKylin-1.0/latest
openKylin-1.0:test:
stage: test
needs:
- openKylin-1.0
script:
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- cat test-httpd-deployment.yaml
- kubectl apply -f test-httpd-deployment.yaml
- kubectl get svc -o wide
- kubectl get nodes -o wide
- kubectl get pod --all-namespaces -o wide
- kubectl wait --for=condition=Ready --all pods --all-namespaces --timeout=600s
- chmod +x check.sh
- ./check.sh
- curl http://127.0.0.1:30080
tags:
- ssh-openKylin-1.0
only:
- test/machine/openKylin-1.0/latest
# 嵌入
include:
# 同步代码
- /sync.yml
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。