Skip to content

Commit 15c2e44

Browse files
committed
Moved to github container registry
Signed-off-by: Roberto Bonafiglia <[email protected]>
1 parent d630e74 commit 15c2e44

File tree

8 files changed

+81
-17
lines changed

8 files changed

+81
-17
lines changed

.github/workflows/release.yml

+64
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ env:
88
GO_VERSION: "1.23"
99
LINUX_ARCHES: "amd64 arm arm64 s390x ppc64le riscv64"
1010
REPOSITORY: flannel/flannel
11+
IMAGE_NAME: flannel-io/flannel
12+
REGISTRY: ghcr.io
1113

1214
jobs:
1315
build-and-push-images:
@@ -47,6 +49,7 @@ jobs:
4749
type=ref,event=tag
4850
4951
- name: Log in to Docker Hub
52+
if: github.repository_owner == 'flannel-io' && success()
5053
uses: docker/login-action@v3
5154
with:
5255
username: ${{ secrets.DOCKER_USERNAME }}
@@ -63,6 +66,67 @@ jobs:
6366
tags: ${{ steps.meta.outputs.tags }}
6467
build-args: TAG=${{ env.GIT_TAG }}
6568

69+
build-and-push-images-github-registry:
70+
runs-on: ubuntu-latest
71+
permissions:
72+
contents: read
73+
packages: write
74+
attestations: write
75+
id-token: write
76+
77+
steps:
78+
- name: Checkout repository
79+
uses: actions/checkout@v4
80+
81+
- name: set tag
82+
run: echo "GIT_TAG=$(git describe --tags --always)" >> $GITHUB_ENV
83+
84+
- name: Set up Go 1.x
85+
uses: actions/setup-go@v5
86+
with:
87+
go-version: ${{ env.GO_VERSION }}
88+
89+
- name: go mod vendor
90+
run: go mod vendor
91+
92+
- name: Set up QEMU
93+
uses: docker/setup-qemu-action@v3
94+
95+
- name: Set up Docker Buildx
96+
uses: docker/setup-buildx-action@v3
97+
98+
- name: Log in to the Container registry
99+
uses: docker/login-action@v3
100+
with:
101+
registry: ${{ env.REGISTRY }}
102+
username: ${{ github.actor }}
103+
password: ${{ secrets.GITHUB_TOKEN }}
104+
105+
- name: Extract metadata (tags, labels) for Docker
106+
id: meta
107+
uses: docker/metadata-action@v5
108+
with:
109+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
110+
111+
- name: Build and push Docker image
112+
id: push
113+
uses: docker/build-push-action@v5
114+
with:
115+
context: .
116+
file: images/Dockerfile
117+
push: true
118+
platforms: linux/amd64,linux/arm64,linux/arm,linux/s390x,linux/ppc64le,linux/riscv64
119+
tags: ${{ steps.meta.outputs.tags }}
120+
labels: ${{ steps.meta.outputs.labels }}
121+
build-args: TAG=${{ env.GIT_TAG }}
122+
123+
- name: Generate artifact attestation
124+
uses: actions/attest-build-provenance@v2
125+
with:
126+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
127+
subject-digest: ${{ steps.push.outputs.digest }}
128+
push-to-registry: true
129+
66130
build-and-push-artifacts:
67131
environment:
68132
name: github-pages

Documentation/kube-flannel-psp.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ spec:
166166
serviceAccountName: flannel
167167
initContainers:
168168
- name: install-cni-plugin
169-
image: docker.io/flannel/flannel-cni-plugin:v1.6.0-flannel1
169+
image: ghcr.io/flannel-io/flannel-cni-plugin:v1.6.2-flannel1
170170
command:
171171
- cp
172172
args:
@@ -177,7 +177,7 @@ spec:
177177
- name: cni-plugin
178178
mountPath: /opt/cni/bin
179179
- name: install-cni
180-
image: docker.io/flannel/flannel:v0.26.3
180+
image: ghcr.io/flannel-io/flannel:v0.26.3
181181
command:
182182
- cp
183183
args:
@@ -191,7 +191,7 @@ spec:
191191
mountPath: /etc/kube-flannel/
192192
containers:
193193
- name: kube-flannel
194-
image: docker.io/flannel/flannel:v0.26.3
194+
image: ghcr.io/flannel-io/flannel:v0.26.3
195195
command:
196196
- /opt/bin/flanneld
197197
args:

