Skip to content

Commit b966223

Browse files
committed
Merge remote-tracking branch 'upstream/main' into buildha
2 parents 603b352 + a30f32f commit b966223

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+265
-500
lines changed

.github/workflows/images-build-and-push.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
env:
1111
BASE_REPOSITORY: warm-metal/container-image-csi-driver
1212
BASE_DEFAULT_BRANCH: main
13-
BASE_IMAGE_NAME: warmmetal/csi-image
13+
BASE_IMAGE_NAME: warmmetal/container-image-csi-driver
1414
FORK_IMAGE_NAME: ghcr.io/${{ github.repository }}
1515

1616
permissions:

Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM docker.io/library/golang:1.22.1-alpine3.19 as builder
2-
RUN apk add --no-cache btrfs-progs-dev lvm2-dev make
1+
FROM docker.io/library/golang:1.22.5-alpine3.19 as builder
2+
RUN apk add --no-cache btrfs-progs-dev lvm2-dev make build-base
33
WORKDIR /go/src/container-image-csi-driver
44
COPY go.mod go.sum ./
55
RUN go mod download
@@ -10,10 +10,10 @@ RUN make build
1010
RUN make install-util
1111

1212
FROM scratch as install-util
13-
COPY --from=builder /go/src/container-image-csi-driver/_output/warm-metal-csi-image-install /
13+
COPY --from=builder /go/src/container-image-csi-driver/_output/container-image-csi-driver-install /
1414

1515
FROM alpine:3.19
1616
RUN apk add --no-cache btrfs-progs-dev lvm2-dev
1717
WORKDIR /
18-
COPY --from=builder /go/src/container-image-csi-driver/_output/csi-image-plugin /usr/bin/
19-
ENTRYPOINT ["csi-image-plugin"]
18+
COPY --from=builder /go/src/container-image-csi-driver/_output/container-image-csi-driver /usr/bin/
19+
ENTRYPOINT ["container-image-csi-driver"]

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
VERSION ?= v1.2.1
1+
VERSION ?= v2.0.0
22

33
IMAGE_BUILDER ?= docker
44
IMAGE_BUILD_CMD ?= buildx
55
REGISTRY ?= docker.io/warmmetal
66
PLATFORM ?= linux/amd64
77

8-
export IMG = $(REGISTRY)/csi-image:$(VERSION)
8+
export IMG = $(REGISTRY)/container-image-csi-driver:$(VERSION)
99

1010
# cgo is required to build containers/storage
1111
# For ubuntu, install libbtrfs-dev and libdevmapper-dev before building
1212
.PHONY: build
1313
build:
1414
go fmt ./...
1515
go vet ./...
16-
go build -o _output/csi-image-plugin ./cmd/plugin
16+
go build -o _output/container-image-csi-driver ./cmd/plugin
1717

1818
.PHONY: sanity
1919
sanity:
@@ -45,11 +45,11 @@ integration:
4545

4646
.PHONY: image
4747
image:
48-
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/csi-image:$(VERSION) --push .
48+
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/container-image-csi-driver:$(VERSION) --push .
4949

5050
.PHONY: local
5151
local:
52-
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/csi-image:$(VERSION) --load .
52+
$(IMAGE_BUILDER) $(IMAGE_BUILD_CMD) build --platform=$(PLATFORM) -t $(REGISTRY)/container-image-csi-driver:$(VERSION) --load .
5353

5454
.PHONY: test-deps
5555
test-deps:
@@ -62,4 +62,4 @@ test-deps:
6262
install-util:
6363
GOOS=linux CGO_ENABLED="0" go build \
6464
-ldflags "-X main.Version=$(VERSION) -X main.Registry=$(REGISTRY)" \
65-
-o _output/warm-metal-csi-image-install ./cmd/install
65+
-o _output/container-image-csi-driver-install ./cmd/install

README.md

