Skip to content
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
10 changes: 10 additions & 0 deletions assets/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ spec:
app.kubernetes.io/part-of: openshift-monitoring
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
weight: 100
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
Expand Down Expand Up @@ -103,6 +110,9 @@ spec:
priorityClassName: system-cluster-critical
serviceAccountName: metrics-server
terminationGracePeriodSeconds: 170
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
volumes:
- name: secret-metrics-server-client-certs
secret:
Expand Down
21 changes: 21 additions & 0 deletions jsonnet/components/metrics-server.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ function(params) {
},
spec: {
affinity: {
nodeAffinity: {
preferredDuringSchedulingIgnoredDuringExecution: [
{
weight: 100,
preference: {
matchExpressions: [
{
key: 'node-role.kubernetes.io/control-plane',
operator: 'Exists',
},
],
},
},
],
},
podAntiAffinity: {
requiredDuringSchedulingIgnoredDuringExecution: [
{
Expand Down Expand Up @@ -274,6 +289,12 @@ function(params) {
'kubernetes.io/os': 'linux',
},
priorityClassName: 'system-cluster-critical',
tolerations: [
{
key: 'node-role.kubernetes.io/master',
effect: 'NoSchedule',
},
],
serviceAccountName: 'metrics-server',
terminationGracePeriodSeconds: 170,
volumes: [
Expand Down