metrics-server-deployment.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: metrics-server
  6. namespace: kube-system
  7. ---
  8. apiVersion: apps/v1
  9. kind: Deployment
  10. metadata:
  11. name: metrics-server
  12. namespace: kube-system
  13. labels:
  14. k8s-app: metrics-server
  15. spec:
  16. selector:
  17. matchLabels:
  18. k8s-app: metrics-server
  19. template:
  20. metadata:
  21. name: metrics-server
  22. labels:
  23. k8s-app: metrics-server
  24. spec:
  25. serviceAccountName: metrics-server
  26. volumes:
  27. # mount in tmp so we can safely use from-scratch images and/or read-only containers
  28. - name: tmp-dir
  29. emptyDir: {}
  30. containers:
  31. - name: metrics-server
  32. image: registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server-amd64:v0.3.6
  33. args:
  34. - --cert-dir=/tmp
  35. - --secure-port=4443
  36. ports:
  37. - name: main-port
  38. containerPort: 4443
  39. protocol: TCP
  40. securityContext:
  41. readOnlyRootFilesystem: true
  42. runAsNonRoot: true
  43. runAsUser: 1000
  44. imagePullPolicy: Always
  45. volumeMounts:
  46. - name: tmp-dir
  47. mountPath: /tmp
  48. nodeSelector:
  49. beta.kubernetes.io/os: linux