Skip to content

Commit

Permalink
Add support for argumentless flags to extraArgs
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Villacorta <[email protected]>
  • Loading branch information
h0tbird committed May 9, 2024
1 parent d23700c commit 315d00c
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/alertmanager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/a
sources:
- https://github.com/prometheus/alertmanager
type: application
version: 1.10.0
version: 1.11.0
appVersion: v0.27.0
kubeVersion: ">=1.19.0-0"
keywords:
Expand Down
3 changes: 3 additions & 0 deletions charts/alertmanager/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ spec:
{{- range $key, $value := .Values.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- if .Values.baseURL }}
- --web.external-url={{ .Values.baseURL }}
{{- end }}
ports:
- name: http
containerPort: 9093
Expand Down
8 changes: 8 additions & 0 deletions charts/alertmanager/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@
"description": "Container image parameters.",
"$ref": "#/definitions/image"
},
"baseURL": {
"description": "External URL where alertmanager is reachable.",
"type": "string",
"default": "",
"examples": [
"https://alertmanager.example.com"
]
},
"extraArgs": {
"description": "Additional alertmanager container arguments. Use args without '--', only 'key: value' syntax.",
"type": "object",
Expand Down
3 changes: 3 additions & 0 deletions charts/alertmanager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

# Full external URL where alertmanager is reachable, used for backlinks.
baseURL: ""

extraArgs: {}

## Additional Alertmanager Secret mounts
Expand Down
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 58.3.1
version: 58.4.1
appVersion: v0.73.2
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
{{- end }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecureSkipVerify: true
insecureSkipVerify: {{ .Values.kubelet.serviceMonitor.insecureSkipVerify }}
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.prometheusOperator.admissionWebhooks.deployment.podDisruptionBudget -}}
apiVersion: policy/v1{{ ternary "" "beta1" ($.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget") }}
apiVersion: {{ include "kube-prometheus-stack.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "kube-prometheus-stack.operator.fullname" . }}-webhook
Expand Down
12 changes: 9 additions & 3 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,12 @@ kubelet:
##
https: true

## Skip TLS certificate validation when scraping.
## This is enabled by default because kubelet serving certificate deployed by kubeadm is by default self-signed
## ref: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#kubelet-serving-certs
##
insecureSkipVerify: true

## Enable scraping /metrics/cadvisor from kubelet's service
##
cAdvisor: true
Expand Down Expand Up @@ -2453,7 +2459,7 @@ prometheusOperator:
## Provide a priority class name to the webhook patching job
##
priorityClassName: ""
ttlSecondsAfterFinished: 0
ttlSecondsAfterFinished: 60
annotations: {}
# argocd.argoproj.io/hook: PreSync
# argocd.argoproj.io/hook-delete-policy: HookSucceeded
Expand Down Expand Up @@ -2846,7 +2852,7 @@ prometheusOperator:
thanosImage:
registry: quay.io
repository: thanos/thanos
tag: v0.34.1
tag: v0.35.0
sha: ""

## Set a Label Selector to filter watched prometheus and prometheusAgent
Expand Down Expand Up @@ -4399,7 +4405,7 @@ thanosRuler:
image:
registry: quay.io
repository: thanos/thanos
tag: v0.34.1
tag: v0.35.0
sha: ""

## Namespaces to be selected for PrometheusRules discovery.
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-node-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- prometheus
- exporter
type: application
version: 4.33.0
version: 4.34.0
appVersion: 1.8.0
home: https://github.com/prometheus/node_exporter/
sources:
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus-node-exporter/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
{{- if .Values.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
type: {{ .Values.service.type }}
ports:
Expand Down
1 change: 1 addition & 0 deletions charts/prometheus-node-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ service:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
externalTrafficPolicy: ""

# Set a NetworkPolicy with:
# ingress only on service.port
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: prometheus
appVersion: v2.51.2
version: 25.20.1
version: 25.20.2
kubeVersion: ">=1.19.0-0"
description: Prometheus is a monitoring system and time series database.
home: https://prometheus.io/
Expand Down
8 changes: 8 additions & 0 deletions charts/prometheus/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ spec:
{{- end }}
- --reload-url={{ default $default_url .Values.configmapReload.reloadUrl }}
{{- range $key, $value := .Values.configmapReload.prometheus.extraArgs }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
{{- range .Values.configmapReload.prometheus.extraVolumeDirs }}
- --watched-dir={{ . }}
Expand Down Expand Up @@ -144,7 +148,11 @@ spec:
- --{{ . }}
{{- end }}
{{- range $key, $value := .Values.server.extraArgs }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
{{- if .Values.server.prefixURL }}
- --web.route-prefix={{ .Values.server.prefixURL }}
Expand Down
8 changes: 8 additions & 0 deletions charts/prometheus/templates/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ spec:
{{- end }}
- --reload-url={{ default $default_url .Values.configmapReload.reloadUrl }}
{{- range $key, $value := .Values.configmapReload.prometheus.extraArgs }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
{{- range .Values.configmapReload.prometheus.extraVolumeDirs }}
- --watched-dir={{ . }}
Expand Down Expand Up @@ -152,7 +156,11 @@ spec:
- --{{ . }}
{{- end }}
{{- range $key, $value := .Values.server.extraArgs }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
{{- if .Values.server.baseURL }}
- --web.external-url={{ .Values.server.baseURL }}
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ configmapReload:
# containerPort: 9533

## Additional configmap-reload container arguments
## Set to null for argumentless flags
##
extraArgs: {}

Expand Down Expand Up @@ -271,8 +272,10 @@ server:
# value: "Bearer ABCDEabcde12345"

## Additional Prometheus server container arguments
## Set to null for argumentless flags
##
extraArgs: {}
# web.enable-remote-write-receiver: null

## Additional InitContainers to initialize the pod
##
Expand Down

0 comments on commit 315d00c

Please sign in to comment.