Skip to content

Commit 86343ad

Browse files
rebase
test rebase 2
2 parents 29ba8ee + 266d1da commit 86343ad

File tree

106 files changed

+2231
-2396
lines changed

Some content is hidden

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

106 files changed

+2231
-2396
lines changed

Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ARG DISTROLESS_IMAGE=registry.k8s.io/build-image/go-runner:v2.3.1-go1.22.2-bookw
2929
ARG ALPINE_IMAGE=alpine:3.17.5
3030

3131
# cinder-csi-plugin uses Debian as a base image
32-
ARG DEBIAN_IMAGE=registry.k8s.io/build-image/debian-base:bullseye-v1.4.3
32+
ARG DEBIAN_IMAGE=registry.k8s.io/build-image/debian-base:bookworm-v1.0.4
3333

3434
################################################################################
3535
## BUILD STAGE ##
@@ -38,17 +38,16 @@ ARG DEBIAN_IMAGE=registry.k8s.io/build-image/debian-base:bullseye-v1.4.3
3838
# Build an image containing a common ca-certificates used by all target images
3939
# regardless of how they are built. We arbitrarily take ca-certificates from
4040
# the amd64 Alpine image.
41-
FROM --platform=linux/amd64 ${ALPINE_IMAGE} as certs
41+
FROM --platform=${BUILDPLATFORM} ${ALPINE_IMAGE} AS certs
4242
RUN apk add --no-cache ca-certificates
4343

4444

4545
# Build all command targets. We build all command targets in a single build
4646
# stage for efficiency. Target images copy their binary from this image.
4747
# We use go's native cross compilation for multi-arch in this stage, so the
4848
# builder itself is always amd64
49-
FROM --platform=linux/amd64 ${GOLANG_IMAGE} as builder
49+
FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} AS builder
5050

51-
ARG GOPROXY=https://goproxy.io,direct
5251
ARG TARGETOS
5352
ARG TARGETARCH
5453
ARG VERSION
@@ -67,7 +66,7 @@ RUN make build GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOPROXY=${GOPROXY} VERSION=
6766
##
6867
## openstack-cloud-controller-manager
6968
##
70-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as openstack-cloud-controller-manager
69+
FROM ${DISTROLESS_IMAGE} AS openstack-cloud-controller-manager
7170

