Skip to content

Commit 315b436

Browse files
tremesfalox
andauthored
feat: add cluster-health-analyzer v0.5.1 (#785)
Co-authored-by: Alberto Falossi <afalossi@redhat.com>
1 parent 84abac4 commit 315b436

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

cmd/operator/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var defaultImages = map[string]string{
4747
"ui-logging-pf4": "quay.io/openshift-observability-ui/logging-view-plugin:v6.0.0",
4848
"ui-logging": "quay.io/openshift-observability-ui/logging-view-plugin:v6.1.1",
4949
"korrel8r": "quay.io/korrel8r/korrel8r:release-coo-1.2",
50-
"health-analyzer": "quay.io/openshiftanalytics/cluster-health-analyzer:v0.5.0",
50+
"health-analyzer": "quay.io/openshiftanalytics/cluster-health-analyzer:v0.5.1",
5151
"ui-monitoring-pf5": "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.4.0",
5252
"ui-monitoring": "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.5.0",
5353
"perses": "quay.io/persesdev/perses:v0.50.3",

pkg/controllers/uiplugin/components.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func pluginComponentReconcilers(plugin *uiv1alpha1.UIPlugin, pluginInfo UIPlugin
117117
components = append(components, reconciler.NewUpdater(newHealthAnalyzerPrometheusRole(namespace), plugin))
118118
components = append(components, reconciler.NewUpdater(newHealthAnalyzerPrometheusRoleBinding(namespace), plugin))
119119
components = append(components, reconciler.NewUpdater(newHealthAnalyzerService(namespace), plugin))
120+
components = append(components, reconciler.NewUpdater(newHealthAnalyzerServiceMCP(namespace), plugin))
120121
components = append(components, reconciler.NewUpdater(newHealthAnalyzerDeployment(namespace, serviceAccountName, pluginInfo), plugin))
121122
components = append(components, reconciler.NewUpdater(newHealthAnalyzerServiceMonitor(namespace), plugin))
122123
}

pkg/controllers/uiplugin/health_analyzer.go

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,37 @@ func newHealthAnalyzerService(namespace string) *corev1.Service {
9494
return service
9595
}
9696

97+
func newHealthAnalyzerServiceMCP(namespace string) *corev1.Service {
98+
service := &corev1.Service{
99+
TypeMeta: metav1.TypeMeta{
100+
APIVersion: corev1.SchemeGroupVersion.String(),
101+
Kind: "Service",
102+
},
103+
ObjectMeta: metav1.ObjectMeta{
104+
Name: name + "-mcp",
105+
Namespace: namespace,
106+
Annotations: map[string]string{
107+
"service.beta.openshift.io/serving-cert-secret-name": volumeMountName,
108+
},
109+
Labels: componentLabels(name),
110+
},
111+
Spec: corev1.ServiceSpec{
112+
Ports: []corev1.ServicePort{
113+
{
114+
Name: "mcp",
115+
Port: 8085,
116+
TargetPort: intstr.FromString("mcp"),
117+
},
118+
},
119+
Selector: map[string]string{
120+
"app.kubernetes.io/instance": name,
121+
},
122+
},
123+
}
124+
125+
return service
126+
}
127+
97128
func newHealthAnalyzerDeployment(namespace string, serviceAccountName string, pluginInfo UIPluginInfo) *appsv1.Deployment {
98129
deploy := &appsv1.Deployment{
99130
TypeMeta: metav1.TypeMeta{
@@ -125,6 +156,7 @@ func newHealthAnalyzerDeployment(namespace string, serviceAccountName string, pl
125156
Image: pluginInfo.HealthAnalyzerImage,
126157
ImagePullPolicy: corev1.PullAlways,
127158
Args: []string{
159+
"serve",
128160
"--tls-cert-file=/etc/tls/private/tls.crt",
129161
"--tls-private-key-file=/etc/tls/private/tls.key",
130162
},
@@ -159,6 +191,37 @@ func newHealthAnalyzerDeployment(namespace string, serviceAccountName string, pl
159191
},
160192
},
161193
},
194+
{
195+
Name: name + "mcp",
196+
Image: pluginInfo.HealthAnalyzerImage,
197+
ImagePullPolicy: corev1.PullAlways,
198+
Args: []string{
199+
"mcp",
200+
},
201+
Env: []corev1.EnvVar{
202+
{
203+
Name: "PROM_URL",
204+
Value: "https://thanos-querier.openshift-monitoring.svc.cluster.local:9091/",
205+
},
206+
},
207+
SecurityContext: &corev1.SecurityContext{
208+
RunAsNonRoot: ptr.To(true),
209+
AllowPrivilegeEscalation: ptr.To(false),
210+
Capabilities: &corev1.Capabilities{
211+
Drop: []corev1.Capability{"ALL"},
212+
},
213+
SeccompProfile: &corev1.SeccompProfile{
214+
Type: corev1.SeccompProfileTypeRuntimeDefault,
215+
},
216+
},
217+
Ports: []corev1.ContainerPort{
218+
{
219+
ContainerPort: 8085,
220+
Name: "mcp",
221+
},
222+
},
223+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
224+
},
162225
},
163226
Volumes: []corev1.Volume{
164227
{

0 commit comments

Comments
 (0)