+26-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![containerd](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/containerd.yaml)
1212
[![docker-containerd](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/docker-containerd.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/docker-containerd.yaml)
1313
[![cri-o](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/container-image-csi-driver/actions/workflows/cri-o.yaml)
14-
![Docker Pulls](https://img.shields.io/docker/pulls/warmmetal/csi-image?color=brightgreen&logo=docker&logoColor=lightgrey&labelColor=black)
14+
![Docker Pulls](https://img.shields.io/docker/pulls/warmmetal/container-image-csi-driver?color=brightgreen&logo=docker&logoColor=lightgrey&labelColor=black)
1515

1616
# :construction_worker_man: :wrench: :construction: RENAMING THE REPOSITORY :construction: :wrench: :construction_worker_man:
1717

@@ -28,6 +28,18 @@ git branch -u main main
2828
git remote set-head origin -a
2929
```
3030

31+
### Migration of CSI driver
32+
In release `v2.0.0`, we are updating the CSI driver name from `csi-image.warm-metal.tech` to `container-image.warm-metal.tech`. This change may cause disruptions to your existing workloads if the driver name is not updated.
33+
34+
**To ensure a smooth transition:**
35+
1. **Install Both Versions**: To avoid any breaking changes, you can install both the old and new versions of the CSI driver simultaneously. Both versions are compatible and have been tested to work side-by-side, as verified in our integration tests.
36+
37+
1. **Update Your Workloads**: Migrate your workloads to use the new driver name `container-image.warm-metal.tech`. This process will involve updating your storage class definitions and any other configurations that reference the old driver name.
38+
39+
1. **Remove the Old Driver**: Once all workloads have been successfully migrated and verified with the new driver, you can safely remove the older version of the driver from your cluster.
40+
41+
1. **Testing**: It is highly recommended to test the migration process in a staging environment before applying changes to production.
42+
3143
We appreciate your cooperation and understanding as we work to improve our repository.
3244

3345
# container-image-csi-driver (previously csi-driver-image)
@@ -48,7 +60,7 @@ then mounts images via the snapshot/storage service of the runtime.
4860
## Compatibility matrix
4961
Tested changes on below mentioned versions -
5062

51-
| warm-metal | k8s version | containerd | crio |
63+
| CSI driver | k8s version | containerd | crio |
5264
|------------|-------------|------------|---------|
5365
| 0.6.x | v1.25 | 1.6.8 | v1.20.9 |
5466
| 0.7.x | v1.25 | 1.6.8 | v1.20.9 |
@@ -62,26 +74,26 @@ Tested changes on below mentioned versions -
6274
## Installation
6375

6476
The driver requires to mount various host paths for different container runtimes.
65-
So, I build a binary utility, `warm-metal-csi-image-install`, to reduce the installation complexity.
77+
So, I build a binary utility, `container-image-csi-driver-install`, to reduce the installation complexity.
6678
It supports kubernetes, microk8s and k3s clusters with container runtime **cri-o**, **containerd** or **docker**.
6779
Users can run this utility on any nodes in their clusters to generate proper manifests to install the driver.
6880
The download link is available on the [release page](https://github.com/warm-metal/container-image-csi-driver/releases).
6981

7082
```shell script
7183
# To print manifests
72-
warm-metal-csi-image-install
84+
container-image-csi-driver-install
7385

7486
# To show the detected configuration
75-
warm-metal-csi-image-install --print-detected-instead
87+
container-image-csi-driver-install --print-detected-instead
7688

7789
# To change the default namespace that the driver to be installed in
78-
warm-metal-csi-image-install --namespace=foo
90+
container-image-csi-driver-install --namespace=foo
7991

8092
# To set a Secret as the imagepullsecret
81-
warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo
93+
container-image-csi-driver-install --pull-image-secret-for-daemonset=foo
8294

8395
# To disable the memroy cache for imagepullsecrets if Secrets are short-lived.
84-
warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo --enable-daemon-image-credential-cache=false
96+
container-image-csi-driver-install --pull-image-secret-for-daemonset=foo --enable-daemon-image-credential-cache=false
8597
```
8698

8799
You can found some installation manifests as samples in [examples](https://github.com/warm-metal/container-image-csi-driver/tree/master/sample).
@@ -126,7 +138,7 @@ spec:
126138
volumes:
127139
- name: target
128140
csi:
129-
driver: csi-image.warm-metal.tech
141+
driver: container-image.csi.k8s.io
130142
# nodePublishSecretRef:
131143
# name: "ImagePullSecret name in the same namespace"
132144
volumeAttributes:
@@ -145,14 +157,14 @@ kind: PersistentVolume
145157
metadata:
146158
name: pv-test-container-image-csi-driver-test-simple-fs
147159
spec:
148-
storageClassName: csi-image.warm-metal.tech
160+
storageClassName: container-image.csi.k8s.io
149161
capacity:
150162
storage: 5Gi
151163
accessModes:
152164
- ReadOnlyMany
153165
persistentVolumeReclaimPolicy: Retain
154166
csi:
155-
driver: csi-image.warm-metal.tech
167+
driver: container-image.csi.k8s.io
156168
volumeHandle: "docker.io/warmmetal/container-image-csi-driver-test:simple-fs"
157169
# nodePublishSecretRef:
158170
# name: "name of the ImagePullSecret"
@@ -178,12 +190,12 @@ Otherwise, you need ImagePullSecrets to store your credential. The following lin
178190
- [https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account)
179191

180192
If the secret is desired to be shared by all volumes, you can add it to the ServiceAccount of the driver,
181-
`csi-image-warm-metal` by default, and update the Role `csi-image-warm-metal` to make sure the daemon has permissions to fetch the secret,
182-
then restart the driver daemon pod. Users can run `warm-metal-csi-image-install` to generate new manifests and apply them to update.
193+
`container-image-csi-driver` by default, and update the Role `container-image-csi-driver` to make sure the daemon has permissions to fetch the secret,
194+
then restart the driver daemon pod. Users can run `container-image-csi-driver-install` to generate new manifests and apply them to update.
183195

184196
```shell script
185197
# use secrets foo and bar
186-
warm-metal-csi-image-install --pull-image-secret-for-daemonset=foo --pull-image-secret-for-daemonset=bar
198+
container-image-csi-driver-install --pull-image-secret-for-daemonset=foo --pull-image-secret-for-daemonset=bar
187199
```
188200

189201
If the secret works only for particular workloads, you can set via the `nodePublishSecretRef` attribute of ephemeral volumes.

charts/warm-metal-csi-driver/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.2.1
18+
version: 2.0.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: v1.2.1
23+
appVersion: v2.0.0

charts/warm-metal-csi-driver/templates/csi-driver.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: storage.k8s.io/v1
22
kind: CSIDriver
33
metadata:
4-
name: csi-image.warm-metal.tech
4+
name: container-image.csi.k8s.io
55
labels:
66
{{- include "warm-metal-csi-driver.labels" . | nindent 4 }}
77
spec:
@@ -12,4 +12,4 @@ spec:
1212
- Ephemeral
1313
{{- if (ge (int .Capabilities.KubeVersion.Minor) 20) }}
1414
fsGroupPolicy: None
15-
{{- end}}
15+
{{- end}}

charts/warm-metal-csi-driver/templates/nodeplugin.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- name: node-driver-registrar
2525
args:
2626
- "--csi-address=/csi/csi.sock"
27-
- --kubelet-registration-path={{ .Values.kubeletRoot }}/plugins/csi-image.warm-metal.tech/csi.sock
27+
- --kubelet-registration-path={{ .Values.kubeletRoot }}/plugins/container-image.csi.k8s.io/csi.sock
2828
- "-v={{ .Values.logLevel }}"
2929
env:
3030
- name: KUBE_NODE_NAME
@@ -127,7 +127,7 @@ spec:
127127
serviceAccountName: {{ include "warm-metal-csi-driver.fullname" . }}-nodeplugin
128128
volumes:
129129
- hostPath:
130-
path: {{ .Values.kubeletRoot }}/plugins/csi-image.warm-metal.tech
130+
path: {{ .Values.kubeletRoot }}/plugins/container-image.csi.k8s.io
131131
type: DirectoryOrCreate
132132
name: socket-dir
133133
- hostPath:

charts/warm-metal-csi-driver/values-crio.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ csiPlugin:
1313
resources: {}
1414
image:
1515
tag: ""
16-
repository: docker.io/warmmetal/csi-image
16+
repository: docker.io/warmmetal/container-image-csi-driver
1717
pullPolicy: IfNotPresent
1818
livenessProbe:
1919
httpGet:

charts/warm-metal-csi-driver/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ csiPlugin:
1717
resources: {}
1818
image:
1919
tag: ""
20-
repository: docker.io/warmmetal/csi-image
20+
repository: docker.io/warmmetal/container-image-csi-driver
2121
pullPolicy: IfNotPresent
2222
livenessProbe:
2323
httpGet:

cmd/install/main.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
}
4242

4343
conf.EnableCache = *enableCache
44-
conf.Image = fmt.Sprintf("%s/csi-image:%s", Registry, Version)
44+
conf.Image = fmt.Sprintf("%s/container-image-csi-driver:%s", Registry, Version)
4545

4646
vols := detectImageSvcVolumes(conf.ImageSocketPath)
4747
if len(vols) == 0 {
@@ -209,7 +209,7 @@ const staticManifests = `---
209209
apiVersion: storage.k8s.io/v1
210210
kind: CSIDriver
211211
metadata:
212-
name: csi-image.warm-metal.tech
212+
name: container-image.csi.k8s.io
213213
spec:
214214
attachRequired: false
215215
podInfoOnMount: true
@@ -223,7 +223,7 @@ const defaultSAManifests = `---
223223
apiVersion: v1
224224
kind: ServiceAccount
225225
metadata:
226-
name: csi-image-warm-metal
226+
name: container-image-csi-driver
227227
namespace: kube-system
228228
---
229229
`
@@ -232,13 +232,13 @@ const defaultRBACRoleManifests = `---
232232
apiVersion: rbac.authorization.k8s.io/v1
233233
kind: Role
234234
metadata:
235-
name: csi-image-warm-metal
235+
name: container-image-csi-driver
236236
namespace: kube-system
237237
rules:
238238
- apiGroups:
239239
- ""
240240
resourceNames:
241-
- csi-image-warm-metal
241+
- container-image-csi-driver
242242
resources:
243243
- serviceaccounts
244244
verbs:
@@ -250,15 +250,15 @@ const rbacRoleBindingManifests = `---
250250
apiVersion: rbac.authorization.k8s.io/v1
251251
kind: RoleBinding
252252
metadata:
253-
name: csi-image-warm-metal
253+
name: container-image-csi-driver
254254
namespace: kube-system
255255
roleRef:
256256
apiGroup: rbac.authorization.k8s.io
257257
kind: Role
258-
name: csi-image-warm-metal
258+
name: container-image-csi-driver
259259
subjects:
260260
- kind: ServiceAccount
261-
name: csi-image-warm-metal
261+
name: container-image-csi-driver
262262
namespace: kube-system
263263
---
264264
`
@@ -267,30 +267,30 @@ const dsTemplate = `---
267267
kind: DaemonSet
268268
apiVersion: apps/v1
269269
metadata:
270-
name: csi-image-warm-metal
270+
name: container-image-csi-driver
271271
namespace: kube-system
272272
spec:
273273
selector:
274274
matchLabels:
275-
app: csi-image-warm-metal
275+
app: container-image-csi-driver
276276
template:
277277
metadata:
278278
labels:
279-
app: csi-image-warm-metal
279+
app: container-image-csi-driver
280280
spec:
281281
hostNetwork: false
282-
serviceAccountName: csi-image-warm-metal
282+
serviceAccountName: container-image-csi-driver
283283
containers:
284284
- name: node-driver-registrar
285285
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
286286
imagePullPolicy: IfNotPresent
287287
lifecycle:
288288
preStop:
289289
exec:
290-
command: ["/bin/sh", "-c", "rm -rf /registration/csi-image.warm-metal.tech /registration/csi-image.warm-metal.tech-reg.sock"]
290+
command: ["/bin/sh", "-c", "rm -rf /registration/container-image.csi.k8s.io /registration/container-image.csi.k8s.io-reg.sock"]
291291
args:
292292
- --csi-address=/csi/csi.sock
293-
- --kubelet-registration-path={{.KubeletRoot}}/plugins/csi-image.warm-metal.tech/csi.sock
293+
- --kubelet-registration-path={{.KubeletRoot}}/plugins/container-image.csi.k8s.io/csi.sock
294294
env:
295295
- name: KUBE_NODE_NAME
296296
valueFrom:
@@ -332,7 +332,7 @@ spec:
332332
name: runtime-socket
333333
volumes:
334334
- hostPath:
335-
path: {{.KubeletRoot}}/plugins/csi-image.warm-metal.tech
335+
path: {{.KubeletRoot}}/plugins/container-image.csi.k8s.io
336336
type: DirectoryOrCreate
337337
name: socket-dir
338338
- hostPath:

cmd/plugin/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
const (
28-
driverName = "csi-image.warm-metal.tech"
28+
driverName = "container-image.csi.k8s.io"
2929
driverVersion = "v1.0.0"
3030

3131
containerdScheme = "containerd"

0 commit comments

Comments
 (0)