2018-11-23 08:36:21 +00:00
|
|
|
---
|
2019-09-10 19:06:55 +00:00
|
|
|
apiVersion: apps/v1
|
2018-11-23 08:36:21 +00:00
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: metrics-server
|
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: metrics-server
|
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
|
|
version: {{ metrics_server_version }}
|
|
|
|
spec:
|
2022-12-07 02:22:38 +00:00
|
|
|
replicas: {{ metrics_server_replicas }}
|
2018-11-23 08:36:21 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app.kubernetes.io/name: metrics-server
|
|
|
|
version: {{ metrics_server_version }}
|
2021-08-12 15:19:48 +00:00
|
|
|
strategy:
|
|
|
|
rollingUpdate:
|
|
|
|
maxUnavailable: 0
|
2018-11-23 08:36:21 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
name: metrics-server
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: metrics-server
|
|
|
|
version: {{ metrics_server_version }}
|
|
|
|
annotations:
|
2020-05-27 21:02:02 +00:00
|
|
|
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
|
2018-11-23 08:36:21 +00:00
|
|
|
spec:
|
|
|
|
priorityClassName: system-cluster-critical
|
|
|
|
serviceAccountName: metrics-server
|
2022-11-06 10:38:15 +00:00
|
|
|
hostNetwork: {{ metrics_server_host_network | default(false) }}
|
2018-11-23 08:36:21 +00:00
|
|
|
containers:
|
|
|
|
- name: metrics-server
|
|
|
|
image: {{ metrics_server_image_repo }}:{{ metrics_server_image_tag }}
|
2020-05-11 10:55:50 +00:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2021-08-12 15:19:48 +00:00
|
|
|
args:
|
2019-04-26 07:44:26 +00:00
|
|
|
- --logtostderr
|
|
|
|
- --cert-dir=/tmp
|
2022-01-07 16:18:33 +00:00
|
|
|
- --secure-port={{ metrics_server_container_port }}
|
2018-11-23 08:36:21 +00:00
|
|
|
{% if metrics_server_kubelet_preferred_address_types %}
|
|
|
|
- --kubelet-preferred-address-types={{ metrics_server_kubelet_preferred_address_types }}
|
|
|
|
{% endif %}
|
2021-01-19 13:45:44 +00:00
|
|
|
- --kubelet-use-node-status-port
|
2018-11-23 08:36:21 +00:00
|
|
|
{% if metrics_server_kubelet_insecure_tls %}
|
|
|
|
- --kubelet-insecure-tls
|
|
|
|
{% endif %}
|
|
|
|
- --metric-resolution={{ metrics_server_metric_resolution }}
|
|
|
|
ports:
|
2022-01-07 16:18:33 +00:00
|
|
|
- containerPort: {{ metrics_server_container_port }}
|
2018-11-23 08:36:21 +00:00
|
|
|
name: https
|
|
|
|
protocol: TCP
|
2019-04-26 07:44:26 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: tmp
|
|
|
|
mountPath: /tmp
|
2018-11-23 08:36:21 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
2021-08-12 15:19:48 +00:00
|
|
|
path: /livez
|
2018-11-23 08:36:21 +00:00
|
|
|
port: https
|
|
|
|
scheme: HTTPS
|
2021-08-12 15:19:48 +00:00
|
|
|
periodSeconds: 10
|
|
|
|
failureThreshold: 3
|
|
|
|
initialDelaySeconds: 40
|
2018-11-23 08:36:21 +00:00
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
2021-08-12 15:19:48 +00:00
|
|
|
path: /readyz
|
2019-04-26 07:44:26 +00:00
|
|
|
port: https
|
2018-11-23 08:36:21 +00:00
|
|
|
scheme: HTTPS
|
2021-08-12 15:19:48 +00:00
|
|
|
periodSeconds: 10
|
|
|
|
failureThreshold: 3
|
|
|
|
initialDelaySeconds: 40
|
2018-11-23 08:36:21 +00:00
|
|
|
securityContext:
|
2019-04-26 07:44:26 +00:00
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
runAsGroup: 10001
|
|
|
|
runAsNonRoot: true
|
|
|
|
runAsUser: 10001
|
2022-01-07 16:18:33 +00:00
|
|
|
allowPrivilegeEscalation: false
|
2020-09-10 10:46:02 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ metrics_server_limits_cpu }}
|
|
|
|
memory: {{ metrics_server_limits_memory }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ metrics_server_requests_cpu }}
|
|
|
|
memory: {{ metrics_server_requests_memory }}
|
2018-11-23 08:36:21 +00:00
|
|
|
volumes:
|
2019-04-26 07:44:26 +00:00
|
|
|
- name: tmp
|
|
|
|
emptyDir: {}
|
2018-11-23 08:36:21 +00:00
|
|
|
{% if not masters_are_not_tainted %}
|
|
|
|
tolerations:
|
2019-04-17 14:58:06 +00:00
|
|
|
- key: node-role.kubernetes.io/master
|
2018-11-23 08:36:21 +00:00
|
|
|
effect: NoSchedule
|
2021-01-21 16:13:03 +00:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
effect: NoSchedule
|
2018-11-23 08:36:21 +00:00
|
|
|
{% endif %}
|
|
|
|
affinity:
|
2022-12-07 02:22:38 +00:00
|
|
|
podAntiAffinity:
|
2018-11-23 08:36:21 +00:00
|
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
- weight: 100
|
2022-12-07 02:22:38 +00:00
|
|
|
podAffinityTerm:
|
|
|
|
labelSelector:
|
|
|
|
matchExpressions:
|
|
|
|
- key: app.kubernetes.io/name
|
|
|
|
operator: In
|
|
|
|
values:
|
|
|
|
- metrics-server
|
|
|
|
topologyKey: kubernetes.io/hostname
|
|
|
|
namespaces:
|
|
|
|
- kube-system
|