Skip to content

Commit e8a9df1

Browse files
committed
refactor: update deployment and default flag for /metrics on port 8083
1 parent 10f12f2 commit e8a9df1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cmd/kar-controllers/app/options/options.go

Lines changed: 2 additions & 0 deletions
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)

deployment/mcad-controller/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ spec:
350350
name: https
351351
- containerPort: 8080
352352
name: http
353+
- containerPort: 8083
354+
name: metrics
353355
volumeMounts:
354356
- mountPath: /tmp
355357
name: temp-vol
@@ -369,6 +371,10 @@ spec:
369371
port: 8081
370372
periodSeconds: 5
371373
timeoutSeconds: 5
374+
metrics:
375+
httpGet:
376+
path: /metrics
377+
port: 8083
372378
#{{ if .Values.configMap.name }}
373379
envFrom:
374380
- configMapRef:

0 commit comments

Comments
 (0)