From 6148c3760d701768e442186d4e7d574c7dc16c91 Mon Sep 17 00:00:00 2001 From: Aleksei <37804671+aleert@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:25:13 +0300 Subject: [PATCH] fix(operator): add alertmanager client config to ruler template (#13182) --- operator/apis/loki/v1/rulerconfig_types.go | 7 + .../apis/loki/v1/zz_generated.deepcopy.go | 5 + .../loki-operator.clusterserviceversion.yaml | 8 +- .../loki.grafana.com_rulerconfigs.yaml | 6 + .../loki-operator.clusterserviceversion.yaml | 8 +- .../loki.grafana.com_rulerconfigs.yaml | 6 + .../loki-operator.clusterserviceversion.yaml | 8 +- .../loki.grafana.com_rulerconfigs.yaml | 6 + .../bases/loki.grafana.com_rulerconfigs.yaml | 6 + .../loki-operator.clusterserviceversion.yaml | 6 + .../loki-operator.clusterserviceversion.yaml | 6 + .../loki-operator.clusterserviceversion.yaml | 6 + operator/docs/operator/api.md | 12 + operator/internal/manifests/config.go | 9 +- .../manifests/internal/config/build_test.go | 388 ++++++++++++++++++ .../internal/config/loki-config.yaml | 41 ++ 16 files changed, 521 insertions(+), 7 deletions(-) diff --git a/operator/apis/loki/v1/rulerconfig_types.go b/operator/apis/loki/v1/rulerconfig_types.go index d8ca91523da8..8321d2bc6701 100644 --- a/operator/apis/loki/v1/rulerconfig_types.go +++ b/operator/apis/loki/v1/rulerconfig_types.go @@ -221,6 +221,13 @@ type AlertManagerClientTLSConfig struct { // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Key Path" KeyPath *string `json:"keyPath,omitempty"` + + // Skip validating server certificate. + // + // +optional + // +kubebuilder:validation:Optional + // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Skip validating server certificate" + InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"` } // RemoteWriteAuthType defines the type of authorization to use to access the remote write endpoint. diff --git a/operator/apis/loki/v1/zz_generated.deepcopy.go b/operator/apis/loki/v1/zz_generated.deepcopy.go index 03b8e5ad0b9e..c7206c5ab660 100644 --- a/operator/apis/loki/v1/zz_generated.deepcopy.go +++ b/operator/apis/loki/v1/zz_generated.deepcopy.go @@ -118,6 +118,11 @@ func (in *AlertManagerClientTLSConfig) DeepCopyInto(out *AlertManagerClientTLSCo *out = new(string) **out = **in } + if in.InsecureSkipVerify != nil { + in, out := &in.InsecureSkipVerify, &out.InsecureSkipVerify + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertManagerClientTLSConfig. diff --git a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml index b77a51c3574a..bd28187a5f01 100644 --- a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.1 - createdAt: "2024-06-04T16:17:47Z" + createdAt: "2024-06-12T17:07:27Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. features.operators.openshift.io/disconnected: "true" @@ -995,6 +995,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1144,6 +1147,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/bundle/community-openshift/manifests/loki.grafana.com_rulerconfigs.yaml b/operator/bundle/community-openshift/manifests/loki.grafana.com_rulerconfigs.yaml index 1969480f8437..d7af1c24bad2 100644 --- a/operator/bundle/community-openshift/manifests/loki.grafana.com_rulerconfigs.yaml +++ b/operator/bundle/community-openshift/manifests/loki.grafana.com_rulerconfigs.yaml @@ -107,6 +107,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. @@ -310,6 +313,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. diff --git a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml index 153de2325864..42d3b88c6d79 100644 --- a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.6.1 - createdAt: "2024-06-04T16:17:41Z" + createdAt: "2024-06-12T17:07:25Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. operators.operatorframework.io/builder: operator-sdk-unknown @@ -988,6 +988,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1137,6 +1140,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/bundle/community/manifests/loki.grafana.com_rulerconfigs.yaml b/operator/bundle/community/manifests/loki.grafana.com_rulerconfigs.yaml index 1057ece6a2ed..71b690e14a63 100644 --- a/operator/bundle/community/manifests/loki.grafana.com_rulerconfigs.yaml +++ b/operator/bundle/community/manifests/loki.grafana.com_rulerconfigs.yaml @@ -107,6 +107,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. @@ -310,6 +313,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. diff --git a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml index c2f743258fa4..b270d8227260 100644 --- a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: quay.io/openshift-logging/loki-operator:0.1.0 - createdAt: "2024-06-04T16:17:54Z" + createdAt: "2024-06-12T17:07:29Z" description: | The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging. ## Prerequisites and Requirements @@ -1008,6 +1008,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1157,6 +1160,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/bundle/openshift/manifests/loki.grafana.com_rulerconfigs.yaml b/operator/bundle/openshift/manifests/loki.grafana.com_rulerconfigs.yaml index c4d5a37fa035..219b8cb60697 100644 --- a/operator/bundle/openshift/manifests/loki.grafana.com_rulerconfigs.yaml +++ b/operator/bundle/openshift/manifests/loki.grafana.com_rulerconfigs.yaml @@ -107,6 +107,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. @@ -310,6 +313,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. diff --git a/operator/config/crd/bases/loki.grafana.com_rulerconfigs.yaml b/operator/config/crd/bases/loki.grafana.com_rulerconfigs.yaml index 88d65fb826c7..df922bfdefd1 100644 --- a/operator/config/crd/bases/loki.grafana.com_rulerconfigs.yaml +++ b/operator/config/crd/bases/loki.grafana.com_rulerconfigs.yaml @@ -89,6 +89,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. @@ -292,6 +295,9 @@ spec: description: The client-side certificate file path for the TLS configuration. type: string + insecureSkipVerify: + description: Skip validating server certificate. + type: boolean keyPath: description: The client-side key file path for the TLS configuration. diff --git a/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml index 649b8d0739ec..3627c03d5857 100644 --- a/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community-openshift/bases/loki-operator.clusterserviceversion.yaml @@ -1376,6 +1376,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1525,6 +1528,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml index 24f52dc2acd0..0aefa95fc280 100644 --- a/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/community/bases/loki-operator.clusterserviceversion.yaml @@ -1369,6 +1369,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1518,6 +1521,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml index aab8dcd07077..77bb3bff6fcd 100644 --- a/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml +++ b/operator/config/manifests/openshift/bases/loki-operator.clusterserviceversion.yaml @@ -1388,6 +1388,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: alertmanager.client.tls.keyPath @@ -1537,6 +1540,9 @@ spec: - description: The client-side certificate file path for the TLS configuration. displayName: Cert Path path: overrides.alertmanager.client.tls.certPath + - description: Skip validating server certificate. + displayName: Skip validating server certificate + path: overrides.alertmanager.client.tls.insecureSkipVerify - description: The client-side key file path for the TLS configuration. displayName: Key Path path: overrides.alertmanager.client.tls.keyPath diff --git a/operator/docs/operator/api.md b/operator/docs/operator/api.md index e6e5a65765d1..ca71ecee6ce3 100644 --- a/operator/docs/operator/api.md +++ b/operator/docs/operator/api.md @@ -237,6 +237,18 @@ string
The client-side key file path for the TLS configuration.
+insecureSkipVerify
Skip validating server certificate.
+