Skip to content

Commit b34f063

Browse files
committed
fix(ci): pre-load GHCR images into kind to avoid ImagePullBackOff
- docker login ghcr.io → docker pull → kind load docker-image - kind-conformance overlay sets imagePullPolicy: IfNotPresent - Fixes: kind cluster cannot pull from private GHCR without auth
1 parent e297e47 commit b34f063

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/conformance.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ jobs:
3535
done
3636
kubectl wait --for=condition=established crd/gatewayclasses.gateway.networking.k8s.io --timeout=60s
3737
38+
- name: Pre-load images into kind
39+
run: |
40+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
41+
for img in nantian-controlplane dataplane dashboard; do
42+
docker pull "ghcr.io/nantian-gw/${img}:latest"
43+
kind load docker-image "ghcr.io/nantian-gw/${img}:latest" --name conformance
44+
done
45+
3846
- name: Deploy nantian-gw
3947
run: |
4048
kubectl apply -k deploy/kubernetes/overlays/kind-conformance

.github/workflows/e2e.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
done
3131
kubectl wait --for=condition=established crd/gatewayclasses.gateway.networking.k8s.io --timeout=60s
3232
33+
- name: Pre-load images into kind
34+
run: |
35+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
36+
for img in nantian-controlplane dataplane dashboard; do
37+
docker pull "ghcr.io/nantian-gw/${img}:latest"
38+
kind load docker-image "ghcr.io/nantian-gw/${img}:latest" --name e2e
39+
done
40+
3341
- name: Deploy nantian-gw
3442
run: |
3543
kubectl apply -k deploy/kubernetes/overlays/kind-conformance

deploy/kubernetes/overlays/kind-conformance/kustomization.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ images:
1515
newName: ghcr.io/nantian-gw/dashboard
1616
newTag: latest
1717

18+
patches:
19+
- target:
20+
kind: Deployment
21+
patch: |-
22+
- op: replace
23+
path: /spec/template/spec/containers/0/imagePullPolicy
24+
value: IfNotPresent
25+
1826
generatorOptions:
1927
disableNameSuffixHash: true
2028

0 commit comments

Comments
 (0)