# How can I install metrics-server

**URL:** <https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518>\
**Category:** microk8s\
**Tags:** metrics-server\
**Created:** [March 18, 2023, 8:34am UTC](https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518 "2023-03-18T08:34:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asif\_Muzammil](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/asif_muzammil/32/11028_2.png) [@Asif\_Muzammil](https://discuss.kubernetes.io/u/Asif_Muzammil)\
**Post date:** [March 18, 2023, 8:34am UTC](https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518/1 "2023-03-18T08:34:12Z")

</div>

hello everyone!  
I want to know how to install metrics-server on microk8s  
here is any git repo link or other any guidelines for it

thanks

---

<div class="post-metadata">

**Author:** ![krishanshamod](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@krishanshamod](https://discuss.kubernetes.io/u/krishanshamod)\
**Post date:** [March 30, 2023, 4:42pm UTC](https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518/2 "2023-03-30T16:42:01Z")

</div>

You can install it using this command.

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

```

Also you can use this Helm chart.

```auto
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/

helm upgrade --install metrics-server metrics-server/metrics-server

```

---

<div class="post-metadata">

**Author:** ![henzbnzr](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/henzbnzr/32/12874_2.png) [@henzbnzr](https://discuss.kubernetes.io/u/henzbnzr)\
**Post date:** [August 16, 2023, 10:22am UTC](https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518/3 "2023-08-16T10:22:16Z")

</div>

add this line in spec.  
**kubectl edit deployments.apps metrics-server**

spec:  
containers:  
- args:  
- --cert-dir=/tmp  
- --secure-port=4443  
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname  
- --kubelet-use-node-status-port  
- --metric-resolution=15s  
\> command:

> ```
> - /metrics-server
> - --kubelet-insecure-tls
> - --kubelet-preferred-address-types=InternalIP
> 
> ```

```
    image: registry.k8s.io/metrics-server/metrics-server:v0.6.4
    imagePullPolicy: IfNotPresent
    livenessProbe:

```

---

<div class="post-metadata">

**Author:** ![Josphat\_Mutai](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/josphat_mutai/32/15525_2.png) [@Josphat\_Mutai](https://discuss.kubernetes.io/u/Josphat_Mutai)\
**Post date:** [August 5, 2024, 5:17pm UTC](https://discuss.kubernetes.io/t/how-can-i-install-metrics-server/23518/4 "2024-08-05T17:17:20Z")

</div>

Yes changing the port to 4443 works. I used with patch as documented here: [https://computingforgeeks.com/fix-error-metrics-api-not-available-in-kubernetes/](https://computingforgeeks.com/fix-error-metrics-api-not-available-in-kubernetes/)
