Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-581 Make metrics exposable based on helm variables #582

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions charts/zookeeper-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 6000
- containerPort: {{ int .Values.metricsPort }}
name: metrics
command:
- zookeeper-operator
{{- if .Values.disableFinalizer }}
args:
- -metrics-bind-address={{ .Values.metricsBindAddress }}:{{ int .Values.metricsPort }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have to be -metrics-bind-address or --metrics-bind-address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on:

flag.StringVar(&metricsAddr, "metrics-bind-address", "127.0.0.1:6000", "The address the metric endpoint binds to.")

And flag's documentation: https://pkg.go.dev/flag#hdr-Command_line_flag_syntax
My understanding is that it can be either. If there is a preference for double dashes, that's easy to adjust, but as -disableFinalizer below is a single dash, I went with single dash for consistency.

{{- if .Values.disableFinalizer }}
- -disableFinalizer
{{- end }}
env:
Expand Down
4 changes: 4 additions & 0 deletions charts/zookeeper-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ additionalVolumes: {}
# emptyDir: {}

disableFinalizer: false

## In order to enable gathering metrics by Prometheus etc... bind to 0.0.0.0
metricsBindAddress: 127.0.0.1
metricsPort: "6000"
Loading