Metrics Server
Collect Resource Metrics from Kubelets
Configuration
Deployment
- Deploy 2 instances of Metrics server.
- Create a service account.
- Enable pod security policy.
Helm Values
replicas: 2
rbac:
pspEnabled: true
Others
- Set anti affinity rules.
- Deploy Metrics server on control plane nodes.
- Set tolerations to control plane taints.
- Use priority class
system-cluster-critical
.
Helm Values
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- traefik
topologyKey: kubernetes.io/hostname
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
tolerations:
- key: CriticalAddonsOnly
operator: Exists
effect: NoExecute
priorityClassName: "system-cluster-critical"
Installation
Create a file named metrics-server.values.yaml
with the following content.
replicas: 2
rbac:
pspEnabled: true
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- metrics-server
topologyKey: kubernetes.io/hostname
nodeSelector:
node-role.kubernetes.io/control-plane: "true"
tolerations:
- key: CriticalAddonsOnly
operator: Exists
effect: NoExecute
priorityClassName: system-cluster-critical
Install the Metrics server with this command.
helm install --namespace kube-system --values ./metrics-server.values.yaml metrics-server metrics-server/metrics-server