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

fix(operator): add alertmanager client config to ruler template #13182

Merged
merged 2 commits into from
Jun 13, 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
7 changes: 7 additions & 0 deletions operator/apis/loki/v1/rulerconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions operator/apis/loki/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions operator/docs/operator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ string
<p>The client-side key file path for the TLS configuration.</p>
</td>
</tr>
<tr>
<td>
<code>insecureSkipVerify</code><br/>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>Skip validating server certificate.</p>
</td>
</tr>
</tbody>
</table>

Expand Down
9 changes: 5 additions & 4 deletions operator/internal/manifests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ func alertManagerConfig(spec *lokiv1.AlertManagerSpec) *config.AlertManagerConfi
conf.Notifier = &config.NotifierConfig{}
if tls := clt.TLS; tls != nil {
conf.Notifier.TLS = config.TLSConfig{
CAPath: tls.CAPath,
ServerName: tls.ServerName,
CertPath: tls.CertPath,
KeyPath: tls.KeyPath,
CAPath: tls.CAPath,
ServerName: tls.ServerName,
InsecureSkipVerify: tls.InsecureSkipVerify,
CertPath: tls.CertPath,
KeyPath: tls.KeyPath,
}
}

Expand Down
Loading
Loading