From 3a10c5ba95568b18f94e14eb54b5ca4b9268d137 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Fri, 11 Mar 2022 11:30:20 -0800 Subject: [PATCH] ingress: Add option to assign VIP as externalIP Some CNIs support the advertisement of service IPs into BGP, which may provide an alternative to managing the VIP as an interface on the host. This change adds an option to assign the ingress VIP as an externalIP to the ingress service. For example: network: vip: manage: false addr: 172.18.0.1/32 # (with or without subnet mask) assign_as_external_ip: true Change-Id: I1eeb07a1f94ef8efcb21f3373e0d5f86be725b33 --- ingress/Chart.yaml | 2 +- ingress/templates/service-ingress.yaml | 4 ++++ ingress/values.yaml | 3 +++ releasenotes/notes/ingress.yaml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ingress/Chart.yaml b/ingress/Chart.yaml index a0f32c9e6..7daaeda29 100644 --- a/ingress/Chart.yaml +++ b/ingress/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v0.42.0 description: OpenStack-Helm Ingress Controller name: ingress -version: 0.2.5 +version: 0.2.6 home: https://github.com/kubernetes/ingress sources: - https://github.com/kubernetes/ingress diff --git a/ingress/templates/service-ingress.yaml b/ingress/templates/service-ingress.yaml index eab36d3e4..a87255150 100644 --- a/ingress/templates/service-ingress.yaml +++ b/ingress/templates/service-ingress.yaml @@ -27,6 +27,10 @@ metadata: spec: {{- if and .Values.network.host_namespace .Values.network.vip.manage }} clusterIP: None +{{- end }} +{{- if .Values.network.vip.assign_as_external_ip }} + externalIPs: + - {{ (.Values.network.vip.addr | split "/")._0 }} {{- end }} ports: - name: http diff --git a/ingress/values.yaml b/ingress/values.yaml index b70ec2a82..18003ba82 100644 --- a/ingress/values.yaml +++ b/ingress/values.yaml @@ -141,6 +141,9 @@ network: interface: ingress-vip addr: 172.18.0.1/32 keepalived_router_id: 100 + # Use .network.vip.addr as an external IP for the service + # Useful if the CNI or provider can set up routes, etc. + assign_as_external_ip: false ingress: annotations: # NOTE(portdirect): if left blank this is populated from diff --git a/releasenotes/notes/ingress.yaml b/releasenotes/notes/ingress.yaml index cd9cd50d3..277227dfa 100644 --- a/releasenotes/notes/ingress.yaml +++ b/releasenotes/notes/ingress.yaml @@ -9,4 +9,5 @@ ingress: - 0.2.3 Uplift ingress to 0.42.0 - 0.2.4 Update htk requirements - 0.2.5 Migrate Ingress resources to networking.k8s.io/v1 + - 0.2.6 Add option to assign VIP as externalIP ...