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

Pmax minimal changes #655

Merged
merged 3 commits into from
Aug 12, 2024
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
9 changes: 8 additions & 1 deletion operatorconfig/driverconfig/powermax/v2.11.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ spec:
- name: socket-dir
mountPath: /var/run/csi
- name: driver
image: dellemc/csi-powermax:v2.11.0
image: amaas-eos-drm2.cec.lab.emc.com:5074/csm/powermax/csi-powermax:minimal-poc
imagePullPolicy: IfNotPresent
command: ["/csi-powermax.sh"]
env:
Expand Down Expand Up @@ -283,6 +283,8 @@ spec:
value: 5m
- name: X_CSI_POWERMAX_CONFIG_PATH
value: /powermax-config-params/driver-config-params.yaml
- name: X_CSI_POWERMAX_ARRAY_CONFIG_PATH
value: /powermax-array-config/powermax-array-config.yaml
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "<X_CSI_HEALTH_MONITOR_ENABLED>"
- name: X_CSI_VSPHERE_ENABLED
Expand Down Expand Up @@ -313,6 +315,8 @@ spec:
readOnly: true
- name: powermax-config-params
mountPath: <DriverDefaultReleaseName>-config-params
- name: powermax-array-config
mountPath: /powermax-array-config
volumes:
- name: socket-dir
emptyDir:
Expand All @@ -323,5 +327,8 @@ spec:
- name: powermax-config-params
configMap:
name: <DriverDefaultReleaseName>-config-params
- name: powermax-array-config
configMap:
name: powermax-array-config
- name: cert-dir
emptyDir:
9 changes: 8 additions & 1 deletion operatorconfig/driverconfig/powermax/v2.11.0/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: dellemc/csi-powermax:v2.11.0
image: amaas-eos-drm2.cec.lab.emc.com:5074/csm/powermax/csi-powermax:minimal-poc
imagePullPolicy: IfNotPresent
env:
- name: X_CSI_POWERMAX_DRIVER_NAME
Expand Down Expand Up @@ -137,6 +137,8 @@ spec:
value: /certs
- name: X_CSI_POWERMAX_CONFIG_PATH
value: /powermax-config-params/driver-config-params.yaml
- name: X_CSI_POWERMAX_ARRAY_CONFIG_PATH
value: /powermax-array-config/powermax-array-config.yaml
- name: X_CSI_POWERMAX_TOPOLOGY_CONFIG_PATH
value: /node-topology-config/topologyConfig.yaml
- name: X_CSI_IG_NODENAME_TEMPLATE
Expand Down Expand Up @@ -196,6 +198,8 @@ spec:
readOnly: true
- name: powermax-config-params
mountPath: /powermax-config-params
- name: powermax-array-config
mountPath: /powermax-array-config
- name: node-topology-config
mountPath: /node-topology-config
- name: registrar
Expand Down Expand Up @@ -261,6 +265,9 @@ spec:
- name: powermax-config-params
configMap:
name: <DriverDefaultReleaseName>-config-params
- name: powermax-array-config
configMap:
name: powermax-array-config
- name: node-topology-config
configMap:
name: node-topology-config
Expand Down
15 changes: 14 additions & 1 deletion pkg/drivers/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,18 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope
}
}
}

kubeletConfigDirFound := false
for _, env := range cr.Spec.Driver.Common.Envs {
if env.Name == "KUBELET_CONFIG_DIR" {
kubeletConfigDirFound = true
}
}
if !kubeletConfigDirFound {
cr.Spec.Driver.Common.Envs = append(cr.Spec.Driver.Common.Envs, corev1.EnvVar{
Name: "KUBELET_CONFIG_DIR",
Value: "/var/lib/kubelet",
})
}
foundRevProxy := false
for _, mod := range cr.Spec.Modules {
if mod.Name == csmv1.ReverseProxy {
Expand Down Expand Up @@ -178,6 +189,7 @@ func ModifyPowermaxCR(yamlString string, cr csmv1.ContainerStorageModule, fileTy
maxVolumesPerNode = env.Value
}
}

yamlString = strings.ReplaceAll(yamlString, CSIPmaxManagedArray, managedArray)
yamlString = strings.ReplaceAll(yamlString, CSIPmaxEndpoint, endpoint)
yamlString = strings.ReplaceAll(yamlString, CSIPmaxClusterPrefix, clusterPrefix)
Expand Down Expand Up @@ -259,6 +271,7 @@ func ModifyPowermaxCR(yamlString string, cr csmv1.ContainerStorageModule, fileTy
}
yamlString = strings.ReplaceAll(yamlString, CsiStorageCapacityEnabled, storageCapacity)
}

return yamlString
}

Expand Down
18 changes: 18 additions & 0 deletions samples/minimal-samples/powermax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: storage.dell.com/v1
kind: ContainerStorageModule
metadata:
name: powermax
namespace: powermax
spec:
driver:
csiDriverType: "powermax"
configVersion: v2.11.0
forceRemoveDriver: true
modules:
- name: csireverseproxy
enabled: true
forceRemoveModule: true
configVersion: v2.10.0
components:
- name: csipowermax-reverseproxy
image: dellemc/csipowermax-reverseproxy:v2.10.0
Loading