Skip to content

Commit 308a881

Browse files
committed
refactor: update deployment and default flag for /metrics on port 8083
1 parent 692e370 commit 308a881

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: cmd/kar-controllers/app/options/options.go

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ type ServerOption struct {
5656
QuotaRestURL string
5757
HealthProbeListenAddr string
5858
DispatchResourceReservationTimeout int64
59+
MetricsListenAddr string
5960
}
6061

6162
// NewServerOption creates a new CMServer with a default config.
@@ -82,6 +83,7 @@ func (s *ServerOption) AddFlags(fs *flag.FlagSet) {
8283
fs.StringVar(&s.QuotaRestURL, "quotaURL", s.QuotaRestURL, "URL for ReST quota management. Default is none.")
8384
fs.IntVar(&s.SecurePort, "secure-port", 6443, "The port on which to serve secured, authenticated access for metrics.")
8485
fs.StringVar(&s.HealthProbeListenAddr, "healthProbeListenAddr", ":8081", "Listen address for health probes. Defaults to ':8081'")
86+
fs.StringVar(&s.MetricsListenAddr, "metricsListenAddr", ":8083", "Listen address for metrics. Defaults to ':8083'")
8587
fs.Int64Var(&s.DispatchResourceReservationTimeout, "dispatchResourceReservationTimeout", s.DispatchResourceReservationTimeout, "Resource reservation timeout for pods to be created once AppWrapper is dispatched, in millisecond. Defaults to '300000', 5 minutes")
8688
flag.Parse()
8789
klog.V(4).Infof("[AddFlags] Controller configuration: %#v", s)

Diff for: deployment/mcad-controller/templates/deployment.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ spec:
352352
name: https
353353
- containerPort: 8080
354354
name: http
355+
- containerPort: 8083
356+
name: metrics
355357
volumeMounts:
356358
- mountPath: /tmp
357359
name: temp-vol
@@ -371,6 +373,10 @@ spec:
371373
port: 8081
372374
periodSeconds: 5
373375
timeoutSeconds: 5
376+
metrics:
377+
httpGet:
378+
path: /metrics
379+
port: 8083
374380
#{{ if .Values.configMap.name }}
375381
envFrom:
376382
- configMapRef:

0 commit comments

Comments
 (0)