Skip to content

Commit

Permalink
k8s-stack: use path prefix from args as a default ingress path (#1496)
Browse files Browse the repository at this point in the history
* k8s-stack: use path prefix from args as a default ingress path

* added default select and insert prefixes

* pr comments
  • Loading branch information
AndrewChubatiuk authored Sep 19, 2024
1 parent da5f98e commit 21c6597
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions charts/victoria-metrics-k8s-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added VMAuth to k8s stack. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/829)
- Fixed ETCD dashboard
- Use path prefix from args as a default path prefix for ingress. Related [issue](https://github.com/VictoriaMetrics/helm-charts/issues/1260)

## 0.25.16

Expand Down
4 changes: 2 additions & 2 deletions charts/victoria-metrics-k8s-stack/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ spec:
name: {{ $serviceName }}
port:
name: {{ $ingress.serviceName | default "http" }}
{{- with $ingress.path }}
path: {{ . }}
{{- with ($ingress.path | default (dig "spec" "extraArgs" "http.pathPrefix" "/" $config)) }}
path: {{ tpl . $ }}
{{- end }}
{{- with $ingress.pathType }}
pathType: {{ . }}
Expand Down
16 changes: 9 additions & 7 deletions charts/victoria-metrics-k8s-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ vmsingle:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: ""
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -381,7 +381,7 @@ vmcluster:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: ""
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -416,7 +416,7 @@ vmcluster:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: '{{ dig "extraArgs" "http.pathPrefix" "/" .Values.vmcluster.spec.vmselect }}'
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -451,7 +451,7 @@ vmcluster:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: '{{ dig "extraArgs" "http.pathPrefix" "/" .Values.vmcluster.spec.vminsert }}'
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -619,7 +619,7 @@ alertmanager:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: '{{ .Values.alertmanager.spec.routePrefix | default "/" }}'
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -657,6 +657,8 @@ vmalert:
image:
tag: v1.103.0
evaluationInterval: 15s
extraArgs:
http.pathPrefix: "/"

# External labels to add to all generated recording rules and alerts
externalLabels: {}
Expand Down Expand Up @@ -691,7 +693,7 @@ vmalert:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: ""
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down Expand Up @@ -759,7 +761,7 @@ vmagent:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
path: ""
# pathType is only for k8s > 1.19
pathType: Prefix

Expand Down

0 comments on commit 21c6597

Please sign in to comment.