浏览代码

Add common implementation for networking/storage

Waqar Ahmed 4 年之前
父节点
当前提交
49a08334e0
共有 2 个文件被更改,包括 21 次插入0 次删除
  1. 10 0
      library/common/templates/lib/networking/_dns.tpl
  2. 11 0
      library/common/templates/lib/storage/_ixvolumes.tpl

+ 10 - 0
library/common/templates/lib/networking/_dns.tpl

@@ -0,0 +1,10 @@
+{{/*
+DNS Configuration
+*/}}
+{{- define "dnsConfiguration" }}
+dnsPolicy: {{ .Values.dnsPolicy }}
+{{- if .Values.dnsConfig }}
+dnsConfig:
+  {{- toYaml .Values.dnsConfig | nindent 2 }}
+{{- end }}
+{{- end }}

+ 11 - 0
library/common/templates/lib/storage/_ixvolumes.tpl

@@ -0,0 +1,11 @@
+{{/*
+Retrieve host path from ix volumes based on dataset name
+*/}}
+{{- define "retrieveHostPathFromiXVolume" -}}
+{{- range $index, $hostPathConfiguration := $.ixVolumes }}
+{{- $dsName := base $hostPathConfiguration.hostPath -}}
+{{- if eq $.datasetName $dsName -}}
+{{- $hostPathConfiguration.hostPath -}}
+{{- end -}}
+{{- end }}
+{{- end -}}