Add nodeselector and tolerations for metallb (#7334)
* add nodeselector and tolerations for metallb * remove unnecessary commented lines in metallb template * set default speaker toleration to match original manifestpull/7265/head
parent
dc5df57c26
commit
c7db72e1da
|
@ -132,6 +132,28 @@ cert_manager_enabled: false
|
|||
metallb_enabled: false
|
||||
# metallb_ip_range:
|
||||
# - "10.5.0.50-10.5.0.99"
|
||||
# metallb_speaker_nodeselector:
|
||||
# kubernetes.io/os: "linux"
|
||||
# metallb_controller_nodeselector:
|
||||
# kubernetes.io/os: "linux"
|
||||
# metallb_speaker_tolerations:
|
||||
# - key: "node-role.kubernetes.io/master"
|
||||
# operator: "Equal"
|
||||
# value: ""
|
||||
# effect: "NoSchedule"
|
||||
# - key: "node-role.kubernetes.io/control-plane"
|
||||
# operator: "Equal"
|
||||
# value: ""
|
||||
# effect: "NoSchedule"
|
||||
# metallb_controller_tolerations:
|
||||
# - key: "node-role.kubernetes.io/master"
|
||||
# operator: "Equal"
|
||||
# value: ""
|
||||
# effect: "NoSchedule"
|
||||
# - key: "node-role.kubernetes.io/control-plane"
|
||||
# operator: "Equal"
|
||||
# value: ""
|
||||
# effect: "NoSchedule"
|
||||
# metallb_version: v0.9.5
|
||||
# metallb_protocol: "layer2"
|
||||
# metallb_port: "7472"
|
||||
|
|
|
@ -6,3 +6,11 @@ metallb_port: "7472"
|
|||
metallb_limits_cpu: "100m"
|
||||
metallb_limits_mem: "100Mi"
|
||||
metallb_peers: []
|
||||
metallb_speaker_nodeselector: {}
|
||||
metallb_controller_nodeselector: {}
|
||||
metallb_speaker_tolerations:
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/master
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/control-plane
|
||||
metallb_controller_tolerations: []
|
||||
|
|
|
@ -345,11 +345,14 @@ spec:
|
|||
kubernetes.io/os: linux
|
||||
serviceAccountName: speaker
|
||||
terminationGracePeriodSeconds: 2
|
||||
{% if metallb_speaker_nodeselector %}
|
||||
nodeSelector:
|
||||
{{ metallb_speaker_nodeselector | to_nice_yaml | indent(width=8) }}
|
||||
{%- endif %}
|
||||
{% if metallb_speaker_tolerations %}
|
||||
tolerations:
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/master
|
||||
- effect: NoSchedule
|
||||
key: node-role.kubernetes.io/control-plane
|
||||
{{ metallb_speaker_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
|
||||
{% endif %}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
@ -374,6 +377,14 @@ spec:
|
|||
app: metallb
|
||||
component: controller
|
||||
spec:
|
||||
{% if metallb_controller_nodeselector %}
|
||||
nodeSelector:
|
||||
{{ metallb_controller_nodeselector | to_nice_yaml | indent(width=8) }}
|
||||
{%- endif %}
|
||||
{% if metallb_controller_tolerations %}
|
||||
tolerations:
|
||||
{{ metallb_controller_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
|
||||
{% endif %}
|
||||
containers:
|
||||
- args:
|
||||
- --port={{ metallb_port }}
|
||||
|
|
Loading…
Reference in New Issue