From da35f12e2b143b3c9022165964db294689df5be4 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Wed, 12 Jan 2022 20:24:01 +0100 Subject: [PATCH] feat(common): add TTY, STDIN and IPFamily support (#1700) * feat(common): add TTY and STDIN support Also fixes a mistake in the GUI for external interfaces * bump minor on common * add IP families as well --- charts/library/common/Chart.yaml | 2 +- .../common/templates/classes/_service.tpl | 7 + .../templates/lib/controller/_container.tpl | 2 + charts/library/common/values.yaml | 12 ++ templates/questions/containerConfig.yaml | 14 ++ templates/questions/serviceExpert.yaml | 124 +++++++++--------- templates/questions/serviceSelector.yaml | 26 ++++ 7 files changed, 124 insertions(+), 63 deletions(-) diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index f128133cc30b..82d6acade6a4 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.11.0 +version: 8.12.0 diff --git a/charts/library/common/templates/classes/_service.tpl b/charts/library/common/templates/classes/_service.tpl index 62c59d451051..29ad5cea97dc 100644 --- a/charts/library/common/templates/classes/_service.tpl +++ b/charts/library/common/templates/classes/_service.tpl @@ -72,6 +72,13 @@ spec: {{- if $values.publishNotReadyAddresses }} publishNotReadyAddresses: {{ $values.publishNotReadyAddresses }} {{- end }} + {{- if $values.ipFamilyPolicy }} + ipFamilyPolicy: {{ $values.ipFamilyPolicy }} + {{- end }} + {{- with $values.ipFamilies }} + ipFamilies: + {{ toYaml . | nindent 4 }} + {{- end }} ports: {{- range $name, $port := $values.ports }} {{- if $port.enabled }} diff --git a/charts/library/common/templates/lib/controller/_container.tpl b/charts/library/common/templates/lib/controller/_container.tpl index 65c7a9d17e48..2af624711b83 100644 --- a/charts/library/common/templates/lib/controller/_container.tpl +++ b/charts/library/common/templates/lib/controller/_container.tpl @@ -19,6 +19,8 @@ {{ toYaml . | nindent 4 }} {{- end }} {{- end }} + tty: {{ .Values.tty }} + stdin: {{ .Values.stdin }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 4 }} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index 6f5db0b9de15..d70a593ce6bb 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -145,6 +145,12 @@ podLabelsList: [] # -- Set labels on the pod podLabels: {} +# -- Determines whether containers in a pod runs with TTY enabled. +tty: false + +# -- Determines whether containers in a pod runs with stdin enabled. +stdin: false + # -- Add a Horizontal Pod Autoscaler # @default -- autoscaling: @@ -448,6 +454,12 @@ service: # @default -- See below portsList: [] + # -- Specify the ip policy. Options: SingleStack, PreferDualStack, RequireDualStack + ipFamilyPolicy: SingleStack + + # -- The ip families that should be used. Options: IPv4, IPv6 + ipFamilies: [ ] + # -- Configure the Service port information here. # Additional ports can be added by adding a dictionary key similar to the 'http' service. # @default -- See below diff --git a/templates/questions/containerConfig.yaml b/templates/questions/containerConfig.yaml index dd7f12ba8184..e88fc3bddcbe 100644 --- a/templates/questions/containerConfig.yaml +++ b/templates/questions/containerConfig.yaml @@ -27,6 +27,20 @@ default: false show_subquestions_if: true subquestions: + - variable: tty + label: "Enable TTY" + description: "Determines whether containers in a pod runs with TTY enabled. By default pod has it disabled." + group: "Workload Details" + schema: + type: boolean + default: false + - variable: stdin + label: "Enable STDIN" + description: "Determines whether containers in a pod runs with stdin enabled. By default pod has it disabled." + group: "Workload Details" + schema: + type: boolean + default: false - variable: termination group: "Container Configuration" label: "Termination settings" diff --git a/templates/questions/serviceExpert.yaml b/templates/questions/serviceExpert.yaml index 09cdfe7a147c..5839c02f785a 100644 --- a/templates/questions/serviceExpert.yaml +++ b/templates/questions/serviceExpert.yaml @@ -1,78 +1,78 @@ - - variable: externalInterfaces - description: "Add External Interfaces" - label: "Add external Interfaces" - group: "Networking" - schema: - type: list - items: - - variable: interfaceConfiguration - description: "Interface Configuration" - label: "Interface Configuration" + - variable: externalInterfaces + description: "Add External Interfaces" + label: "Add external Interfaces" + group: "Networking" 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" + type: list + items: + - variable: interfaceConfiguration + description: "Interface Configuration" + label: "Interface Configuration" schema: type: dict - required: true + $ref: + - "normalize/interfaceConfiguration" attrs: - - variable: type - description: "Specify type for IPAM" - label: "IPAM Type" + - variable: hostInterface + description: "Please specify host interface" + label: "Host Interface" 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" + $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: list - items: - - variable: staticRouteConfiguration - label: "Static Route Configuration" + 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: dict - attrs: - - variable: destination - label: "Destination" + type: list + items: + - variable: staticIP + label: "Static IP" schema: type: ipaddr cidr: true - required: true - - variable: gateway - label: "Gateway" + - variable: staticRoutes + label: "Static Routes" + schema: + type: list + items: + - variable: staticRouteConfiguration + label: "Static Route Configuration" schema: - type: ipaddr - cidr: false - required: true + 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" diff --git a/templates/questions/serviceSelector.yaml b/templates/questions/serviceSelector.yaml index 9466a87a07b4..0ae72ab5c65a 100644 --- a/templates/questions/serviceSelector.yaml +++ b/templates/questions/serviceSelector.yaml @@ -38,6 +38,32 @@ label: "External IP" schema: type: string + - variable: ipFamilyPolicy + label: "IP Family Policy" + description: "(Advanced) Specify the ip policy" + schema: + show_if: [["type", "!=", "Simple"]] + type: string + default: "SingleStack" + enum: + - value: "SingleStack" + description: "SingleStack" + - value: "PreferDualStack" + description: "PreferDualStack" + - value: "RequireDualStack" + description: "RequireDualStack" + - variable: ipFamilies + label: "(advanced) IP families" + description: "(advanced) The ip families that should be used" + schema: + show_if: [["type", "!=", "Simple"]] + type: list + default: [] + items: + - variable: ipFamily + label: "IP family" + schema: + type: string - variable: ports label: "Service's Port(s) Configuration" schema: