diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index d85d67e..d445d24 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -33,10 +33,11 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.verbose }} args: - - -verbose - {{- end }} + - "-port {{ .Values.service.public.port }}" + {{- if .Values.verbose }} + - "-verbose" + {{- end }} ports: - name: internal containerPort: {{ .Values.service.internal.port }} diff --git a/main.go b/main.go index 38615d7..7c8ed24 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "flag" + "fmt" "net/http" "strconv" "time" @@ -113,6 +114,7 @@ func setHeartRateSeconds(w http.ResponseWriter, r *http.Request) { func main() { verbose := flag.Bool("verbose", false, "show debug messages") + listenPort := flag.Int("port", 8080, "listen port for server") flag.Parse() log.SetFormatter(&log.JSONFormatter{}) @@ -138,5 +140,5 @@ func main() { http.ListenAndServe(":9090", internalMux) }() log.Info("Listening for heartbeat changes.") - http.ListenAndServe(":8080", mainMux) + http.ListenAndServe(fmt.Sprintf(":%d", *listenPort), mainMux) }