Skip to content

Commit

Permalink
metrics_server: add extras nodeselector, affinity, tolerations
Browse files Browse the repository at this point in the history
  • Loading branch information
pli01 committed Apr 12, 2023
1 parent c38cf5d commit c9a4ee6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions roles/kubernetes-apps/metrics_server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ metrics_server_requests_cpu: 100m
metrics_server_requests_memory: 200Mi
metrics_server_host_network: false
metrics_server_replicas: 1
# metrics_server_extra_tolerations: []
# metrics_server_extra_affinity: {}
# metrics_server_nodeselector: {}
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ spec:
volumes:
- name: tmp
emptyDir: {}
{% if not masters_are_not_tainted %}
tolerations:
{% if not masters_are_not_tainted %}
- key: node-role.kubernetes.io/master
effect: NoSchedule
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
{% endif %}
{% if metrics_server_extra_tolerations is defined %}
{{ metrics_server_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
{% endif %}
affinity:
podAntiAffinity:
Expand All @@ -105,3 +108,10 @@ spec:
topologyKey: kubernetes.io/hostname
namespaces:
- kube-system
{% if metrics_server_extra_affinity is defined %}
{{ metrics_server_extra_affinity | to_nice_yaml | indent(width=8) }}
{% endif %}
{% if metrics_server_nodeselector %}
nodeSelector:
{{ metrics_server_nodeselector | to_nice_yaml | indent(width=8) }}
{% endif %}

0 comments on commit c9a4ee6

Please sign in to comment.