Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenStack CCM and Cinder CSI #2061

Merged
merged 2 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 15 additions & 32 deletions addons/csi-openstack-cinder/controllerplugin-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]

- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]

---
kind: ClusterRoleBinding
Expand Down Expand Up @@ -76,7 +78,9 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch"]

- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -109,10 +113,13 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete"]
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
verbs: ["update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -150,11 +157,13 @@ rules:
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims/status"]
verbs: ["patch", "update"]
verbs: ["patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]

- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -168,29 +177,3 @@ roleRef:
kind: ClusterRole
name: csi-resizer-role
apiGroup: rbac.authorization.k8s.io

---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: kube-system
name: external-resizer-cfg
rules:
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]

---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-resizer-role-cfg
namespace: kube-system
subjects:
- kind: ServiceAccount
name: csi-cinder-controller-sa
namespace: kube-system
roleRef:
kind: Role
name: external-resizer-cfg
apiGroup: rbac.authorization.k8s.io
46 changes: 15 additions & 31 deletions addons/csi-openstack-cinder/controllerplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@
# external-attacher, external-provisioner, external-snapshotter
# external-resize, liveness-probe
{{ $version := semver .Config.Versions.Kubernetes }}

kind: Service
apiVersion: v1
metadata:
name: csi-cinder-controller-service
namespace: kube-system
labels:
app: csi-cinder-controllerplugin
spec:
selector:
app: csi-cinder-controllerplugin
ports:
- name: dummy
port: 12345

---
kind: StatefulSet
kind: Deployment
apiVersion: apps/v1
metadata:
name: csi-cinder-controllerplugin
namespace: kube-system
spec:
serviceName: "csi-cinder-controller-service"
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app: csi-cinder-controllerplugin
Expand All @@ -42,10 +31,11 @@ spec:
effect: NoSchedule
containers:
- name: csi-attacher
image: {{ .InternalImages.Get "CSIAttacher" }}
image: {{ .InternalImages.Get "OpenstackCSIAttacher" }}
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
- "--leader-election=true"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand All @@ -54,19 +44,14 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-provisioner
image: {{ .InternalImages.Get "CSIProvisioner" }}
image: {{ .InternalImages.Get "OpenstackCSIProvisioner" }}
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
{{ if ge $version.Minor 21 }}
# --default-fstype and --feature-gates is only used since CSI v1.21.0
- "--default-fstype=ext4"
- "--feature-gates=Topology=true"
{{ end }}
{{ if ge $version.Minor 20 }}
# --extra-create-metadata is only used since CSI v1.20.0
- "--extra-create-metadata"
{{ end }}
- "--leader-election=true"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand All @@ -75,14 +60,12 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: {{ .InternalImages.Get "CSISnapshotter" }}
image: {{ .InternalImages.Get "OpenstackCSISnapshotter" }}
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
{{ if ge $version.Minor 20 }}
# --extra-create-metadata is only used since CSI v1.20.0
- "--extra-create-metadata"
{{ end }}
- "--leader-election=true"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand All @@ -91,11 +74,12 @@ spec:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
- name: csi-resizer
image: {{ .InternalImages.Get "CSIResizer" }}
image: {{ .InternalImages.Get "OpenstackCSIResizer" }}
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=3m"
- "--handle-volume-inuse-error=false"
- "--leader-election=true"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
Expand All @@ -104,7 +88,7 @@ spec:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: liveness-probe
image: {{ .InternalImages.Get "CSILivenessProbe" }}
image: {{ .InternalImages.Get "OpenstackCSILivenessProbe" }}
args:
- "--csi-address=$(ADDRESS)"
env:
Expand Down
6 changes: 3 additions & 3 deletions addons/csi-openstack-cinder/nodeplugin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This YAML file contains driver-registrar & csi driver nodeplugin API objects,
# which are necessary to run csi nodeplugin for cinder.
{{ $version := semver .Config.Versions.Kubernetes }}

---
kind: DaemonSet
apiVersion: apps/v1
metadata:
Expand All @@ -22,7 +22,7 @@ spec:
hostNetwork: true
containers:
- name: node-driver-registrar
image: {{ .InternalImages.Get "CSINodeDriverRegistar" }}
image: {{ .InternalImages.Get "OpenstackCSINodeDriverRegistar" }}
args:
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
Expand All @@ -49,7 +49,7 @@ spec:
- name: registration-dir
mountPath: /registration
- name: liveness-probe
image: {{ .InternalImages.Get "CSILivenessProbe" }}
image: {{ .InternalImages.Get "OpenstackCSILivenessProbe" }}
args:
- --csi-address=/csi/csi.sock
volumeMounts:
Expand Down
15 changes: 12 additions & 3 deletions addons/csi-openstack-cinder/snapshot-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Sourced from
# https://github.com/kubernetes-csi/external-snapshotter/tree/release-4.2/client/config/crd
# https://github.com/kubernetes-csi/external-snapshotter/tree/v5.0.1/client/config/crd

---
apiVersion: apiextensions.k8s.io/v1
Expand All @@ -30,6 +30,8 @@ spec:
kind: VolumeSnapshot
listKind: VolumeSnapshotList
plural: volumesnapshots
shortNames:
- vs
singular: volumesnapshot
scope: Namespaced
versions:
Expand Down Expand Up @@ -109,7 +111,7 @@ spec:
format: date-time
type: string
error:
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurs during the snapshot creation. Upon success, this error field will be cleared.
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurrs during the snapshot creation. Upon success, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
Expand Down Expand Up @@ -213,7 +215,7 @@ spec:
format: date-time
type: string
error:
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurs during the snapshot creation. Upon success, this error field will be cleared.
description: error is the last observed error during snapshot creation, if any. This field could be helpful to upper level controllers(i.e., application controller) to decide whether they should continue on waiting for the snapshot to be created based on the type of error reported. The snapshot controller will keep retrying when an error occurrs during the snapshot creation. Upon success, this error field will be cleared.
properties:
message:
description: 'message is a string detailing the encountered error during snapshot creation if specified. NOTE: message may be logged, and it should not contain sensitive information.'
Expand Down Expand Up @@ -262,6 +264,9 @@ spec:
kind: VolumeSnapshotContent
listKind: VolumeSnapshotContentList
plural: volumesnapshotcontents
shortNames:
- vsc
- vscs
singular: volumesnapshotcontent
scope: Cluster
versions:
Expand Down Expand Up @@ -568,6 +573,9 @@ spec:
kind: VolumeSnapshotClass
listKind: VolumeSnapshotClassList
plural: volumesnapshotclasses
shortNames:
- vsclass
- vsclasses
singular: volumesnapshotclass
scope: Cluster
versions:
Expand Down Expand Up @@ -668,3 +676,4 @@ status:
plural: ""
conditions: []
storedVersions: []

24 changes: 19 additions & 5 deletions pkg/templates/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,20 @@ const (
DigitalOceanCSISnapshotValidationWebhook
DigitalOceanCSISnapshotter

// OpenStack CSI
OpenstackCSI
OpenstackCSINodeDriverRegistar
OpenstackCSILivenessProbe
OpenstackCSIAttacher
OpenstackCSIProvisioner
OpenstackCSIResizer
OpenstackCSISnapshotter

// CCMs and CSI plugins
DigitaloceanCCM
HetznerCCM
HetznerCSI
OpenstackCCM
OpenstackCSI
EquinixMetalCCM
VsphereCCM
VsphereCSIDriver
Expand Down Expand Up @@ -268,21 +276,27 @@ func optionalResources() map[Resource]map[string]string {

// OpenStack CCM
OpenstackCCM: {
"1.19.x": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.19.2",
"1.20.x": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.20.2",
"1.21.x": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.21.0",
"1.22.x": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.22.0",
">= 1.23.0": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.23.0",
"1.23.x": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.23.1",
">= 1.24.0": "docker.io/k8scloudprovider/openstack-cloud-controller-manager:v1.24.0",
},

// OpenStack CSI
OpenstackCSI: {
"1.19.x": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.19.0",
"1.20.x": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.20.3",
"1.21.x": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.21.0",
"1.22.x": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.22.0",
">= 1.23.0": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.23.0",
"1.23.x": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.23.0",
">= 1.24.0": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.24.0",
},
OpenstackCSINodeDriverRegistar: {"*": "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.5.0"},
OpenstackCSILivenessProbe: {"*": "k8s.gcr.io/sig-storage/livenessprobe:v2.6.0"},
OpenstackCSIAttacher: {"*": "k8s.gcr.io/sig-storage/csi-attacher:v3.4.0"},
OpenstackCSIProvisioner: {"*": "k8s.gcr.io/sig-storage/csi-provisioner:v3.1.0"},
OpenstackCSIResizer: {"*": "k8s.gcr.io/sig-storage/csi-resizer:v1.4.0"},
OpenstackCSISnapshotter: {"*": "k8s.gcr.io/sig-storage/csi-snapshotter:v5.0.1"},

// Equinix Metal CCM
EquinixMetalCCM: {"*": "docker.io/equinix/cloud-provider-equinix-metal:v3.4.2"},
Expand Down
36 changes: 21 additions & 15 deletions pkg/templates/images/resource_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.