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
This commit is contained in:
Phil Sphicas 2022-03-11 11:30:20 -08:00
parent 3b9aa44ac5
commit 3a10c5ba95
4 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
...