Skip to content

Commit 2e80b24

Browse files
authored
Default to 8443 as metrics port to align service instead of 8080 (#844)
* Default to 8443 as metrics port to align service instead of 8080 * Add containerPort definitions in deployment
1 parent a3fa15c commit 2e80b24

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

api/config/v1alpha1/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
DefaultWebhookSecretName = "jobset-webhook-server-cert"
2929
DefaultWebhookPort = 9443
3030
DefaultHealthProbeBindAddress = ":8081"
31-
DefaultMetricsBindAddress = ":8080"
31+
DefaultMetricsBindAddress = ":8443"
3232
DefaultLeaderElectionID = "6d4f6a47.jobset.x-k8s.io"
3333
DefaultLeaderElectionLeaseDuration = 15 * time.Second
3434
DefaultLeaderElectionRenewDeadline = 10 * time.Second

charts/jobset/templates/controller/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
protocol: TCP
7272
{{- if .Values.prometheus.enable }}
7373
- name: metrics
74-
containerPort: 8080
74+
containerPort: 8443
7575
protocol: TCP
7676
{{- end }}
7777
livenessProbe:

config/default/kustomization.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ patchesStrategicMerge:
3535
# Other configurations
3636
- manager_config_patch.yaml
3737

38+
- manager_metrics_patch.yaml
39+
3840
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
3941
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
4042
# 'CERTMANAGER' needs to be enabled to use ca injection
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This patch exposes 8443 port used by metrics service
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: controller-manager
6+
namespace: system
7+
spec:
8+
template:
9+
spec:
10+
containers:
11+
- name: manager
12+
ports:
13+
- containerPort: 8443
14+
name: metrics
15+
protocol: TCP

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func main() {
7373
var burst int
7474
var featureGates string
7575
var configFile string
76-
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
76+
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8443", "The address the metric endpoint binds to.")
7777
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
7878
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
7979
"Enable leader election for controller manager. "+

pkg/config/config_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ kind: Configuration
7272
health:
7373
healthProbeBindAddress: :8081
7474
metrics:
75-
bindAddress: :8080
75+
bindAddress: :8443
7676
leaderElection:
7777
leaderElect: true
7878
resourceName: 6d4f6a47.jobset.x-k8s.io
@@ -93,7 +93,7 @@ kind: Configuration
9393
health:
9494
healthProbeBindAddress: :8081
9595
metrics:
96-
bindAddress: :8080
96+
bindAddress: :8443
9797
leaderElection:
9898
leaderElect: true
9999
resourceName: 6d4f6a47.jobset.x-k8s.io
@@ -112,7 +112,7 @@ kind: Configuration
112112
health:
113113
healthProbeBindAddress: :8081
114114
metrics:
115-
bindAddress: :8080
115+
bindAddress: :8443
116116
leaderElection:
117117
leaderElect: false
118118
webhook:
@@ -128,7 +128,7 @@ kind: Configuration
128128
health:
129129
healthProbeBindAddress: :8081
130130
metrics:
131-
bindAddress: :8080
131+
bindAddress: :8443
132132
leaderElection:
133133
leaderElect: true
134134
resourceName: 6d4f6a47.jobset.x-k8s.io
@@ -149,7 +149,7 @@ invalidField: invalidValue
149149
health:
150150
healthProbeBindAddress: :8081
151151
metrics:
152-
bindAddress: :8080
152+
bindAddress: :8443
153153
leaderElection:
154154
leaderElect: true
155155
resourceName: 6d4f6a47.jobset.x-k8s.io

0 commit comments

Comments
 (0)