DEV Community

Rayan Slim
Rayan Slim

Posted on

Installing Metrics Server

Mac

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml && kubectl patch deployment metrics-server -n kube-system --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value":"--kubelet-insecure-tls"}]'
Enter fullscreen mode Exit fullscreen mode

Windows (Powershell)

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml && kubectl patch deployment metrics-server -n kube-system --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value":"--kubelet-insecure-tls"}]'
Enter fullscreen mode Exit fullscreen mode

Windows (CMD)

If you are using Windows CMD, you will need to enter these two commands separately. The first command installs all the necessary components for the Metrics Server:

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

Enter fullscreen mode Exit fullscreen mode

The second command specifically patches the deployment manifest to add the --kubelet-insecure-tls flag to the Metrics Server configuration:

kubectl patch deployment metrics-server -n kube-system --type="json" -p="[{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/args/-\", \"value\":\"--kubelet-insecure-tls\"}]"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)