components.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. labels:
  5. k8s-app: metrics-server
  6. name: metrics-server
  7. namespace: kube-system
  8. ---
  9. apiVersion: rbac.authorization.k8s.io/v1
  10. kind: ClusterRole
  11. metadata:
  12. labels:
  13. k8s-app: metrics-server
  14. rbac.authorization.k8s.io/aggregate-to-admin: "true"
  15. rbac.authorization.k8s.io/aggregate-to-edit: "true"
  16. rbac.authorization.k8s.io/aggregate-to-view: "true"
  17. name: system:aggregated-metrics-reader
  18. rules:
  19. - apiGroups:
  20. - metrics.k8s.io
  21. resources:
  22. - pods
  23. - nodes
  24. verbs:
  25. - get
  26. - list
  27. - watch
  28. ---
  29. apiVersion: rbac.authorization.k8s.io/v1
  30. kind: ClusterRole
  31. metadata:
  32. labels:
  33. k8s-app: metrics-server
  34. name: system:metrics-server
  35. rules:
  36. - apiGroups:
  37. - ""
  38. resources:
  39. - nodes/metrics
  40. verbs:
  41. - get
  42. - apiGroups:
  43. - ""
  44. resources:
  45. - pods
  46. - nodes
  47. verbs:
  48. - get
  49. - list
  50. - watch
  51. ---
  52. apiVersion: rbac.authorization.k8s.io/v1
  53. kind: RoleBinding
  54. metadata:
  55. labels:
  56. k8s-app: metrics-server
  57. name: metrics-server-auth-reader
  58. namespace: kube-system
  59. roleRef:
  60. apiGroup: rbac.authorization.k8s.io
  61. kind: Role
  62. name: extension-apiserver-authentication-reader
  63. subjects:
  64. - kind: ServiceAccount
  65. name: metrics-server
  66. namespace: kube-system
  67. ---
  68. apiVersion: rbac.authorization.k8s.io/v1
  69. kind: ClusterRoleBinding
  70. metadata:
  71. labels:
  72. k8s-app: metrics-server
  73. name: metrics-server:system:auth-delegator
  74. roleRef:
  75. apiGroup: rbac.authorization.k8s.io
  76. kind: ClusterRole
  77. name: system:auth-delegator
  78. subjects:
  79. - kind: ServiceAccount
  80. name: metrics-server
  81. namespace: kube-system
  82. ---
  83. apiVersion: rbac.authorization.k8s.io/v1
  84. kind: ClusterRoleBinding
  85. metadata:
  86. labels:
  87. k8s-app: metrics-server
  88. name: system:metrics-server
  89. roleRef:
  90. apiGroup: rbac.authorization.k8s.io
  91. kind: ClusterRole
  92. name: system:metrics-server
  93. subjects:
  94. - kind: ServiceAccount
  95. name: metrics-server
  96. namespace: kube-system
  97. ---
  98. apiVersion: v1
  99. kind: Service
  100. metadata:
  101. labels:
  102. k8s-app: metrics-server
  103. name: metrics-server
  104. namespace: kube-system
  105. spec:
  106. ports:
  107. - name: https
  108. port: 443
  109. protocol: TCP
  110. targetPort: https
  111. selector:
  112. k8s-app: metrics-server
  113. ---
  114. apiVersion: apps/v1
  115. kind: Deployment
  116. metadata:
  117. labels:
  118. k8s-app: metrics-server
  119. name: metrics-server
  120. namespace: kube-system
  121. spec:
  122. selector:
  123. matchLabels:
  124. k8s-app: metrics-server
  125. strategy:
  126. rollingUpdate:
  127. maxUnavailable: 0
  128. template:
  129. metadata:
  130. labels:
  131. k8s-app: metrics-server
  132. spec:
  133. containers:
  134. - args:
  135. - --cert-dir=/tmp
  136. - --kubelet-insecure-tls
  137. - --secure-port=4443
  138. - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
  139. - --kubelet-use-node-status-port
  140. - --metric-resolution=15s
  141. image: registry.k8s.io/metrics-server/metrics-server:v0.6.4
  142. imagePullPolicy: IfNotPresent
  143. livenessProbe:
  144. failureThreshold: 3
  145. httpGet:
  146. path: /livez
  147. port: https
  148. scheme: HTTPS
  149. periodSeconds: 10
  150. name: metrics-server
  151. ports:
  152. - containerPort: 4443
  153. name: https
  154. protocol: TCP
  155. readinessProbe:
  156. failureThreshold: 3
  157. httpGet:
  158. path: /readyz
  159. port: https
  160. scheme: HTTPS
  161. initialDelaySeconds: 20
  162. periodSeconds: 10
  163. resources:
  164. requests:
  165. cpu: 100m
  166. memory: 200Mi
  167. securityContext:
  168. allowPrivilegeEscalation: false
  169. readOnlyRootFilesystem: true
  170. runAsNonRoot: true
  171. runAsUser: 1000
  172. volumeMounts:
  173. - mountPath: /tmp
  174. name: tmp-dir
  175. nodeSelector:
  176. kubernetes.io/os: linux
  177. priorityClassName: system-cluster-critical
  178. serviceAccountName: metrics-server
  179. volumes:
  180. - emptyDir: {}
  181. name: tmp-dir
  182. ---
  183. apiVersion: apiregistration.k8s.io/v1
  184. kind: APIService
  185. metadata:
  186. labels:
  187. k8s-app: metrics-server
  188. name: v1beta1.metrics.k8s.io
  189. spec:
  190. group: metrics.k8s.io
  191. groupPriorityMinimum: 100
  192. insecureSkipTLSVerify: true
  193. service:
  194. name: metrics-server
  195. namespace: kube-system
  196. version: v1beta1
  197. versionPriority: 100