Documentation/kube-flannel.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ spec:
133133
serviceAccountName: flannel
134134
initContainers:
135135
- name: install-cni-plugin
136-
image: docker.io/flannel/flannel-cni-plugin:v1.6.0-flannel1
136+
image: ghcr.io/flannel-io/flannel-cni-plugin:v1.6.2-flannel1
137137
command:
138138
- cp
139139
args:
@@ -144,7 +144,7 @@ spec:
144144
- name: cni-plugin
145145
mountPath: /opt/cni/bin
146146
- name: install-cni
147-
image: docker.io/flannel/flannel:v0.26.3
147+
image: ghcr.io/flannel-io/flannel:v0.26.3
148148
command:
149149
- cp
150150
args:
@@ -158,7 +158,7 @@ spec:
158158
mountPath: /etc/kube-flannel/
159159
containers:
160160
- name: kube-flannel
161-
image: docker.io/flannel/flannel:v0.26.3
161+
image: ghcr.io/flannel-io/flannel:v0.26.3
162162
command:
163163
- /opt/bin/flanneld
164164
args:

Documentation/kustomization/kube-flannel-psp/kube-flannel-psp.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ spec:
166166
serviceAccountName: flannel
167167
initContainers:
168168
- name: install-cni-plugin
169-
image: docker.io/flannel/flannel-cni-plugin:v1.6.0-flannel1
169+
image: ghcr.io/flannel-io/flannel-cni-plugin:v1.6.2-flannel1
170170
command:
171171
- cp
172172
args:
@@ -177,7 +177,7 @@ spec:
177177
- name: cni-plugin
178178
mountPath: /opt/cni/bin
179179
- name: install-cni
180-
image: docker.io/flannel/flannel:v0.26.3
180+
image: ghcr.io/flannel-io/flannel:v0.26.3
181181
command:
182182
- cp
183183
args:
@@ -191,7 +191,7 @@ spec:
191191
mountPath: /etc/kube-flannel/
192192
containers:
193193
- name: kube-flannel
194-
image: docker.io/flannel/flannel:v0.26.3
194+
image: ghcr.io/flannel-io/flannel:v0.26.3
195195
command:
196196
- /opt/bin/flanneld
197197
args:

Documentation/kustomization/kube-flannel-psp/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ commonLabels:
55
resources:
66
- kube-flannel-psp.yml
77
images:
8-
- name: docker.io/flannel/flannel
8+
- name: ghcr.io/flannel-io/flannel
99
newTag: v0.22.1

Documentation/kustomization/kube-flannel/kube-flannel.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ spec:
124124
serviceAccountName: flannel
125125
initContainers:
126126
- name: install-cni-plugin
127-
image: docker.io/flannel/flannel-cni-plugin:v1.6.0-flannel1
127+
image: ghcr.io/flannel-io/flannel-cni-plugin:v1.6.2-flannel1
128128
command:
129129
- cp
130130
args:
@@ -135,7 +135,7 @@ spec:
135135
- name: cni-plugin
136136
mountPath: /opt/cni/bin
137137
- name: install-cni
138-
image: docker.io/flannel/flannel:v0.26.3
138+
image: ghcr.io/flannel-io/flannel:v0.26.3
139139
command:
140140
- cp
141141
args:
@@ -149,7 +149,7 @@ spec:
149149
mountPath: /etc/kube-flannel/
150150
containers:
151151
- name: kube-flannel
152-
image: docker.io/flannel/flannel:v0.26.3
152+
image: ghcr.io/flannel-io/flannel:v0.26.3
153153
command:
154154
- /opt/bin/flanneld
155155
args:

Documentation/kustomization/kube-flannel/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ commonLabels:
55
resources:
66
- kube-flannel.yml
77
images:
8-
- name: docker.io/flannel/flannel
8+
- name: ghcr.io/flannel-io/flannel
99
newTag: v0.26.3

chart/kube-flannel/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ podCidrv6: ""
1111
flannel:
1212
# kube-flannel image
1313
image:
14-
repository: docker.io/flannel/flannel
14+
repository: ghcr.io/flannel-io/flannel
1515
tag: v0.26.3
1616
image_cni:
17-
repository: docker.io/flannel/flannel-cni-plugin
18-
tag: v1.6.0-flannel1
17+
repository: ghcr.io/flannel-io/flannel-cni-plugin
18+
tag: v1.6.2-flannel1
1919
# skipCNIConfigInstallation skips the installation of the flannel CNI config. This is useful when the CNI config is
2020
# provided externally.
2121
skipCNIConfigInstallation: false

0 commit comments

Comments
 (0)