-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f517a63
commit 858c096
Showing
73 changed files
with
138 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Added | ||
body: Added "EnableWithTLS" option to Helm parameter "prometheus.expose", allowing secure access | ||
to metrics from outside the cluster | ||
time: 2025-01-31T22:14:06.675326382Z | ||
custom: | ||
Issue: "1040" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: Removed | ||
body: Removed Helm parameter "prometheus.createServiceMonitor" | ||
time: 2025-01-31T22:12:20.085253713Z | ||
custom: | ||
Issue: "1040" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,10 @@ package main | |
import ( | ||
"context" | ||
"crypto/tls" | ||
"crypto/x509" | ||
"log" | ||
"os" | ||
"strings" | ||
"time" | ||
|
||
// Allows us to pull in things generated from `go generate` | ||
|
@@ -286,20 +288,42 @@ func main() { | |
TLSOpts: webhookTLSOpts, | ||
}) | ||
|
||
secureMetrics := opcfg.GetMetricsAddr() == "127.0.0.1:8443" | ||
secureMetrics := strings.EqualFold(opcfg.GetMetricsExposeMode(), "EnableWithAuth") | ||
secureByTLS := strings.EqualFold(opcfg.GetMetricsExposeMode(), "EnableWithTLS") | ||
var metricCertDir string | ||
if opcfg.GetMetricsTLSSecret() != "" { | ||
metricCertDir = "/cert" | ||
metricsTLSOpts = append(metricsTLSOpts, func(c *tls.Config) { | ||
// Load the CA certificate | ||
caCert, err := os.ReadFile("/cert/ca.crt") | ||
if err != nil { | ||
log.Fatalf("failed to read CA cert: %v", err) | ||
} | ||
// Create a CertPool and add the CA certificate to it | ||
caCertPool := x509.NewCertPool() | ||
ok := caCertPool.AppendCertsFromPEM(caCert) | ||
if !ok { | ||
log.Fatal("failed to append CA cert to CertPool") | ||
} | ||
c.ClientCAs = caCertPool | ||
// If we enabled authorization, then no client certs are really needed. | ||
// Otherwise, we need the client certs. | ||
if secureMetrics { | ||
c.ClientAuth = tls.VerifyClientCertIfGiven | ||
} else if secureByTLS { | ||
c.ClientAuth = tls.RequireAndVerifyClientCert | ||
} | ||
}) | ||
} | ||
|
||
// Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server. | ||
// More info: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/metrics/server | ||
// - https://book.kubebuilder.io/reference/metrics.html | ||
metricsServerOptions := metricsserver.Options{ | ||
BindAddress: ":8443", | ||
SecureServing: secureMetrics, | ||
// TODO(user): TLSOpts is used to allow configuring the TLS config used for the server. If certificates are | ||
BindAddress: opcfg.GetMetricsAddr(), | ||
SecureServing: secureMetrics || secureByTLS, | ||
// TLSOpts is used to allow configuring the TLS config used for the server. If certificates are | ||
// not provided, self-signed certificates will be generated by default. This option is not recommended for | ||
// production environments as self-signed certificates do not offer the same level of trust and security | ||
// as certificates issued by a trusted Certificate Authority (CA). The primary risk is potentially allowing | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: metrics-reader | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: metrics-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: manager | ||
namespace: system | ||
- apiGroup: rbac.authorization.k8s.io | ||
kind: Group | ||
name: system:authenticated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
helm-charts/verticadb-operator/tests/servicemonitor_test.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.