Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetalLB: keep nodeSelector in one place #7931

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions roles/kubernetes-apps/metallb/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ metallb_port: "7472"
metallb_memberlist_port: "7946"
metallb_peers: []
metallb_speaker_enabled: true
metallb_speaker_nodeselector: {}
metallb_controller_nodeselector: {}
metallb_speaker_nodeselector:
kubernetes.io/os: "linux"
metallb_controller_nodeselector:
kubernetes.io/os: "linux"
metallb_speaker_tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
Expand Down
14 changes: 5 additions & 9 deletions roles/kubernetes-apps/metallb/templates/metallb.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,12 @@ spec:
- ALL
readOnlyRootFilesystem: true
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: speaker
terminationGracePeriodSeconds: 2
{% if metallb_speaker_nodeselector %}
nodeSelector:
{{ metallb_speaker_nodeselector | to_nice_yaml | indent(width=8) }}
{%- endif %}
serviceAccountName: speaker
terminationGracePeriodSeconds: 2
{% if metallb_speaker_tolerations %}
tolerations:
{{ metallb_speaker_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
Expand Down Expand Up @@ -435,10 +433,6 @@ 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) }}
Expand All @@ -463,8 +457,10 @@ spec:
drop:
- all
readOnlyRootFilesystem: true
{% if metallb_controller_nodeselector %}
nodeSelector:
kubernetes.io/os: linux
{{ metallb_controller_nodeselector | to_nice_yaml | indent(width=8) }}
{%- endif %}
securityContext:
runAsNonRoot: true
runAsUser: 65534
Expand Down