feat(metallb): rework metallb to use manifest-included metallb (#4320)

* feat(metallb): rework metallb to use manifest-included metallb

* try without port

* more tests and examples

* disable probes

* hmm

* bump major

* try again...
This commit is contained in:
Kjeld Schouten-Lebbing
2022-11-06 19:02:30 +01:00
committed by GitHub
parent 1d4fe783b0
commit 5bb9ba9c0d
10 changed files with 71 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ sources:
- https://github.com/metallb/metallb
- https://metallb.universe.tf
type: application
version: 4.0.21
version: 5.0.0
annotations:
truecharts.org/catagories: |
- core

View File

@@ -0,0 +1,6 @@
ipAddressPools:
- name: example
autoAssign: true
avoidBuggyIPs: true
addresses:
- 192.168.1.1-192.168.1.100

View File

@@ -1,12 +1,11 @@
{{- define "metallb.bgpadv" -}}
{{- range .Values.BGPAdvertisements }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
---
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: {{ .name }}
name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec:
ipAddressPools:
{{- range .addressPools }}
@@ -31,3 +30,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -1,12 +1,11 @@
{{- define "metallb.comm" -}}
{{- if .Values.Communities }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
---
apiVersion: metallb.io/v1beta1
kind: Community
metadata:
name: communities
name: {{ $.Release.Name }}-communities
namespace: metallb-system
spec:
communities:
{{- range .Values.Communities }}
@@ -14,3 +13,4 @@ spec:
value: {{ .value }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -1,12 +1,11 @@
{{- define "metallb.pool" -}}
{{- range .Values.ipAddressPools }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: {{ .name }}
name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec:
addresses:
{{- range .addresses }}
@@ -15,3 +14,4 @@ spec:
autoAssign: {{ .autoAssign | default true }}
avoidBuggyIPs: {{ .avoidBuggyIPs | default false }}
{{- end }}
{{- end -}}

View File

@@ -1,12 +1,11 @@
{{- define "metallb.l2adv" -}}
{{- range .Values.L2Advertisements }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: {{ .name }}
name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec:
ipAddressPools:
{{- range .addressPools }}
@@ -20,3 +19,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -1,12 +1,11 @@
{{- define "metallb.peers" -}}
{{- range .Values.Peers }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
---
apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: {{ .name }}
name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec:
{{- with .password }}
password: {{ . }}
@@ -49,3 +48,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,15 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
{{- include "metallb.l2adv" . }}
{{- include "metallb.peers" . }}
{{- include "metallb.bgpadv" . }}
{{- include "metallb.comm" . }}
{{- include "metallb.pool" . }}

View File

@@ -3,7 +3,36 @@ image:
tag: upstream
pullPolicy: IfNotPresent
controller:
enabled: false
service:
main:
enabled: false
ports:
main:
enabled: false
port: 9999
updateCRD: false
portal:
enabled: false
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false
ipAddressPools: []
# - name: example
# autoAssign: true
# avoidBuggyIPs: true
# addresses:
# - 192.168.1.1-192.168.1.100
L2Advertisements: []
# - name: l2adv
# addressPools: