[metrics_server]: Enabled HA mode by adding 'metrics_server_replicas'… (#9539)

* [metrics_server]: Enabled HA mode by adding 'metrics_server_replicas' variable and adding podAntiAffinity rule

Signed-off-by: Ugur Can Ozturk <57688057+ugur99@users.noreply.github.com>

* [metrics_server]: added namespaces selector

Signed-off-by: Ugur Can Ozturk <57688057+ugur99@users.noreply.github.com>

Signed-off-by: Ugur Can Ozturk <57688057+ugur99@users.noreply.github.com>
This commit is contained in:
Ugur Can Ozturk 2022-12-07 05:22:38 +03:00 committed by GitHub
parent 5ae3e2818b
commit a0f41bf82a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View file

@ -19,6 +19,7 @@ metrics_server_enabled: false
# metrics_server_metric_resolution: 15s
# metrics_server_kubelet_preferred_address_types: "InternalIP,ExternalIP,Hostname"
# metrics_server_host_network: false
# metrics_server_replicas: 1
# Rancher Local Path Provisioner
local_path_provisioner_enabled: false

View file

@ -8,3 +8,4 @@ metrics_server_limits_memory: 200Mi
metrics_server_requests_cpu: 100m
metrics_server_requests_memory: 200Mi
metrics_server_host_network: false
metrics_server_replicas: 1

View file

@ -9,6 +9,7 @@ metadata:
addonmanager.kubernetes.io/mode: Reconcile
version: {{ metrics_server_version }}
spec:
replicas: {{ metrics_server_replicas }}
selector:
matchLabels:
app.kubernetes.io/name: metrics-server
@ -91,12 +92,16 @@ spec:
effect: NoSchedule
{% endif %}
affinity:
nodeAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: In
values:
- ""
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- metrics-server
topologyKey: kubernetes.io/hostname
namespaces:
- kube-system