2021-05-17 22:30:18 +00:00
# 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 - } }
# General
2022-02-24 00:36:39 +00:00
{ { - define "applyKubeVersionOverrides" - } }
{ { - $overrides : = dict - } }
{ { - range $override : = . Values . kubeVersionOverrides - } }
{ { - if semverCompare $override.constraint $ . Capabilities . KubeVersion . Version - } }
{ { - $_ : = mergeOverwrite $overrides $override.values - } }
{ { - end - } }
{ { - end - } }
{ { - $_ : = mergeOverwrite . Values $overrides - } }
{ { - end - } }
2021-05-17 22:30:18 +00:00
{ { - define "pushprox.namespace" - } }
{ { - if . Values . namespaceOverride - } }
{ { - . Values . namespaceOverride - } }
{ { - else - } }
{ { - . Release . Namespace - } }
{ { - end - } }
{ { - end - } }
{ { - define "pushProxy.commonLabels" - } }
release: { { . Release . Name } }
component: { { . Values . component | quote } }
provider: kubernetes
{ { - end - } }
{ { - define "pushProxy.proxyUrl" - } }
{ { - $_ : = ( required "Template requires either .Values.proxy.port or .Values.client.proxyUrl to set proxyUrl for client" ( or . Values . clients . proxyUrl . Values . proxy . port ) ) - } }
{ { - if . Values . clients . proxyUrl - } }
{ { printf "%s" . Values . clients . proxyUrl } }
{ { - else - } }
2021-06-09 22:05:09 +00:00
{ { printf "http://%s.%s.svc:%d" ( include "pushProxy.proxy.name" . ) ( include "pushprox.namespace" . ) ( int . Values . proxy . port ) } }
2021-05-17 22:30:18 +00:00
{ { - end - } } { { - end - } }
# Client
{ { - define "pushProxy.client.name" - } }
{ { - printf "pushprox-%s-client" ( required ".Values.component is required" . Values . component ) - } }
{ { - end - } }
{ { - define "pushProxy.client.labels" - } }
k8s-app: { { template "pushProxy.client.name" . } }
{ { template "pushProxy.commonLabels" . } }
{ { - end - } }
# Proxy
{ { - define "pushProxy.proxy.name" - } }
{ { - printf "pushprox-%s-proxy" ( required ".Values.component is required" . Values . component ) - } }
{ { - end - } }
{ { - define "pushProxy.proxy.labels" - } }
k8s-app: { { template "pushProxy.proxy.name" . } }
{ { template "pushProxy.commonLabels" . } }
{ { - end - } }
# ServiceMonitor
{ { - define "pushprox.serviceMonitor.name" - } }
{ { - printf "%s-%s" . Release . Name ( required ".Values.component is required" . Values . component ) - } }
{ { - end - } }
{ { - define "pushProxy.serviceMonitor.labels" - } }
app: { { template "pushprox.serviceMonitor.name" . } }
{ { template "pushProxy.commonLabels" . } }
2021-06-04 22:33:21 +00:00
{ { - end - } }
{ { - define "pushProxy.serviceMonitor.endpoints" - } }
{ { - $proxyURL : = ( include "pushProxy.proxyUrl" . ) - } }
{ { - $useHTTPS : = . Values . clients . https . enabled - } }
{ { - $endpoints : = . Values . serviceMonitor . endpoints } }
{ { - range $endpoints } }
{ { - $_ : = set . "proxyUrl" $proxyURL } }
{ { - if $useHTTPS - } }
{ { - if ( hasKey . "params" ) } }
{ { - $_ : = set ( get . "params" ) "_scheme" ( list "https" ) } }
{ { - else } }
{ { - $_ : = set . "params" ( dict "_scheme" ( list "https" ) ) } }
{ { - end } }
{ { - end } }
{ { - end } }
{ { - toYaml $endpoints } }
2021-05-17 22:30:18 +00:00
{ { - end - } }