|
|
|
@@ -12,14 +12,14 @@
|
|
|
|
|
{{/* env */}}
|
|
|
|
|
|
|
|
|
|
{{- define "athens-proxy.deployment.env" -}}
|
|
|
|
|
{{- $env := dict "env" (.Values.deployment.athensProxy.env | default (list) ) }}
|
|
|
|
|
{{- $env := .Values.deployment.athensProxy.env | default (list) }}
|
|
|
|
|
{{- if and .Values.persistence.enabled }}
|
|
|
|
|
{{- $env = merge $env (dict "env" (list (dict "name" "ATHENS_STORAGE_TYPE" "value" "disk") (dict "name" "ATHENS_DISK_STORAGE_ROOT" "value" .Values.persistence.data.mountPath)))}}
|
|
|
|
|
{{- $env = concat $env (list (dict "name" "ATHENS_STORAGE_TYPE" "value" "disk") (dict "name" "ATHENS_DISK_STORAGE_ROOT" "value" .Values.persistence.data.mountPath)) }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- if and (hasKey .Values.deployment.athensProxy.resources "limits") (hasKey .Values.deployment.athensProxy.resources.limits "cpu") }}
|
|
|
|
|
{{- $env = merge $env (dict "env" (list (dict "name" "GOMAXPROCS" "valueFrom" (dict "resourceFieldRef" (dict "divisor" "1" "resource" "limits.cpu"))))) }}
|
|
|
|
|
{{- $env = concat $env (list (dict "name" "GOMAXPROCS" "valueFrom" (dict "resourceFieldRef" (dict "divisor" "1" "resource" "limits.cpu")))) }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ toYaml $env }}
|
|
|
|
|
{{ toYaml (dict "env" $env) }}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -59,21 +59,45 @@
|
|
|
|
|
{{/* volumeMounts */}}
|
|
|
|
|
|
|
|
|
|
{{- define "athens-proxy.deployment.volumeMounts" -}}
|
|
|
|
|
{{- $volumeMounts := dict "volumeMounts" (.Values.deployment.athensProxy.volumeMounts | default (list) ) }}
|
|
|
|
|
{{- $volumeMounts := .Values.deployment.athensProxy.volumeMounts | default (list) }}
|
|
|
|
|
{{- if .Values.persistence.enabled }}
|
|
|
|
|
{{- $volumeMounts = merge $volumeMounts (dict "volumeMounts" (list (dict "name" "data" "mountPath" .Values.persistence.data.mountPath))) }}
|
|
|
|
|
{{- $volumeMounts = concat $volumeMounts (list (dict "name" "data" "mountPath" .Values.persistence.data.mountPath)) }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ toYaml $volumeMounts }}
|
|
|
|
|
|
|
|
|
|
{{- if .Values.config.netrc.enabled }}
|
|
|
|
|
{{- $volumeMounts = concat $volumeMounts (list (dict "name" "secrets" "mountPath" "/root/.netrc" "subPath" ".netrc" )) }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
|
|
{{ toYaml (dict "volumeMounts" $volumeMounts) }}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
|
|
{{/* volumes */}}
|
|
|
|
|
|
|
|
|
|
{{- define "athens-proxy.deployment.volumes" -}}
|
|
|
|
|
{{- $volumes := dict "volumes" (.Values.deployment.athensProxy.volumes | default (list) ) }}
|
|
|
|
|
{{- if and .Values.persistence.enabled (not .Values.persistence.data.existingPersistentVolumeClaim.enabled) }}
|
|
|
|
|
{{- $volumes = merge $volumes (dict "volumes" (list (dict "name" "data" "persistentVolumeClaim" (dict "claimName" (include "athens-proxy.persistentVolumeClaim.data.name" $))))) }}
|
|
|
|
|
{{- else if and .Values.persistence.enabled .Values.persistence.data.existingPersistentVolumeClaim.enabled }}
|
|
|
|
|
{{- $volumes = merge $volumes (dict "volumes" (list (dict "name" "data" "persistentVolumeClaim" (dict "claimName" .Values.persistence.data.existingPersistentVolumeClaim.persistentVolumeClaimName)))) }}
|
|
|
|
|
{{- $volumes := .Values.deployment.athensProxy.volumes | default (list) }}
|
|
|
|
|
|
|
|
|
|
{{- if .Values.persistence.enabled }}
|
|
|
|
|
{{- $claimName := include "athens-proxy.persistentVolumeClaim.data.name" $ }}
|
|
|
|
|
{{- if .Values.persistence.data.existingPersistentVolumeClaim.enabled }}
|
|
|
|
|
{{- $claimName = .Values.persistence.data.existingPersistentVolumeClaim.persistentVolumeClaimName }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{ toYaml $volumes }}
|
|
|
|
|
{{- $volumes = concat $volumes (list (dict "name" "data" "persistentVolumeClaim" (dict "claimName" $claimName))) }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
|
|
{{- if .Values.config.netrc.enabled }}
|
|
|
|
|
{{- $projectedSources := list -}}
|
|
|
|
|
|
|
|
|
|
{{- $itemList := list (dict "key" ".netrc" "path" ".netrc" "mode" 0600) }}
|
|
|
|
|
{{- $secretName := include "athens-proxy.secrets.netrc.name" . }}
|
|
|
|
|
{{- if .Values.config.netrc.existingSecret.enabled }}
|
|
|
|
|
{{- $itemList = list (dict "key" .Values.config.netrc.existingSecret.netrcKey "path" ".netrc" "mode" 0600) }}
|
|
|
|
|
{{- $secretName = .Values.config.netrc.existingSecret.secretName }}
|
|
|
|
|
{{- end }}
|
|
|
|
|
{{- $projectedSources = concat $projectedSources (list (dict "secret" (dict "name" $secretName "items" $itemList))) }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{{- $volumes = concat $volumes (list (dict "name" "secrets" "projected" (dict "sources" $projectedSources)))}}
|
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
|
|
{{ toYaml (dict "volumes" $volumes) }}
|
|
|
|
|
{{- end -}}
|