mirror of https://git.rancher.io/charts
54 lines
1.3 KiB
Diff
54 lines
1.3 KiB
Diff
--- charts-original/templates/_helpers.tpl
|
|
+++ charts/templates/_helpers.tpl
|
|
@@ -1,3 +1,32 @@
|
|
+# Rancher
|
|
+{{- define "system_default_registry" -}}
|
|
+{{- if .Values.global.cattle.systemDefaultRegistry -}}
|
|
+{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
|
|
+{{- end -}}
|
|
+{{- end -}}
|
|
+
|
|
+# Windows Support
|
|
+
|
|
+{{/*
|
|
+Windows cluster will add default taint for linux nodes,
|
|
+add below linux tolerations to workloads could be scheduled to those linux nodes
|
|
+*/}}
|
|
+
|
|
+{{- define "linux-node-tolerations" -}}
|
|
+- key: "cattle.io/os"
|
|
+ value: "linux"
|
|
+ effect: "NoSchedule"
|
|
+ operator: "Equal"
|
|
+{{- end -}}
|
|
+
|
|
+{{- define "linux-node-selector" -}}
|
|
+{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
+beta.kubernetes.io/os: linux
|
|
+{{- else -}}
|
|
+kubernetes.io/os: linux
|
|
+{{- end -}}
|
|
+{{- end -}}
|
|
+
|
|
{{/* vim: set filetype=mustache: */}}
|
|
{{/*
|
|
Expand the name of the chart.
|
|
@@ -128,6 +157,17 @@
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
+{{/*
|
|
+Return the appropriate apiVersion for HorizontalPodAutoscaler.
|
|
+*/}}
|
|
+{{- define "grafana.hpa.apiVersion" -}}
|
|
+ {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
|
|
+ {{- print "autoscaling/v2" -}}
|
|
+ {{- else if .Capabilities.APIVersions.Has "autoscaling/v1" }}
|
|
+ {{- print "autoscaling/v1" -}}
|
|
+ {{- end -}}
|
|
+{{- end -}}
|
|
+
|
|
{{/*
|
|
Return the appropriate apiVersion for ingress.
|
|
*/}}
|