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

Feature StorageCapacityTracking for Powermax #281

Merged
merged 1 commit into from
Jul 10, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ metadata:
"value": ""
}
],
"image": "dellemc/csi-powermax:v2.7.0",
"image": "dellemc/csi-powermax:v2.8.0",
"imagePullPolicy": "IfNotPresent"
},
"configVersion": "v2.7.0",
"configVersion": "v2.8.0",
"controller": {
"envs": [
{
Expand All @@ -409,7 +409,7 @@ metadata:
},
"csiDriverSpec": {
"fSGroupPolicy": "ReadWriteOnceWithFSType",
"storageCapacity": false
"storageCapacity": true
},
"csiDriverType": "powermax",
"dnsPolicy": "ClusterFirstWithHostNet",
Expand Down
10 changes: 5 additions & 5 deletions config/samples/storage_v1_csm_powermax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ spec:
# Allowed values:
# true: enable storage capacity tracking
# false: disable storage capacity tracking
storageCapacity: false
# Config version for CSI PowerMax v2.7.0 driver
configVersion: v2.7.0
storageCapacity: true
# Config version for CSI PowerMax v2.8.0 driver
configVersion: v2.8.0
# replica: Define the number of PowerMax controller nodes
# to deploy to the Kubernetes release
# Allowed values: n, where n > 0
Expand All @@ -44,8 +44,8 @@ spec:
forceUpdate: false
forceRemoveDriver: true
common:
# Image for CSI PowerMax driver v2.7.0
image: dellemc/csi-powermax:v2.7.0
# Image for CSI PowerMax driver v2.8.0
image: dellemc/csi-powermax:v2.8.0
# imagePullPolicy: Policy to determine if the image should be pulled prior to starting the container.
# Allowed values:
# Always: Always pull the image.
Expand Down
328 changes: 328 additions & 0 deletions operatorconfig/driverconfig/powermax/v2.8.0/controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
# Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: ServiceAccount
metadata:
name: <DriverDefaultReleaseName>-controller
namespace: <DriverDefaultReleaseNamespace>
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: <DriverDefaultReleaseName>-controller
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments/status"]
verbs: ["patch"]
- apiGroups: ["csi.storage.k8s.io"]
resources: ["csinodeinfos"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch", "update"]
# below for snapshotter
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots", "volumesnapshots/status"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update", "patch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["create", "list", "watch", "delete"]
# below for resizer
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["update", "patch"]
- apiGroups: [""]
resources: ["persistentvolumeclaims/status"]
verbs: ["update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"]
# Permissions for CSIStorageCapacity
- apiGroups: ["storage.k8s.io"]
resources: ["csistoragecapacities"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get"]
- apiGroups: ["apps"]
resources: ["replicasets"]
verbs: ["get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: <DriverDefaultReleaseName>-controller
subjects:
- kind: ServiceAccount
name: <DriverDefaultReleaseName>-controller
namespace: <DriverDefaultReleaseNamespace>
roleRef:
kind: ClusterRole
name: <DriverDefaultReleaseName>-controller
apiGroup: rbac.authorization.k8s.io
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: <DriverDefaultReleaseName>-controller
namespace: <DriverDefaultReleaseNamespace>
spec:
selector:
matchLabels:
app: <DriverDefaultReleaseName>-controller
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
app: <DriverDefaultReleaseName>-controller
spec:
serviceAccount: <DriverDefaultReleaseName>-controller
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- <DriverDefaultReleaseName>-controller
topologyKey: kubernetes.io/hostname

containers:
- name: resizer
image: registry.k8s.io/sig-storage/csi-resizer:v1.8.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--leader-election"
- "--timeout=180s"
- "--v=5"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: attacher
image: registry.k8s.io/sig-storage/csi-attacher:v4.3.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--leader-election"
- "--timeout=180s"
- "--worker-threads=6"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: external-health-monitor
image: registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.9.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--leader-election"
- "--enable-node-watcher=true"
- "--monitor-interval=60s"
- "--timeout=180s"
- "--http-endpoint=:8080"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: provisioner
image: registry.k8s.io/sig-storage/csi-provisioner:v3.5.0
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--volume-name-prefix=pmax"
- "--volume-name-uuid-length=10"
- "--worker-threads=6"
- "--timeout=120s"
- "--v=5"
- "--feature-gates=Topology=true"
- "--leader-election"
- "--extra-create-metadata"
- "--default-fstype=ext4"
- "--enable-capacity=true"
- "--capacity-ownerref-level=2"
- "--capacity-poll-interval=5m"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: snapshotter
image: registry.k8s.io/sig-storage/csi-snapshotter:v6.2.2
imagePullPolicy: IfNotPresent
args:
- "--csi-address=$(ADDRESS)"
- "--timeout=180s"
- "--v=5"
- "--snapshot-name-prefix=pmsn"
- "--leader-election"
- "--snapshot-name-uuid-length=10"
env:
- name: ADDRESS
value: /var/run/csi/csi.sock
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: driver
image: dellemc/csi-powermax:v2.8.0
imagePullPolicy: IfNotPresent
command: [ "/csi-powermax.sh" ]
args:
- "--leader-election"
env:
- name: X_CSI_POWERMAX_DRIVER_NAME
value: csi-powermax.dellemc.com
- name: CSI_ENDPOINT
value: /var/run/csi/csi.sock
- name: X_CSI_MANAGED_ARRAYS
value: "<X_CSI_MANAGED_ARRAY>"
- name: X_CSI_POWERMAX_ENDPOINT
value: "<X_CSI_POWERMAX_ENDPOINT>"
- name: X_CSI_K8S_CLUSTER_PREFIX
value: "<X_CSI_K8S_CLUSTER_PREFIX>"
- name: X_CSI_MODE
value: controller
- name: X_CSI_POWERMAX_SKIP_CERTIFICATE_VALIDATION
value: "true"
- name: X_CSI_POWERMAX_USER
valueFrom:
secretKeyRef:
key: username
name: powermax-creds
- name: X_CSI_POWERMAX_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: powermax-creds
- name: X_CSI_POWERMAX_DEBUG
value: "<X_CSI_POWERMAX_DEBUG>"
- name: X_CSI_POWERMAX_PORTGROUPS
value: "<X_CSI_POWERMAX_PORTGROUPS>"
- name: X_CSI_GRPC_MAX_THREADS
value: "50"
- name: X_CSI_ENABLE_BLOCK
value: "true"
- name: X_CSI_TRANSPORT_PROTOCOL
value: "<X_CSI_TRANSPORT_PROTOCOL>"
- name: SSL_CERT_DIR
value: /certs
- name: X_CSI_IG_NODENAME_TEMPLATE
value: "<X_CSI_IG_NODENAME_TEMPLATE>"
- name: X_CSI_IG_MODIFY_HOSTNAME
value: "<X_CSI_IG_MODIFY_HOSTNAME>"
- name: X_CSI_POWERMAX_PROXY_SERVICE_NAME
value: "csipowermax-reverseproxy"
- name: X_CSI_ReplicationContextPrefix
value: powermax/
- name: X_CSI_ReplicationPrefix
value: replication.storage.dell.com/
- name: X_CSI_UNISPHERE_TIMEOUT
value: 5m
- name: X_CSI_POWERMAX_CONFIG_PATH
value: /powermax-config-params/driver-config-params.yaml
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "<X_CSI_HEALTH_MONITOR_ENABLED>"
- name: X_CSI_VSPHERE_ENABLED
value: "<X_CSI_VSPHERE_ENABLED>"
- name: X_CSI_VSPHERE_PORTGROUP
value: "<X_CSI_VSPHERE_PORTGROUP>"
- name: X_CSI_VSPHERE_HOSTNAME
value: "<X_CSI_VSPHERE_HOSTNAME>"
- name: X_CSI_VCENTER_HOST
value: "<X_CSI_VCENTER_HOST>"
- name: X_CSI_VCENTER_USERNAME
valueFrom:
secretKeyRef:
key: username
name: vcenter-creds
optional: true
- name: X_CSI_VCENTER_PWD
valueFrom:
secretKeyRef:
key: password
name: vcenter-creds
optional: true
volumeMounts:
- name: socket-dir
mountPath: /var/run/csi
- name: certs
mountPath: /certs
readOnly: true
- name: powermax-config-params
mountPath: <DriverDefaultReleaseName>-config-params
volumes:
- name: socket-dir
emptyDir:
- name: certs
secret:
secretName: <DriverDefaultReleaseName>-certs
optional: true
- name: powermax-config-params
configMap:
name: <DriverDefaultReleaseName>-config-params
23 changes: 23 additions & 0 deletions operatorconfig/driverconfig/powermax/v2.8.0/csidriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: csi-powermax.dellemc.com
spec:
attachRequired: true
podInfoOnMount: true
storageCapacity: true
fsGroupPolicy: ReadWriteOnceWithFSType
volumeLifecycleModes:
- Persistent
Loading
Loading