Stabilize CI Kaniko tag and keep Harbor free of egress proxy.
Build and Deploy Platform / build-and-deploy (push) Failing after 3m18s
Build and Deploy Platform / build-and-deploy (push) Failing after 3m18s
Use the seeded kaniko v1.27.6-debug image, retry npm ci, and push via harbor-core without HTTP_PROXY so Harbor UI metadata and blob uploads keep working. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -102,7 +102,10 @@ jobs:
|
|||||||
apk add --no-cache git &&
|
apk add --no-cache git &&
|
||||||
git clone --depth=1 --branch main http://oauth2:${GITEA_TOKEN}@${GITEA_HOST}/${REPO_PATH} /workspace &&
|
git clone --depth=1 --branch main http://oauth2:${GITEA_TOKEN}@${GITEA_HOST}/${REPO_PATH} /workspace &&
|
||||||
cd /workspace/backend &&
|
cd /workspace/backend &&
|
||||||
npm ci --legacy-peer-deps &&
|
npm config set fetch-retries 5 &&
|
||||||
|
npm config set fetch-retry-mintimeout 20000 &&
|
||||||
|
npm config set fetch-retry-maxtimeout 120000 &&
|
||||||
|
(npm ci --legacy-peer-deps || (echo 'npm ci failed, retrying...' && sleep 5 && npm ci --legacy-peer-deps) || (echo 'npm ci failed again, retrying...' && sleep 10 && npm ci --legacy-peer-deps)) &&
|
||||||
npm run test -- --ci --runInBand
|
npm run test -- --ci --runInBand
|
||||||
resources:
|
resources:
|
||||||
requests: { cpu: 500m, memory: 1Gi }
|
requests: { cpu: 500m, memory: 1Gi }
|
||||||
@@ -159,7 +162,7 @@ jobs:
|
|||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
containers:
|
containers:
|
||||||
- name: kaniko
|
- name: kaniko
|
||||||
image: ${PULL_REGISTRY}/${PROJECT}/kaniko-executor:v1.23.2
|
image: ${PULL_REGISTRY}/${PROJECT}/kaniko-executor:v1.27.6-debug
|
||||||
# Base image (node:24-alpine) is seeded in Harbor abrban/ — avoids
|
# Base image (node:24-alpine) is seeded in Harbor abrban/ — avoids
|
||||||
# flaky direct pulls from docker.io through the egress proxy.
|
# flaky direct pulls from docker.io through the egress proxy.
|
||||||
envFrom:
|
envFrom:
|
||||||
@@ -224,7 +227,7 @@ jobs:
|
|||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
containers:
|
containers:
|
||||||
- name: kaniko
|
- name: kaniko
|
||||||
image: ${PULL_REGISTRY}/${PROJECT}/kaniko-executor:v1.23.2
|
image: ${PULL_REGISTRY}/${PROJECT}/kaniko-executor:v1.27.6-debug
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: registry-egress-proxy
|
name: registry-egress-proxy
|
||||||
|
|||||||
@@ -22,16 +22,17 @@ echo "==> [2/4] Scaling old registry deployment down (rollback-friendly)"
|
|||||||
kubectl -n cloudhost scale deploy/registry --replicas=0 || true
|
kubectl -n cloudhost scale deploy/registry --replicas=0 || true
|
||||||
|
|
||||||
echo "==> [3/4] Installing Harbor"
|
echo "==> [3/4] Installing Harbor"
|
||||||
HTTP_PROXY="$(kubectl -n cloudhost get secret registry-egress-proxy -o jsonpath='{.data.HTTP_PROXY}' | base64 -d)"
|
# IMPORTANT: do NOT set HTTP(S)_PROXY on harbor-core for in-cluster registry
|
||||||
HTTPS_PROXY="$(kubectl -n cloudhost get secret registry-egress-proxy -o jsonpath='{.data.HTTPS_PROXY}' | base64 -d)"
|
# traffic. Egress proxy on core causes 502 on blob uploads via harbor-core
|
||||||
NO_PROXY="$(kubectl -n cloudhost get secret registry-egress-proxy -o jsonpath='{.data.NO_PROXY}' | base64 -d)"
|
# (Kaniko/skopeo push fails; Harbor UI metadata never appears).
|
||||||
|
# Keep proxy empty here; Harbor proxy-cache projects can still use project-level
|
||||||
|
# proxy settings when needed. Expand noProxy for safety if proxy is re-enabled.
|
||||||
TMP_PROXY_VALUES="$(mktemp)"
|
TMP_PROXY_VALUES="$(mktemp)"
|
||||||
cat > "${TMP_PROXY_VALUES}" <<EOF
|
cat > "${TMP_PROXY_VALUES}" <<EOF
|
||||||
proxy:
|
proxy:
|
||||||
httpProxy: "${HTTP_PROXY}"
|
httpProxy: ""
|
||||||
httpsProxy: "${HTTPS_PROXY}"
|
httpsProxy: ""
|
||||||
noProxy: "${NO_PROXY}"
|
noProxy: "harbor-core,harbor-jobservice,harbor-database,harbor-registry,harbor-portal,.svc,.cluster.local,10.43.0.0/16,127.0.0.1,localhost,registry.abrban.com"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
helm upgrade --install harbor harbor/harbor \
|
helm upgrade --install harbor harbor/harbor \
|
||||||
@@ -43,6 +44,9 @@ helm upgrade --install harbor harbor/harbor \
|
|||||||
|
|
||||||
rm -f "${TMP_PROXY_VALUES}" || true
|
rm -f "${TMP_PROXY_VALUES}" || true
|
||||||
|
|
||||||
echo "==> [4/4] Done"
|
echo "==> [4/4] Apply registry ingress path split (proxy-* → harbor-core)"
|
||||||
|
kubectl apply -f "$(dirname "$0")/../../../gitops/harbor/registry-ingress.yaml"
|
||||||
|
|
||||||
|
echo "==> Done"
|
||||||
kubectl -n cloudhost get ingress | grep -n registry || true
|
kubectl -n cloudhost get ingress | grep -n registry || true
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
containers:
|
containers:
|
||||||
- name: kaniko
|
- name: kaniko
|
||||||
image: registry.abrban.com/abrban/kaniko-executor:v1.23.2
|
image: registry.abrban.com/abrban/kaniko-executor:v1.27.6-debug
|
||||||
env:
|
env:
|
||||||
- name: IMAGE_TAG
|
- name: IMAGE_TAG
|
||||||
value: bootstrap
|
value: bootstrap
|
||||||
@@ -40,7 +40,10 @@ spec:
|
|||||||
- -ec
|
- -ec
|
||||||
- |
|
- |
|
||||||
set -eux
|
set -eux
|
||||||
REG="harbor-registry.cloudhost.svc.cluster.local:5000/abrban"
|
REG="harbor-core.cloudhost.svc.cluster.local/abrban"
|
||||||
|
unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy || true
|
||||||
|
export NO_PROXY="harbor-core.cloudhost.svc.cluster.local,harbor-registry.cloudhost.svc.cluster.local,registry.abrban.com,10.43.0.0/16,.svc,.cluster.local"
|
||||||
|
export no_proxy="$NO_PROXY"
|
||||||
/kaniko/executor \
|
/kaniko/executor \
|
||||||
--dockerfile=/workspace/backend/Dockerfile \
|
--dockerfile=/workspace/backend/Dockerfile \
|
||||||
--context=dir:///workspace/backend \
|
--context=dir:///workspace/backend \
|
||||||
@@ -55,6 +58,14 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
|
- name: docker-config
|
||||||
|
mountPath: /kaniko/.docker
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: docker-config
|
||||||
|
secret:
|
||||||
|
secretName: kaniko-harbor-auth
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
|
|||||||
@@ -40,13 +40,17 @@ spec:
|
|||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
containers:
|
containers:
|
||||||
- name: kaniko
|
- name: kaniko
|
||||||
image: registry.abrban.com/abrban/kaniko-executor:v1.23.2
|
image: registry.abrban.com/abrban/kaniko-executor:v1.27.6-debug
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -ec
|
- -ec
|
||||||
- |
|
- |
|
||||||
set -eux
|
set -eux
|
||||||
REG="harbor-registry.cloudhost.svc.cluster.local:5000/abrban"
|
# Push via harbor-core so artifacts appear in Harbor UI
|
||||||
|
REG="harbor-core.cloudhost.svc.cluster.local/abrban"
|
||||||
|
unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy || true
|
||||||
|
export NO_PROXY="harbor-core.cloudhost.svc.cluster.local,harbor-registry.cloudhost.svc.cluster.local,registry.abrban.com,10.43.0.0/16,.svc,.cluster.local"
|
||||||
|
export no_proxy="$NO_PROXY"
|
||||||
/kaniko/executor \
|
/kaniko/executor \
|
||||||
--dockerfile=/workspace/backend/Dockerfile \
|
--dockerfile=/workspace/backend/Dockerfile \
|
||||||
--context=dir:///workspace/backend \
|
--context=dir:///workspace/backend \
|
||||||
@@ -62,9 +66,17 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
mountPath: /workspace
|
mountPath: /workspace
|
||||||
|
- name: docker-config
|
||||||
|
mountPath: /kaniko/.docker
|
||||||
volumes:
|
volumes:
|
||||||
- name: workspace
|
- name: workspace
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: docker-config
|
||||||
|
secret:
|
||||||
|
secretName: kaniko-harbor-auth
|
||||||
|
items:
|
||||||
|
- key: .dockerconfigjson
|
||||||
|
path: config.json
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "==> Waiting for build job..."
|
echo "==> Waiting for build job..."
|
||||||
|
|||||||
Reference in New Issue
Block a user