diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 96c20223e72..f128133cc30 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 8.10.6 +version: 8.11.0 diff --git a/charts/library/common/templates/_postSetup.tpl b/charts/library/common/templates/_postSetup.tpl index 0c79b7b7578..73dde5353f9 100644 --- a/charts/library/common/templates/_postSetup.tpl +++ b/charts/library/common/templates/_postSetup.tpl @@ -2,6 +2,9 @@ Secondary entrypoint and primary loader for the common chart */}} {{- define "common.postSetup" -}} + {{- /* Render the externalInterfaces */ -}} + {{ include "common.classes.externalInterfaces" . | nindent 0 }} + {{- /* Enable code-server add-on if required */ -}} {{- if .Values.addons.codeserver.enabled }} {{- include "common.addon.codeserver" . }} diff --git a/charts/library/common/templates/classes/_externalInterfaces.tpl b/charts/library/common/templates/classes/_externalInterfaces.tpl new file mode 100644 index 00000000000..524b4f263b2 --- /dev/null +++ b/charts/library/common/templates/classes/_externalInterfaces.tpl @@ -0,0 +1,15 @@ +{{/* +This template serves as a blueprint for External Interface objects that are created +using the SCALE GUI. +*/}} +{{- define "common.classes.externalInterfaces" -}} +{{- range $index, $iface := .Values.ixExternalInterfacesConfiguration }} +--- +apiVersion: "k8s.cni.cncf.io/v1" +kind: NetworkAttachmentDefinition +metadata: + name: ix-{{ $.Release.Name }}-{{ $index }} +spec: + config: '{{ $iface }}' +{{- end }} +{{- end -}} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index f565a1ede4d..6f5db0b9de1 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -212,6 +212,22 @@ networkPolicy: # -- add or remove egress policies ingress: [] +# -- Use this directly attach a pod to a SCALE interface. +# Please be aware: This bypasses k8s services +externalInterfaces: [] + # - hostInterface: "ens3" + # ipam: + # type: "dhcp" + # - hostInterface: "br0" + # ipam: + # type: "static" + # staticIPConfigurations: + # - "192.168.0.120/24" + # staticRoutes: + # - destination: "0.0.0.0/0" + # gateway: "192.168.0.1" + + # -- Use this to populate a secret with the values you specify. # Be aware that these values are not encrypted by default, and could therefore visible # to anybody with access to the values.yaml file. diff --git a/templates/questions/serviceExpert.yaml b/templates/questions/serviceExpert.yaml index 934013e036b..09cdfe7a147 100644 --- a/templates/questions/serviceExpert.yaml +++ b/templates/questions/serviceExpert.yaml @@ -1,3 +1,79 @@ + - 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: + - "normalize/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: + - value: "dhcp" + description: "Use DHCP" + - value: "static" + description: "Use static IP" + show_subquestions_if: "static" + subquestions: + - variable: staticIPConfigurations + label: "Static IP Addresses" + schema: + type: list + items: + - variable: staticIP + label: "Static IP" + schema: + type: ipaddr + cidr: true + - variable: staticRoutes + label: "Static Routes" + schema: + type: list + items: + - variable: staticRouteConfiguration + label: "Static Route Configuration" + schema: + type: dict + attrs: + - variable: destination + label: "Destination" + schema: + type: ipaddr + cidr: true + required: true + - variable: gateway + label: "Gateway" + schema: + type: ipaddr + cidr: false + required: true + - variable: dnsPolicy group: "Networking and Services" label: "dnsPolicy"