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

KRV-20573/csm status #446

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -16,7 +16,7 @@ spec:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
csm: application-mobility
csm: <NAME>
spec:
containers:
- args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ spec:
metadata:
labels:
name: application-mobility-velero
csm: application-mobility
csm: <NAME>
app.kubernetes.io/name: application-mobility-velero
app.kubernetes.io/instance: application-mobility

Expand Down
6 changes: 3 additions & 3 deletions operatorconfig/moduleconfig/common/cert-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ spec:
metadata:
labels:
app: cainjector
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: <NAMESPACE>
app.kubernetes.io/component: "cainjector"
Expand Down Expand Up @@ -883,7 +883,7 @@ spec:
metadata:
labels:
app: cert-manager
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: <NAMESPACE>
app.kubernetes.io/component: "controller"
Expand Down Expand Up @@ -948,7 +948,7 @@ spec:
metadata:
labels:
app: webhook
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: <NAMESPACE>
app.kubernetes.io/component: "webhook"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5257,7 +5257,7 @@ spec:
metadata:
labels:
app: cainjector
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: cainjector
app.kubernetes.io/instance: cert-manager
app.kubernetes.io/component: "cainjector"
Expand Down Expand Up @@ -5311,7 +5311,7 @@ spec:
metadata:
labels:
app: cert-manager
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: cert-manager
app.kubernetes.io/instance: cert-manager
app.kubernetes.io/component: "controller"
Expand Down Expand Up @@ -5376,7 +5376,7 @@ spec:
metadata:
labels:
app: webhook
csm: cert-manager
csm: <NAME>
app.kubernetes.io/name: webhook
app.kubernetes.io/instance: cert-manager
app.kubernetes.io/component: "webhook"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
labels:
app.kubernetes.io/name: karavi-metrics-powerflex
app.kubernetes.io/instance: karavi
csm: <NAME>
spec:
serviceAccount: karavi-metrics-powerflex-controller
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ spec:
labels:
app.kubernetes.io/name: karavi-metrics-powermax
app.kubernetes.io/instance: karavi
csm: <NAME>
spec:
serviceAccountName: karavi-metrics-powermax-controller
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ spec:
labels:
app.kubernetes.io/name: karavi-metrics-powerscale
app.kubernetes.io/instance: karavi
csm: <NAME>
spec:
serviceAccount: karavi-metrics-powerscale-controller
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ spec:
labels:
app.kubernetes.io/name: otel-collector
app.kubernetes.io/instance: karavi-observability
csm: <NAME>
spec:
volumes:
- name: tls-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ spec:
labels:
app.kubernetes.io/name: karavi-topology
app.kubernetes.io/instance: karavi-observability
csm: <NAME>
spec:
volumes:
- name: karavi-topology-secret-volume
Expand Down
6 changes: 5 additions & 1 deletion pkg/modules/application_mobility.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ const (
AppMobCertManagerComponent = "cert-manager"
// AppMobVeleroComponent - velero component
AppMobVeleroComponent = "velero"
// CSMName - name
CSMName = "<NAME>"
)

// getAppMobilityModule - get instance of app mobility module
Expand Down Expand Up @@ -250,7 +252,8 @@ func getAppMobilityModuleDeployment(op utils.OperatorConfig, cr csmv1.ContainerS
}
}

yamlString = strings.ReplaceAll(yamlString, AppMobNamespace, cr.Namespace)
yamlString = strings.ReplaceAll(yamlString, CSMName, cr.Name)
yamlString = strings.ReplaceAll(yamlString,AppMobNamespace, cr.Namespace )
yamlString = strings.ReplaceAll(yamlString, ControllerImg, controllerImage)
yamlString = strings.ReplaceAll(yamlString, ControllerImagePullPolicy, controllerImagePullPolicy)
yamlString = strings.ReplaceAll(yamlString, AppMobReplicaCount, replicaCount)
Expand Down Expand Up @@ -652,6 +655,7 @@ func getVelero(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (string
}
}

yamlString = strings.ReplaceAll(yamlString, CSMName, cr.Name)
yamlString = strings.ReplaceAll(yamlString, AppMobNamespace, cr.Namespace)
yamlString = strings.ReplaceAll(yamlString, VeleroImage, veleroImg)
yamlString = strings.ReplaceAll(yamlString, VeleroImagePullPolicy, veleroImgPullPolicy)
Expand Down
1 change: 1 addition & 0 deletions pkg/modules/commonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func getCertManager(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (s
YamlString = string(buf)
certNamespace := cr.Namespace
YamlString = strings.ReplaceAll(YamlString, CommonNamespace, certNamespace)
YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)

return YamlString, nil
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/modules/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ func getTopology(op utils.OperatorConfig, cr csmv1.ContainerStorageModule) (stri
}
}

YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhi16394 I saw you declared a variable "CSMName = """ in application_mobility.go . I don't see the same declaration in Observability.go and commonconfig.go. Will it append the attribute to yaml if it does not exist ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the variable declaration is global and all other files come under package module,
We dont have to redeclare the variable "CSMName" again in other files.

YamlString = strings.ReplaceAll(YamlString, TopologyLogLevel, logLevel)
YamlString = strings.ReplaceAll(YamlString, TopologyImage, topologyImage)
return YamlString, nil
Expand Down Expand Up @@ -354,6 +355,7 @@ func getOtelCollector(op utils.OperatorConfig, cr csmv1.ContainerStorageModule)
}
}

YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)
YamlString = strings.ReplaceAll(YamlString, OtelCollectorImage, otelCollectorImage)
YamlString = strings.ReplaceAll(YamlString, NginxProxyImage, nginxProxyImage)
return YamlString, nil
Expand Down Expand Up @@ -499,6 +501,7 @@ func getPowerScaleMetricsObjects(op utils.OperatorConfig, cr csmv1.ContainerStor
}
}

YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)
YamlString = strings.ReplaceAll(YamlString, PowerScaleImage, pscaleImage)
YamlString = strings.ReplaceAll(YamlString, PowerscaleLogLevel, logLevel)
YamlString = strings.ReplaceAll(YamlString, PowerScaleMaxConcurrentQueries, maxConcurrentQueries)
Expand Down Expand Up @@ -699,6 +702,7 @@ func getPowerFlexMetricsObject(op utils.OperatorConfig, cr csmv1.ContainerStorag
}
}

YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)
YamlString = strings.ReplaceAll(YamlString, PowerflexImage, pflexImage)
YamlString = strings.ReplaceAll(YamlString, PowerflexLogLevel, logLevel)
YamlString = strings.ReplaceAll(YamlString, PowerflexMaxConcurrentQueries, maxConcurrentQueries)
Expand Down Expand Up @@ -919,6 +923,7 @@ func getPowerMaxMetricsObject(op utils.OperatorConfig, cr csmv1.ContainerStorage
}
}

YamlString = strings.ReplaceAll(YamlString, CSMName, cr.Name)
YamlString = strings.ReplaceAll(YamlString, PmaxObsImage, pmaxImage)
YamlString = strings.ReplaceAll(YamlString, PmaxLogLevel, logLevel)
YamlString = strings.ReplaceAll(YamlString, PmaxLogFormat, logFormat)
Expand Down
Loading