fix: 用 alpine/k8s 替换无 shell 的 kubectl 镜像;冒烟测试改用 service DNS
This commit is contained in:
Vendored
+4
-6
@@ -15,7 +15,7 @@ spec:
|
|||||||
- name: docker-config
|
- name: docker-config
|
||||||
mountPath: /kaniko/.docker
|
mountPath: /kaniko/.docker
|
||||||
- name: kubectl
|
- name: kubectl
|
||||||
image: rancher/kubectl:v1.34.9
|
image: alpine/k8s:1.34.12
|
||||||
command: ["sleep"]
|
command: ["sleep"]
|
||||||
args: ["999999"]
|
args: ["999999"]
|
||||||
volumes:
|
volumes:
|
||||||
@@ -92,11 +92,9 @@ spec:
|
|||||||
sh '''
|
sh '''
|
||||||
set -e
|
set -e
|
||||||
for i in $(seq 1 20); do
|
for i in $(seq 1 20); do
|
||||||
CODE=$(kubectl -n apps run smoke-$$ --rm -i --restart=Never \
|
CODE=$(curl -s -o /dev/null -w "%{http_code}" http://blog.apps.svc.cluster.local/healthz || true)
|
||||||
--image=curlimages/curl:8.10.1 --quiet -- \
|
if [ "$CODE" = "200" ]; then echo "健康检查通过 (第 $i 次)"; exit 0; fi
|
||||||
-s -o /dev/null -w "%{http_code}" http://blog/healthz 2>/dev/null || echo 000)
|
echo "第 $i 次: $CODE"; sleep 3
|
||||||
if [ "$CODE" = "200" ]; then echo "健康检查通过"; exit 0; fi
|
|
||||||
echo "第 $i 次: $CODE, 等待中..."; sleep 3
|
|
||||||
done
|
done
|
||||||
echo "健康检查失败"; exit 1
|
echo "健康检查失败"; exit 1
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user