Skip to content

Commit

Permalink
feat (common): Readd external-interfaces as expert option (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjeld Schouten-Lebbing authored Jan 12, 2022
1 parent 65f396a commit 9abf8aa
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.10.6
version: 8.11.0
3 changes: 3 additions & 0 deletions charts/library/common/templates/_postSetup.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
15 changes: 15 additions & 0 deletions charts/library/common/templates/classes/_externalInterfaces.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
16 changes: 16 additions & 0 deletions charts/library/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
76 changes: 76 additions & 0 deletions templates/questions/serviceExpert.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 9abf8aa

Please sign in to comment.