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
+1 -1
View File
@@ -22,7 +22,7 @@ sources:
- https://github.com/metallb/metallb - https://github.com/metallb/metallb
- https://metallb.universe.tf - https://metallb.universe.tf
type: application type: application
version: 4.0.21 version: 5.0.0
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- core - core
@@ -0,0 +1,6 @@
ipAddressPools:
- name: example
autoAssign: true
avoidBuggyIPs: true
addresses:
- 192.168.1.1-192.168.1.100
@@ -1,12 +1,11 @@
{{- define "metallb.bgpadv" -}}
{{- range .Values.BGPAdvertisements }} {{- range .Values.BGPAdvertisements }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
--- ---
apiVersion: metallb.io/v1beta1 apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement kind: BGPAdvertisement
metadata: metadata:
name: {{ .name }} name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec: spec:
ipAddressPools: ipAddressPools:
{{- range .addressPools }} {{- range .addressPools }}
@@ -31,3 +30,4 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,12 +1,11 @@
{{- define "metallb.comm" -}}
{{- if .Values.Communities }} {{- if .Values.Communities }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
--- ---
apiVersion: metallb.io/v1beta1 apiVersion: metallb.io/v1beta1
kind: Community kind: Community
metadata: metadata:
name: communities name: {{ $.Release.Name }}-communities
namespace: metallb-system
spec: spec:
communities: communities:
{{- range .Values.Communities }} {{- range .Values.Communities }}
@@ -14,3 +13,4 @@ spec:
value: {{ .value }} value: {{ .value }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,12 +1,11 @@
{{- define "metallb.pool" -}}
{{- range .Values.ipAddressPools }} {{- range .Values.ipAddressPools }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
--- ---
apiVersion: metallb.io/v1beta1 apiVersion: metallb.io/v1beta1
kind: IPAddressPool kind: IPAddressPool
metadata: metadata:
name: {{ .name }} name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec: spec:
addresses: addresses:
{{- range .addresses }} {{- range .addresses }}
@@ -15,3 +14,4 @@ spec:
autoAssign: {{ .autoAssign | default true }} autoAssign: {{ .autoAssign | default true }}
avoidBuggyIPs: {{ .avoidBuggyIPs | default false }} avoidBuggyIPs: {{ .avoidBuggyIPs | default false }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,12 +1,11 @@
{{- define "metallb.l2adv" -}}
{{- range .Values.L2Advertisements }} {{- range .Values.L2Advertisements }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
--- ---
apiVersion: metallb.io/v1beta1 apiVersion: metallb.io/v1beta1
kind: L2Advertisement kind: L2Advertisement
metadata: metadata:
name: {{ .name }} name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec: spec:
ipAddressPools: ipAddressPools:
{{- range .addressPools }} {{- range .addressPools }}
@@ -20,3 +19,4 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,12 +1,11 @@
{{- define "metallb.peers" -}}
{{- range .Values.Peers }} {{- range .Values.Peers }}
{{- if $.Release.IsInstall }}
{{- fail "Please only add MetalLB configuration after initial installation" }}
{{- end }}
--- ---
apiVersion: metallb.io/v1beta2 apiVersion: metallb.io/v1beta2
kind: BGPPeer kind: BGPPeer
metadata: metadata:
name: {{ .name }} name: {{ $.Release.Name }}-{{ .name }}
namespace: metallb-system
spec: spec:
{{- with .password }} {{- with .password }}
password: {{ . }} password: {{ . }}
@@ -49,3 +48,4 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
@@ -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" . }}
+29
View File
@@ -3,7 +3,36 @@ image:
tag: upstream tag: upstream
pullPolicy: IfNotPresent 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: [] ipAddressPools: []
# - name: example
# autoAssign: true
# avoidBuggyIPs: true
# addresses:
# - 192.168.1.1-192.168.1.100
L2Advertisements: [] L2Advertisements: []
# - name: l2adv # - name: l2adv
# addressPools: # addressPools: