Skip to content

Commit

Permalink
Adds obsv samples for powermax (#299)
Browse files Browse the repository at this point in the history
Adds unit test for obsv and e2e for powermax
  • Loading branch information
delldubey authored Aug 31, 2023
1 parent d1a4e68 commit dbbf9ff
Show file tree
Hide file tree
Showing 23 changed files with 1,534 additions and 20 deletions.
5 changes: 3 additions & 2 deletions controllers/csm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ func (r *ContainerStorageModuleReconciler) reconcileObservability(ctx context.Co
metricsComp2reconFunc := map[string]func(context.Context, bool, utils.OperatorConfig, csmv1.ContainerStorageModule, client.Client, kubernetes.Interface) error{
modules.ObservabilityMetricsPowerScaleName: modules.PowerScaleMetrics,
modules.ObservabilityMetricsPowerFlexName: modules.PowerFlexMetrics,
modules.ObservabilityMetricsPowerMaxName: modules.PowerMaxMetrics,
}

for _, comp := range components {
Expand All @@ -819,7 +820,7 @@ func (r *ContainerStorageModuleReconciler) reconcileObservability(ctx context.Co
switch comp {
case modules.ObservabilityTopologyName, modules.ObservabilityOtelCollectorName, modules.ObservabilityCertManagerComponent:
err = comp2reconFunc[comp](ctx, isDeleting, op, cr, ctrlClient)
case modules.ObservabilityMetricsPowerScaleName, modules.ObservabilityMetricsPowerFlexName:
case modules.ObservabilityMetricsPowerScaleName, modules.ObservabilityMetricsPowerFlexName, modules.ObservabilityMetricsPowerMaxName:
err = metricsComp2reconFunc[comp](ctx, isDeleting, op, cr, ctrlClient, k8sClient)
default:
err = fmt.Errorf("unsupported component type: %v", comp)
Expand Down Expand Up @@ -1198,7 +1199,7 @@ func checkUpgrade(ctx context.Context, cr *csmv1.ContainerStorageModule, operato

// If annotation exists, we are doing an upgrade or modify
if configVersionExists {
// if versions are equal, it is a modify
// if versions are equal, it is a modification
if oldVersion == cr.Spec.Driver.ConfigVersion {
log.Infow("proceeding with modification of driver install")
return true, nil
Expand Down
4 changes: 2 additions & 2 deletions operatorconfig/driverconfig/powermax/v2.6.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ spec:
value: "<X_CSI_IG_MODIFY_HOSTNAME>"
- name: X_CSI_POWERMAX_PROXY_SERVICE_NAME
value: "csipowermax-reverseproxy"
- name: X_CSI_ReplicationContextPrefix
- name: X_CSI_REPLICATION_CONTEXT_PREFIX
value: powermax/
- name: X_CSI_ReplicationPrefix
- name: X_CSI_REPLICATION_PREFIX
value: replication.storage.dell.com/
- name: X_CSI_UNISPHERE_TIMEOUT
value: 5m
Expand Down
4 changes: 2 additions & 2 deletions operatorconfig/driverconfig/powermax/v2.7.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ spec:
value: "<X_CSI_IG_MODIFY_HOSTNAME>"
- name: X_CSI_POWERMAX_PROXY_SERVICE_NAME
value: "csipowermax-reverseproxy"
- name: X_CSI_ReplicationContextPrefix
- name: X_CSI_REPLICATION_CONTEXT_PREFIX
value: powermax/
- name: X_CSI_ReplicationPrefix
- name: X_CSI_REPLICATION_PREFIX
value: replication.storage.dell.com/
- name: X_CSI_UNISPHERE_TIMEOUT
value: 5m
Expand Down
4 changes: 2 additions & 2 deletions operatorconfig/driverconfig/powermax/v2.8.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ spec:
value: "<X_CSI_IG_MODIFY_HOSTNAME>"
- name: X_CSI_POWERMAX_PROXY_SERVICE_NAME
value: "csipowermax-reverseproxy"
- name: X_CSI_ReplicationContextPrefix
- name: X_CSI_REPLICATION_CONTEXT_PREFIX
value: powermax/
- name: X_CSI_ReplicationPrefix
- name: X_CSI_REPLICATION_PREFIX
value: replication.storage.dell.com/
- name: X_CSI_UNISPHERE_TIMEOUT
value: 5m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: karavi
data:
karavi-topology.yaml: |
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com, csi-powermax.dellemc.com
LOG_LEVEL: <TOPOLOGY_LOG_LEVEL>
LOG_FORMAT: text
ZIPKIN_URI: ""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: karavi-metrics-powermax-controller
namespace: karavi

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: karavi-metrics-powermax-controller
rules:
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes", "storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes", "nodes"]
verbs: ["list"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["*"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["list", "watch", "get"]
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: karavi-metrics-powermax-controller
subjects:
- kind: ServiceAccount
name: karavi-metrics-powermax-controller
namespace: karavi
roleRef:
kind: ClusterRole
name: karavi-metrics-powermax-controller
apiGroup: rbac.authorization.k8s.io

---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi
name: karavi-metrics-powermax
namespace: karavi
spec:
type: ClusterIP
ports:
- name: karavi-metrics-powermax
port: 8081
targetPort: 8081
selector:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi

---

apiVersion: v1
kind: ConfigMap
metadata:
name: karavi-metrics-powermax-configmap
namespace: karavi
data:
karavi-metrics-powermax.yaml : |
COLLECTOR_ADDR: <COLLECTOR_ADDRESS>
PROVISIONER_NAMES: csi-powermax.dellemc.com
POWERMAX_CAPACITY_METRICS_ENABLED: <POWERMAX_CAPACITY_METRICS_ENABLED>
POWERMAX_CAPACITY_POLL_FREQUENCY: <POWERMAX_CAPACITY_POLL_FREQUENCY>
POWERMAX_PERFORMANCE_METRICS_ENABLED: <POWERMAX_PERFORMANCE_METRICS_ENABLED>
POWERMAX_PERFORMANCE_POLL_FREQUENCY: <POWERMAX_PERFORMANCE_POLL_FREQUENCY>
POWERMAX_MAX_CONCURRENT_QUERIES: <POWERMAX_MAX_CONCURRENT_QUERIES>
LOG_LEVEL: <POWERMAX_LOG_LEVEL>
LOG_FORMAT: <POWERMAX_LOG_FORMAT>
---

apiVersion: v1
kind: ConfigMap
metadata:
name: <DriverDefaultReleaseName>-config-params
namespace: karavi
data:
driver-config-params.yaml: |
CSI_LOG_LEVEL: debug
CSI_LOG_FORMAT: TEXT
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: karavi-metrics-powermax
namespace: karavi
labels:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi
spec:
selector:
matchLabels:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi
replicas: 1
strategy: {}
template:
metadata:
labels:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi
spec:
serviceAccountName: karavi-metrics-powermax-controller
containers:
- name: karavi-metrics-powermax
image: <POWERMAX_OBS_IMAGE>
resources: {}
env:
- name: POWERMAX_METRICS_ENDPOINT
value: "karavi-metrics-powermax"
- name: POWERMAX_METRICS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TLS_ENABLED
value: "true"
- name: SSL_CERT_DIR
value: /certs
volumeMounts:
- name: <X_CSI_CONFIG_MAP_NAME>
mountPath: /etc/reverseproxy
- name: tls-secret
mountPath: /etc/ssl/certs
readOnly: true
- name: karavi-metrics-powermax-configmap
mountPath: /etc/config
- name: certs
mountPath: /certs
volumes:
- name: certs
emptyDir: { }
- name: <X_CSI_CONFIG_MAP_NAME>
configMap:
name: <X_CSI_CONFIG_MAP_NAME>
- name: tls-secret
secret:
secretName: otel-collector-tls
items:
- key: tls.crt
path: cert.crt
- name: karavi-metrics-powermax-configmap
configMap:
name: karavi-metrics-powermax-configmap
- name: powermax-config-params
configMap:
name: <DriverDefaultReleaseName>-config-params
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: karavi
data:
karavi-topology.yaml: |
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com, csi-powermax.dellemc.com
LOG_LEVEL: <TOPOLOGY_LOG_LEVEL>
LOG_FORMAT: text
ZIPKIN_URI: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: karavi
data:
karavi-topology.yaml: |
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com
PROVISIONER_NAMES: csi-isilon.dellemc.com,csi-vxflexos.dellemc.com, csi-powermax.dellemc.com
LOG_LEVEL: <TOPOLOGY_LOG_LEVEL>
LOG_FORMAT: text
ZIPKIN_URI: ""
Expand Down
Loading

0 comments on commit dbbf9ff

Please sign in to comment.