aboutsummaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/helm/sriov-network/templates
diff options
context:
space:
mode:
Diffstat (limited to 'kud/deployment_infra/helm/sriov-network/templates')
-rw-r--r--kud/deployment_infra/helm/sriov-network/templates/_helpers.tpl34
-rw-r--r--kud/deployment_infra/helm/sriov-network/templates/sriovnetwork.yaml40
-rw-r--r--kud/deployment_infra/helm/sriov-network/templates/sriovnetworknodepolicy.yaml52
3 files changed, 126 insertions, 0 deletions
diff --git a/kud/deployment_infra/helm/sriov-network/templates/_helpers.tpl b/kud/deployment_infra/helm/sriov-network/templates/_helpers.tpl
new file mode 100644
index 00000000..08baf040
--- /dev/null
+++ b/kud/deployment_infra/helm/sriov-network/templates/_helpers.tpl
@@ -0,0 +1,34 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "sriov-network.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "sriov-network.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Common labels
+*/}}
+{{- define "sriov-network.labels" -}}
+helm.sh/chart: {{ include "sriov-network.chart" . }}
+{{ include "sriov-network.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "sriov-network.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "sriov-network.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}
diff --git a/kud/deployment_infra/helm/sriov-network/templates/sriovnetwork.yaml b/kud/deployment_infra/helm/sriov-network/templates/sriovnetwork.yaml
new file mode 100644
index 00000000..550f00dc
--- /dev/null
+++ b/kud/deployment_infra/helm/sriov-network/templates/sriovnetwork.yaml
@@ -0,0 +1,40 @@
+{{- range $network := .Values.networks }}
+---
+apiVersion: sriovnetwork.openshift.io/v1
+kind: SriovNetwork
+metadata:
+ name: {{ $network.networkName }}
+ labels:
+ {{- include "sriov-network.labels" $ | nindent 4 }}
+spec:
+ {{- with $network.capabilities }}
+ capabilities: | {{ . | nindent 4 }}
+ {{- end }}
+ ipam: | {{ $network.ipam | nindent 4 }}
+ {{- if $network.linkState }}
+ linkState: {{ $network.linkState }}
+ {{- end }}
+ {{- if $network.maxTxRate }}
+ maxTxRate: {{ $network.maxTxRate }}
+ {{- end }}
+ {{- with $network.metaPlugins }}
+ metaPlugins: | {{ . | nindent 4 }}
+ {{- end }}
+ {{- if $network.minTxRate }}
+ minTxRate: {{ $network.minTxRate }}
+ {{- end }}
+ networkNamespace: {{ $network.networkNamespace }}
+ resourceName: {{ $network.resourceName }}
+ {{- if $network.spoofChk }}
+ spoofChk: {{ $network.spoofChk }}
+ {{- end }}
+ {{- if $network.trust }}
+ trust: {{ $network.trust }}
+ {{- end }}
+ {{- if $network.vlan }}
+ vlan: {{ $network.vlan }}
+ {{- end }}
+ {{- if $network.vlanQoS }}
+ vlanQoS: {{ $network.vlanQoS }}
+ {{- end }}
+{{- end }}
diff --git a/kud/deployment_infra/helm/sriov-network/templates/sriovnetworknodepolicy.yaml b/kud/deployment_infra/helm/sriov-network/templates/sriovnetworknodepolicy.yaml
new file mode 100644
index 00000000..382df562
--- /dev/null
+++ b/kud/deployment_infra/helm/sriov-network/templates/sriovnetworknodepolicy.yaml
@@ -0,0 +1,52 @@
+{{- range $policy := .Values.policies }}
+---
+apiVersion: sriovnetwork.openshift.io/v1
+kind: SriovNetworkNodePolicy
+metadata:
+ name: {{ $policy.policyName }}
+ labels:
+ {{- include "sriov-network.labels" $ | nindent 4 }}
+spec:
+ {{- if $policy.deviceType }}
+ deviceType: {{ $policy.deviceType }}
+ {{- end }}
+ {{- if $policy.eSwitchMode }}
+ eSwitchMode: {{ $policy.eSwitchMode }}
+ {{- end }}
+ nicSelector:
+ {{- if $policy.nicSelector.deviceID }}
+ deviceID: {{ $policy.nicSelector.deviceID | quote }}
+ {{- end }}
+ {{- if $policy.nicSelector.netFilter }}
+ netFilter: {{ $policy.nicSelector.netFilter | quote }}
+ {{- end }}
+ {{- with $policy.nicSelector.pfNames }}
+ pfNames:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- with $policy.nicSelector.rootDevices }}
+ rootDevices:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- if $policy.nicSelector.vendor }}
+ vendor: {{ $policy.nicSelector.vendor | quote }}
+ {{- end }}
+ {{- if $policy.isRdma }}
+ isRdma: {{ $policy.isRdma }}
+ {{- end }}
+ {{- if $policy.linkType }}
+ linkType: {{ $policy.linkType }}
+ {{- end }}
+ {{- if $policy.mtu }}
+ mtu: {{ $policy.mtu }}
+ {{- end }}
+ {{- with $policy.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ numVfs: {{ $policy.numVfs }}
+ {{- if $policy.priority }}
+ priority: {{ $policy.priority }}
+ {{- end }}
+ resourceName: {{ $policy.resourceName }}
+{{- end }} \ No newline at end of file