Add ability to add external ifaces using macvlan
This commit is contained in:
parent
057ab72ff0
commit
08b3e9e5c9
|
@ -82,3 +82,44 @@
|
|||
schema:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
# Networking options
|
||||
- variable: externalInterfaces
|
||||
description: "Add External Interfaces"
|
||||
label: "Add external Interfaces"
|
||||
group: "Networking"
|
||||
schema:
|
||||
type: list
|
||||
items:
|
||||
- variable: interfaceConfiguration
|
||||
description: "Interface Configuration"
|
||||
label: "Interface Configuration"
|
||||
schema:
|
||||
type: dict
|
||||
$ref:
|
||||
- "normalise/interfaceConfiguration"
|
||||
attrs:
|
||||
- variable: hostInterface
|
||||
description: "Please specify host interface"
|
||||
label: "Host Interface"
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
$ref:
|
||||
- "definitions/interface"
|
||||
- variable: ipam
|
||||
description: "Define how IP Address will be managed"
|
||||
label: "IP Address Management"
|
||||
schema:
|
||||
type: dict
|
||||
required: true
|
||||
attrs:
|
||||
- variable: type
|
||||
description: "Specify type for IPAM"
|
||||
label: "IPAM Type"
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
enum:
|
||||
- "dhcp"
|
||||
- "static"
|
||||
|
|
|
@ -61,3 +61,10 @@ Create the name of the service account to use
|
|||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Name for external interfaces to be added to chart
|
||||
*/}}
|
||||
{{- define "externalInterfaceName" -}}
|
||||
{{- printf "%s" .Release.Name }}
|
||||
{{- end }}
|
||||
|
|
|
@ -12,6 +12,14 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
{{- include "ix-chart.selectorLabels" . | nindent 8 }}
|
||||
annotations:
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
{{- if .Values.externalInterfaces }}
|
||||
k8s.v1.cni.cncf.io/networks:
|
||||
{{- range $index, $iface := .Values.externalInterfaces }}
|
||||
- {{ include "externalInterfaceName" . }}-{{ $index }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{{- range $index, $iface := .Values.externalInterfaces }}
|
||||
apiVersion: "k8s.cni.cncf.io/v1"
|
||||
kind: NetworkAttachmentDefinition
|
||||
metadata:
|
||||
name: {{ include "externalInterfaceName" . }}-{{ $index }}
|
||||
spec:
|
||||
config: '{{ $iface }}'
|
||||
----------------------------------------------------------
|
||||
{{- end }}
|
|
@ -10,3 +10,6 @@ image:
|
|||
containerCommand: []
|
||||
containerArgs: []
|
||||
containerEnvironmentVariables: []
|
||||
|
||||
# Network related configuration
|
||||
externalInterfaces: []
|
||||
|
|
Loading…
Reference in New Issue