Skip to content

Commit

Permalink
Fix port conflict for operator-controller metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Jan 3, 2025
1 parent c8e795b commit 807dc4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func main() {
caCertDir string
globalPullSecret string
)
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8443')")
flag.StringVar(&metricsAddr, "metrics-bind-address", "", "The address for the metrics endpoint. Requires tls-cert and tls-key. (Default: ':8445')")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.StringVar(&caCertDir, "ca-certs-dir", "", "The directory of TLS certificate to use for verifying HTTPS connections to the Catalogd and docker-registry web servers.")
flag.StringVar(&certFile, "tls-cert", "", "The certificate file used for the metrics server. Required to enable the metrics server. Requires tls-key.")
Expand Down Expand Up @@ -138,7 +138,7 @@ func main() {
}

if certFile != "" && keyFile != "" && metricsAddr == "" {
metricsAddr = ":8443"
metricsAddr = ":8445"
}

ctrl.SetLogger(textlogger.NewLogger(textlogger.NewConfig()))
Expand Down
2 changes: 1 addition & 1 deletion config/base/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- /manager
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=:8443"
- "--metrics-bind-address=:8445"
- "--leader-elect"
image: controller:latest
imagePullPolicy: IfNotPresent
Expand Down
4 changes: 2 additions & 2 deletions config/base/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
spec:
ports:
- name: https
port: 8443
port: 8445
protocol: TCP
targetPort: 8443
targetPort: 8445
selector:
control-plane: operator-controller-controller-manager
2 changes: 1 addition & 1 deletion test/e2e/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestOperatorControllerMetricsExportedEndpoint(t *testing.T) {
require.NoError(t, waitErr, "Error waiting for curl pod to be ready: %s", string(waitOutput))

t.Log("Validating the metrics endpoint")
metricsURL := "https://operator-controller-controller-manager-metrics-service." + namespace + ".svc.cluster.local:8443/metrics"
metricsURL := "https://operator-controller-controller-manager-metrics-service." + namespace + ".svc.cluster.local:8445/metrics"
curlCmd := exec.Command(client, "exec", curlPod, "-n", namespace, "--",
"curl", "-v", "-k", "-H", "Authorization: Bearer "+token, metricsURL)
output, err = curlCmd.CombinedOutput()
Expand Down

0 comments on commit 807dc4f

Please sign in to comment.