7271
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
7372
COPY --from=builder /build/openstack-cloud-controller-manager /bin/openstack-cloud-controller-manager
@@ -85,7 +84,7 @@ CMD [ "/bin/openstack-cloud-controller-manager" ]
8584
##
8685
## barbican-kms-plugin
8786
##
88-
FROM --platform=${TARGETPLATFORM} ${ALPINE_IMAGE} as barbican-kms-plugin
87+
FROM ${ALPINE_IMAGE} AS barbican-kms-plugin
8988
# barbican-kms-plugin uses ALPINE instead of distroless because its entrypoint
9089
# uses a shell for environment substitution. If there are no other uses this
9190
# could be replaced by callers passing arguments explicitly.
@@ -109,15 +108,15 @@ CMD ["sh", "-c", "/bin/barbican-kms-plugin --socketpath ${socketpath} --cloud-co
109108

110109
# step 1: copy all necessary files from Debian distro to /dest folder
111110
# all magic happens in tools/csi-deps.sh
112-
FROM --platform=${TARGETPLATFORM} ${DEBIAN_IMAGE} as cinder-csi-plugin-utils
111+
FROM ${DEBIAN_IMAGE} AS cinder-csi-plugin-utils
113112

114113
RUN clean-install bash rsync mount udev btrfs-progs e2fsprogs xfsprogs util-linux
115114
COPY tools/csi-deps.sh /tools/csi-deps.sh
116115
RUN /tools/csi-deps.sh
117116

118117
# step 2: check if all necessary files are copied and work properly
119118
# the build have to finish without errors, but the result image will not be used
120-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin-utils-check
119+
FROM ${DISTROLESS_IMAGE} AS cinder-csi-plugin-utils-check
121120

122121
COPY --from=cinder-csi-plugin-utils /dest /
123122
COPY --from=cinder-csi-plugin-utils /bin/sh /bin/sh
@@ -127,7 +126,7 @@ SHELL ["/bin/sh"]
127126
RUN /tools/csi-deps-check.sh
128127

129128
# step 3: build tiny cinder-csi-plugin image with only necessary files
130-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as cinder-csi-plugin
129+
FROM ${DISTROLESS_IMAGE} AS cinder-csi-plugin
131130

132131
# Copying csi-deps-check.sh simply ensures that the resulting image has a dependency
133132
# on cinder-csi-plugin-utils-check and therefore that the check has passed
@@ -149,7 +148,7 @@ CMD ["/bin/cinder-csi-plugin"]
149148
##
150149
## k8s-keystone-auth
151150
##
152-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as k8s-keystone-auth
151+
FROM ${DISTROLESS_IMAGE} AS k8s-keystone-auth
153152

154153
COPY --from=builder /build/k8s-keystone-auth /bin/k8s-keystone-auth
155154
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
@@ -169,7 +168,7 @@ CMD ["/bin/k8s-keystone-auth"]
169168
##
170169
## magnum-auto-healer
171170
##
172-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as magnum-auto-healer
171+
FROM ${DISTROLESS_IMAGE} AS magnum-auto-healer
173172

174173
COPY --from=builder /build/magnum-auto-healer /bin/magnum-auto-healer
175174
COPY --from=certs /etc/ssl/certs /etc/ssl/certs
@@ -187,7 +186,7 @@ CMD ["/bin/magnum-auto-healer"]
187186
##
188187
## manila-csi-plugin
189188
##
190-
FROM --platform=${TARGETPLATFORM} ${ALPINE_IMAGE} as manila-csi-plugin
189+
FROM ${ALPINE_IMAGE} AS manila-csi-plugin
191190
# manila-csi-plugin uses ALPINE because it pulls in jq and curl
192191

193192
RUN apk add --no-cache jq curl
@@ -208,7 +207,7 @@ ENTRYPOINT ["/bin/manila-csi-plugin"]
208207
##
209208
## octavia-ingress-controller
210209
##
211-
FROM --platform=${TARGETPLATFORM} ${DISTROLESS_IMAGE} as octavia-ingress-controller
210+
FROM ${DISTROLESS_IMAGE} AS octavia-ingress-controller
212211

213212
COPY --from=builder /build/octavia-ingress-controller /bin/octavia-ingress-controller
214213
COPY --from=certs /etc/ssl/certs /etc/ssl/certs

OWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ emeritus_approvers:
22
- chrigl
33
- lingxiankong
44
- ramineni
5+
- jichenjc
56
approvers:
67
- dulek
7-
- jichenjc
88
- kayrus
99
- zetaab
1010
reviewers:
1111
- dulek
12-
- jichenjc
1312
- kayrus
1413
- mdbooth
1514
- zetaab

charts/cinder-csi-plugin/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
appVersion: v1.31.0
2+
appVersion: v1.31.2
33
description: Cinder CSI Chart for OpenStack
44
name: openstack-cinder-csi
5-
version: 2.31.3
5+
version: 2.31.7
66
home: https://github.com/kubernetes/cloud-provider-openstack
77
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
88
maintainers:

charts/cinder-csi-plugin/templates/_helpers.tpl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ component: controllerplugin
8282
{{ include "cinder-csi.common.metaLabels" . }}
8383
{{- end -}}
8484

85+
{{- define "cinder-csi.controllerplugin.podLabels" -}}
86+
{{ include "cinder-csi.controllerplugin.labels" . }}
87+
{{ if .Values.csi.plugin.controllerPlugin.podLabels }}
88+
{{- toYaml .Values.csi.plugin.controllerPlugin.podLabels }}
89+
{{- end }}
90+
{{- end -}}
91+
8592
{{- define "cinder-csi.nodeplugin.matchLabels" -}}
8693
component: nodeplugin
8794
{{ include "cinder-csi.common.matchLabels" . }}
@@ -92,6 +99,13 @@ component: nodeplugin
9299
{{ include "cinder-csi.common.metaLabels" . }}
93100
{{- end -}}
94101

102+
{{- define "cinder-csi.nodeplugin.podLabels" -}}
103+
{{ include "cinder-csi.nodeplugin.labels" . }}
104+
{{ if .Values.csi.plugin.nodePlugin.podLabels }}
105+
{{- toYaml .Values.csi.plugin.nodePlugin.podLabels }}
106+
{{- end }}
107+
{{- end -}}
108+
95109
{{- define "cinder-csi.snapshot-controller.matchLabels" -}}
96110
component: snapshot-controller
97111
{{ include "cinder-csi.common.matchLabels" . }}
@@ -101,3 +115,30 @@ component: snapshot-controller
101115
{{ include "cinder-csi.snapshot-controller.matchLabels" . }}
102116
{{ include "cinder-csi.common.metaLabels" . }}
103117
{{- end -}}
118+
119+
{{/*
120+
Common annotations
121+
*/}}
122+
{{- define "cinder-csi.annotations" -}}
123+
{{- if .Values.commonAnnotations }}
124+
{{- toYaml .Values.commonAnnotations }}
125+
{{- end }}
126+
{{- end -}}
127+
128+
129+
{{/*
130+
Create unified annotations for cinder-csi components
131+
*/}}
132+
{{- define "cinder-csi.controllerplugin.podAnnotations" -}}
133+
{{ include "cinder-csi.annotations" . }}
134+
{{ if .Values.csi.plugin.controllerPlugin.podAnnotations }}
135+
{{- toYaml .Values.csi.plugin.controllerPlugin.podAnnotations }}
136+
{{- end }}
137+
{{- end -}}
138+
139+
{{- define "cinder-csi.nodeplugin.podAnnotations" -}}
140+
{{ include "cinder-csi.annotations" . }}
141+
{{ if .Values.csi.plugin.nodePlugin.podAnnotations }}
142+
{{- toYaml .Values.csi.plugin.nodePlugin.podAnnotations }}
143+
{{- end }}
144+
{{- end -}}

charts/cinder-csi-plugin/templates/controllerplugin-deployment.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ spec:
2424
template:
2525
metadata:
2626
labels:
27-
{{- include "cinder-csi.controllerplugin.labels" . | nindent 8 }}
27+
{{- include "cinder-csi.controllerplugin.podLabels" . | nindent 8 }}
2828
annotations:
29-
{{- with .Values.commonAnnotations }}
30-
{{- toYaml . | nindent 8 }}
31-
{{- end }}
29+
{{- include "cinder-csi.controllerplugin.podAnnotations" . | nindent 8 }}
3230
spec:
3331
serviceAccount: csi-cinder-controller-sa
3432
securityContext:
@@ -173,9 +171,13 @@ spec:
173171
- "--endpoint=$(CSI_ENDPOINT)"
174172
- "--cloud-config=$(CLOUD_CONFIG)"
175173
- "--cluster=$(CLUSTER_NAME)"
174+
- "--provide-node-service=false"
176175
{{- if .Values.csi.plugin.httpEndpoint.enabled }}
177176
- "--http-endpoint=:{{ .Values.csi.plugin.httpEndpoint.port }}"
178177
{{- end }}
178+
{{- if .Values.pvcAnnotations }}
179+
- "--pvc-annotations"
180+
{{- end }}
179181
{{- if .Values.csi.plugin.extraArgs }}
180182
{{- with .Values.csi.plugin.extraArgs }}
181183
{{- tpl . $ | trim | nindent 12 }}

charts/cinder-csi-plugin/templates/controllerplugin-rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ metadata:
4949
rules:
5050
- apiGroups: [""]
5151
resources: ["persistentvolumes"]
52-
verbs: ["get", "list", "watch", "create", "delete"]
52+
verbs: ["get", "list", "watch", "create", "delete", "patch"]
5353
- apiGroups: [""]
5454
resources: ["persistentvolumeclaims"]
5555
verbs: ["get", "list", "watch", "update"]

charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ spec:
1616
template:
1717
metadata:
1818
labels:
19-
{{- include "cinder-csi.nodeplugin.labels" . | nindent 8 }}
19+
{{- include "cinder-csi.nodeplugin.podLabels" . | nindent 8 }}
2020
annotations:
21-
{{- with .Values.commonAnnotations }}
22-
{{- toYaml . | nindent 8 }}
23-
{{- end }}
21+
{{- include "cinder-csi.nodeplugin.podAnnotations" . | nindent 8 }}
2422
spec:
2523
serviceAccount: csi-cinder-node-sa
2624
hostNetwork: true
@@ -91,6 +89,7 @@ spec:
9189
- /bin/cinder-csi-plugin
9290
- "-v={{ .Values.logVerbosityLevel }}"
9391
- "--endpoint=$(CSI_ENDPOINT)"
92+
- "--provide-controller-service=false"
9493
- "--cloud-config=$(CLOUD_CONFIG)"
9594
{{- if .Values.csi.plugin.extraArgs }}
9695
{{- with .Values.csi.plugin.extraArgs }}

charts/cinder-csi-plugin/values.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ csi:
88
attacher:
99
image:
1010
repository: registry.k8s.io/sig-storage/csi-attacher
11-
tag: v4.4.2
11+
tag: v4.7.0
1212
pullPolicy: IfNotPresent
1313
resources: {}
1414
extraArgs: {}
@@ -17,15 +17,15 @@ csi:
1717
topology: "true"
1818
image:
1919
repository: registry.k8s.io/sig-storage/csi-provisioner
20-
tag: v3.6.2
20+
tag: v5.1.0
2121
pullPolicy: IfNotPresent
2222
resources: {}
2323
extraArgs: {}
2424
extraEnv: []
2525
snapshotter:
2626
image:
2727
repository: registry.k8s.io/sig-storage/csi-snapshotter
28-
tag: v6.3.2
28+
tag: v8.1.0
2929
pullPolicy: IfNotPresent
3030
resources: {}
3131
extraArgs: {}
@@ -41,7 +41,7 @@ csi:
4141
resizer:
4242
image:
4343
repository: registry.k8s.io/sig-storage/csi-resizer
44-
tag: v1.9.2
44+
tag: v1.12.0
4545
pullPolicy: IfNotPresent
4646
resources: {}
4747
extraArgs: {}
@@ -55,7 +55,7 @@ csi:
5555
livenessprobe:
5656
image:
5757
repository: registry.k8s.io/sig-storage/livenessprobe
58-
tag: v2.11.0
58+
tag: v2.14.0
5959
pullPolicy: IfNotPresent
6060
failureThreshold: 5
6161
initialDelaySeconds: 10
@@ -67,7 +67,7 @@ csi:
6767
nodeDriverRegistrar:
6868
image:
6969
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
70-
tag: v2.9.2
70+
tag: v2.12.0
7171
pullPolicy: IfNotPresent
7272
resources: {}
7373
extraArgs: {}
@@ -90,6 +90,10 @@ csi:
9090
readOnly: true
9191
nodePlugin:
9292
dnsPolicy: ClusterFirstWithHostNet
93+
# Optional additional annotations to add to the nodePlugin Pods.
94+
podAnnotations: {}
95+
# Optional additional labels to add to the nodePlugin Pods.
96+
podLabels: {}
9397
podSecurityContext: {}
9498
securityContext: {}
9599
# capabilities:
@@ -121,6 +125,10 @@ csi:
121125
# maxSurge is the maximum number of pods that can be
122126
# created over the desired number of pods.
123127
maxSurge: 1
128+
# Optional additional annotations to add to the controllerPlugin Pods.
129+
podAnnotations: {}
130+
# Optional additional labels to add to the controllerPlugin Pods.
131+
podLabels: {}
124132
podSecurityContext: {}
125133
# runAsNonRoot: true
126134
# runAsUser: 65532
@@ -215,10 +223,13 @@ storageClass:
215223
# to volume metadata in newly provisioned volumes as `cinder.csi.openstack.org/cluster=<cluster ID>`.
216224
clusterID: "kubernetes"
217225

226+
# Enable PVC annotations support to create PVCs with extra parameters
227+
pvcAnnotations: false
228+
218229
priorityClassName: ""
219230

220231
imagePullSecrets: []
221232
# - name: my-imagepull-secret
222233

223-
# add annotations to all pods
234+
# add annotations to all pods, deployment, daemonset and podmonitor
224235
commonAnnotations: {}

charts/manila-csi-plugin/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
2-
appVersion: v1.31.0
2+
appVersion: v1.31.2
33
description: Manila CSI Chart for OpenStack
44
name: openstack-manila-csi
5-
version: 2.31.0
5+
version: 2.31.4
66
home: http://github.com/kubernetes/cloud-provider-openstack
77
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
88
maintainers:

charts/manila-csi-plugin/templates/controllerplugin-statefulset.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
2727
- "--feature-gates=Topology=true"
2828
{{- end }}
29-
{{- if $.Values.controllerplugin.provisioner.extraCreateMetadata }}
29+
{{- if or $.Values.controllerplugin.provisioner.extraCreateMetadata $.Values.csimanila.pvcAnnotations }}
3030
- "--extra-create-metadata"
3131
{{- end }}
3232
env:
@@ -86,10 +86,8 @@ spec:
8686
command: ["/bin/sh", "-c",
8787
'/bin/manila-csi-plugin
8888
-v={{ $.Values.logVerbosityLevel }}
89-
--nodeid=$(NODE_ID)
9089
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
9190
--with-topology
92-
--nodeaz={{ $.Values.csimanila.nodeAZ }}
9391
{{- end }}
9492
{{- if $.Values.csimanila.runtimeConfig.enabled }}
9593
--runtime-config-file=/runtimeconfig/runtimeconfig.json
@@ -101,15 +99,14 @@ spec:
10199
{{- if .compatibilitySettings }}
102100
--compatibility-settings={{ .compatibilitySettings }}
103101
{{- end }}
104-
--cluster-id="{{ $.Values.csimanila.clusterID }}"'
102+
--cluster-id="{{ $.Values.csimanila.clusterID }}"
103+
{{- if $.Values.csimanila.pvcAnnotations }}
104+
--pvc-annotations
105+
{{- end }}'
105106
]
106107
env:
107108
- name: DRIVER_NAME
108109
value: {{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
109-
- name: NODE_ID
110-
valueFrom:
111-
fieldRef:
112-
fieldPath: spec.nodeName
113110
- name: CSI_ENDPOINT
114111
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
115112
- name: FWD_CSI_ENDPOINT

0 commit comments

Comments
 (0)