File tree Expand file tree Collapse file tree 6 files changed +39
-1
lines changed
Expand file tree Collapse file tree 6 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 7979 value : {{ .Values.settings.telemetry.clusterName | default "arcane-cluster"}}
8080 - name : ARCANE_OPERATOR__TELEMETRY__LOG_LEVEL
8181 value : {{ .Values.settings.telemetry.logLevel | default "info"}}
82+ - name : ARCANE_OPERATOR__TELEMETRY__METRICS_BIND_ADDRESS
83+ value : {{ .Values.settings.telemetry.metricsBindAddressOverride | default (printf "0.0.0.0:%v" .Values.settings.telemetry.metricsPort) }}
8284 {{- if .Values.datadog.enabled }}
8385 - name : DATADOG__API_KEY
8486 valueFrom :
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Service
3+ metadata :
4+ name : {{ include "app.name" . }}-metrics
5+ labels :
6+ {{- include "app.labels" $ | nindent 4 }}
7+ {{- with .Values.additionalAnnotations }}
8+ annotations :
9+ {{- toYaml . | nindent 4 }}
10+ {{- end }}
11+ spec :
12+ type : ClusterIP
13+ ports :
14+ - port : {{ .Values.settings.telemetry.metricsPort }}
15+ targetPort : {{ .Values.settings.telemetry.metricsPort }}
16+ protocol : TCP
17+ name : metrics
18+ selector :
19+ {{- include "app.selectorLabels" $ | nindent 4 }}
20+
Original file line number Diff line number Diff line change @@ -215,6 +215,14 @@ settings:
215215 # Name of the cluster the operator is deployed in
216216 clusterName : " arcane-cluster"
217217
218+ # Metrics bind port
219+ metricsPort : 9090
220+
221+ # Address to bind the metrics endpoint to
222+ # Note that if this is overridden, a corresponding Service resource must be created to expose the metrics endpoint
223+ metricsBindAddressOverride : " "
224+
225+
218226# Observability settings for Datadog
219227datadog :
220228
Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ periodic-metrics-reporter:
1010
1111telemetry :
1212 log-level : " Info"
13- cluster-name : " arcane-cluster"
13+ cluster-name : " arcane-cluster"
14+ metrics-bind-address : " :9090"
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
2727 "os/exec"
2828 controllerruntime "sigs.k8s.io/controller-runtime"
2929 "sigs.k8s.io/controller-runtime/pkg/manager"
30+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
3031 "strings"
3132)
3233
@@ -90,6 +91,9 @@ func main() {
9091 }
9192
9293 mgr , err := controllerruntime .NewManager (kubeconfig , controllerruntime.Options {
94+ Metrics : metricsserver.Options {
95+ BindAddress : appConfig .Telemetry .MetricsBindAddress ,
96+ },
9397 Scheme : scheme ,
9498 })
9599 if err != nil {
Original file line number Diff line number Diff line change @@ -6,4 +6,7 @@ type Config struct {
66
77 // ClusterName sets the name of the cluster where the application is running.
88 ClusterName string `mapstructure:"cluster-name,omitempty"`
9+
10+ // MetricsBindAddress sets the address for binding the metrics server.
11+ MetricsBindAddress string `mapstructure:"metrics-bind-address,omitempty"`
912}
You can’t perform that action at this time.
0 commit comments