-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split templates of resources per kind - fix helm linting. (fix #819).
- Loading branch information
Showing
11 changed files
with
374 additions
and
383 deletions.
There are no files selected for viewing
17 changes: 0 additions & 17 deletions
17
...es/victoria-metrics-operator/vmagent.yaml → ...ria-metrics-operator/vmagent/ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmagent/vmagent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.vmagent.enabled }} | ||
--- | ||
apiVersion: operator.victoriametrics.com/v1beta1 | ||
kind: VMAgent | ||
metadata: | ||
{{- with .Values.vmagent.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
name: {{ .Values.vmagent.name | default (include "victoria-metrics-k8s-stack.fullname" .) }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: {{ include "victoria-metrics-k8s-stack.labels" . | nindent 4 }} | ||
spec: | ||
{{ include "victoria-metrics-k8s-stack.vmAgentSpec" . | indent 2 }} | ||
{{- end }} |
81 changes: 81 additions & 0 deletions
81
charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{{ if and .Values.vmalert.enabled .Values.vmalert.ingress.enabled -}} | ||
{{- $servicePort := 8080 -}} | ||
{{- $ingressPath := .Values.vmalert.ingress.path -}} | ||
{{- $serviceName := printf "%s-%s" "vmalert" (include "victoria-metrics-k8s-stack.fullname" .) | trunc 63 | trimSuffix "-" }} | ||
{{- $ingressPathType := .Values.vmalert.ingress.pathType | default "" -}} | ||
{{- $extraPaths := .Values.vmalert.ingress.extraPaths -}} | ||
{{- $newAPI := .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}} | ||
{{- if $newAPI -}} | ||
apiVersion: networking.k8s.io/v1 | ||
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} | ||
apiVersion: networking.k8s.io/v1beta1 | ||
{{- else }} | ||
apiVersion: extensions/v1beta1 | ||
{{- end }} | ||
kind: Ingress | ||
metadata: | ||
name: {{ .Values.vmalert.name | default $serviceName }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/component: {{ include "victoria-metrics-k8s-stack.name" $ }}-vmalert | ||
{{ include "victoria-metrics-k8s-stack.labels" . | indent 4 }} | ||
{{- if .Values.vmalert.ingress.labels }} | ||
{{ toYaml .Values.vmalert.ingress.labels | indent 4 }} | ||
{{- end }} | ||
{{- if .Values.vmalert.ingress.annotations }} | ||
annotations: | ||
{{- range $key, $value := .Values.vmalert.ingress.annotations }} | ||
{{ $key }}: {{ tpl $value $ | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.vmalert.ingress.ingressClassName }} | ||
ingressClassName: {{ .Values.vmalert.ingress.ingressClassName }} | ||
{{- end -}} | ||
{{- if .Values.vmalert.ingress.tls }} | ||
tls: | ||
{{ tpl (toYaml .Values.vmalert.ingress.tls) $ | indent 4 }} | ||
{{- end }} | ||
rules: | ||
{{- if .Values.vmalert.ingress.hosts }} | ||
{{- range .Values.vmalert.ingress.hosts }} | ||
- host: {{ tpl . $}} | ||
http: | ||
paths: | ||
{{- if $extraPaths }} | ||
{{ toYaml $extraPaths | indent 10 }} | ||
{{- end }} | ||
- path: {{ $ingressPath }} | ||
{{- if $newAPI }} | ||
pathType: {{ $ingressPathType }} | ||
{{- end }} | ||
backend: | ||
{{- if $newAPI }} | ||
service: | ||
name: {{ $serviceName }} | ||
port: | ||
number: {{ $servicePort }} | ||
{{- else }} | ||
serviceName: {{ $serviceName }} | ||
servicePort: {{ $servicePort }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else }} | ||
- http: | ||
paths: | ||
- backend: | ||
{{- if $newAPI }} | ||
service: | ||
name: {{ $serviceName }} | ||
port: | ||
number: {{ $servicePort }} | ||
pathType: {{ $ingressPathType }} | ||
{{- else }} | ||
serviceName: {{ $serviceName }} | ||
servicePort: {{ $servicePort }} | ||
{{- end }} | ||
{{- if $ingressPath }} | ||
path: {{ $ingressPath }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.