-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add metallb chart * make ck-loadbalancer chart work with cilium or metallb * implement metallb feature * moonray use metallb --------- Co-authored-by: Angelos Kolaitis <[email protected]>
- Loading branch information
1 parent
24e01db
commit 956e6b2
Showing
15 changed files
with
315 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
k8s/manifests/charts/ck-loadbalancer/templates/metallb/bgp-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- if (eq .Values.driver "metallb") }} | ||
{{- if .Values.bgp.enabled }} | ||
|
||
apiVersion: "metallb.io/v1beta2" | ||
kind: BGPPeer | ||
metadata: | ||
name: {{ include "ck-loadbalancer.fullname" . }} | ||
labels: | ||
{{- include "ck-loadbalancer.labels" . | nindent 4 }} | ||
spec: | ||
myASN: {{ .Values.bgp.localASN }} | ||
{{- with (index .Values.bgp.neighbors 0) }} | ||
peerASN: {{ .peerASN }} | ||
peerAddress: {{ .peerAddress }} | ||
peerPort: {{ .peerPort }} | ||
{{- end }} | ||
|
||
--- | ||
|
||
apiVersion: "metallb.io/v1beta1" | ||
kind: BGPAdvertisement | ||
metadata: | ||
name: {{ include "ck-loadbalancer.fullname" . }} | ||
labels: | ||
{{- include "ck-loadbalancer.labels" . | nindent 4 }} | ||
spec: | ||
ipAddressPools: | ||
- {{ include "ck-loadbalancer.fullname" . }} | ||
|
||
{{- end }} | ||
{{- end}} |
19 changes: 19 additions & 0 deletions
19
k8s/manifests/charts/ck-loadbalancer/templates/metallb/l2-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- if (eq .Values.driver "metallb") -}} | ||
{{- if .Values.l2.enabled }} | ||
|
||
apiVersion: "metallb.io/v1beta1" | ||
kind: L2Advertisement | ||
metadata: | ||
name: {{ include "ck-loadbalancer.fullname" . }} | ||
labels: | ||
{{- include "ck-loadbalancer.labels" . | nindent 4 }} | ||
spec: | ||
ipAddressPools: | ||
- {{ include "ck-loadbalancer.fullname" . }} | ||
{{- with .Values.l2.interfaces }} | ||
interfaces: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
{{- end }} | ||
{{- end }} |
19 changes: 19 additions & 0 deletions
19
k8s/manifests/charts/ck-loadbalancer/templates/metallb/lb-ip-pool.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ if (eq .Values.driver "metallb") }} | ||
{{ if .Values.ipPool.cidrs }} | ||
apiVersion: "metallb.io/v1beta1" | ||
kind: IPAddressPool | ||
metadata: | ||
name: {{ include "ck-loadbalancer.fullname" . }} | ||
labels: | ||
{{- include "ck-loadbalancer.labels" . | nindent 4 }} | ||
spec: | ||
addresses: | ||
{{- range .Values.ipPool.cidrs }} | ||
{{- if .cidr }} | ||
- {{ .cidr }} | ||
{{- else if and .start .stop }} | ||
- {{ printf "%s-%s" .start .stop }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
driver: | ||
|
||
l2: | ||
enabled: true | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package metallb | ||
|
||
import ( | ||
"path" | ||
|
||
"github.com/canonical/k8s/pkg/client/helm" | ||
) | ||
|
||
var ( | ||
// chartMetalLB represents manifests to deploy MetalLB speaker and controller. | ||
chartMetalLB = helm.InstallableChart{ | ||
Name: "metallb", | ||
Namespace: "metallb-system", | ||
ManifestPath: path.Join("charts", "metallb-0.14.5.tgz"), | ||
} | ||
|
||
// chartMetalLBLoadBalancer represents manifests to deploy MetalLB L2 or BGP resources. | ||
chartMetalLBLoadBalancer = helm.InstallableChart{ | ||
Name: "metallb-loadbalancer", | ||
Namespace: "metallb-system", | ||
ManifestPath: path.Join("charts", "ck-loadbalancer"), | ||
} | ||
|
||
// controllerImageRepo is the image to use for metallb-controller. | ||
controllerImageRepo = "quay.io/metallb/controller" | ||
|
||
// controllerImageTag is the tag to use for metallb-controller. | ||
controllerImageTag = "v0.14.5" | ||
|
||
// speakerImageRepo is the image to use for metallb-speaker. | ||
speakerImageRepo = "quay.io/metallb/speaker" | ||
|
||
// speakerImageTag is the tag to use for metallb-speaker. | ||
speakerImageTag = "v0.14.5" | ||
|
||
// frrImageRepo is the image to use for frrouting. | ||
frrImageRepo = "quay.io/frrouting/frr" | ||
|
||
// frrImageTag is the tag to use for frrouting. | ||
frrImageTag = "9.0.2" | ||
) |
Oops, something went wrong.