- Print
- DarkLight
How To Install or Upgrade the Metrics Server
Background
The Kubernetes Metrics Server is an aggregator of resource usage data in your Kubernetes cluster. The version of the Metrics Server you should be running on your cluster depends on the version of Kubernetes you are running on the cluster.
Compatibility Matrix
Before installing or upgrading the Metrics Server, always verify the compatibility of the Metrics Server version with the version of Kubernetes running on your cluster and follow best practices for testing in a non-production environment before deploying to production. The following table lists which version of the Metrics Server is compatible with each version of Kubernetes:
Metrics Server | Supported Kubernetes Version |
---|---|
0.7.x | 1.19+ |
0.6.x | 1.19+ |
0.5.x | 1.8+ |
0.4.x | 1.8+ |
0.3.x | 1.8 - 1.21 |
You can verify Metrics Server/Kubernetes version compatibility at https://github.com/kubernetes-sigs/metrics-server/blob/master/README.md
Solution - Installation
You can use Kubernetes manifests or package managers to install the Kubernetes Metrics Server.
Procedure Using the YAML Manifest
To install the latest version of the Kubernetes Metrics Server:
- Do one of the following:
- To install the latest version, use the following command:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- To install a specific version, use the following command:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v<version>/components.yaml
where<version>
is the version number of the Metrics Server you want to install.
- To install the latest version, use the following command:
- Use the following command to verify that the Metrics Server components are running:
kubectl get pods -n kube-system
Procedure Using HELM Chart Package Manager
To install the Kubernetes Metrics Server:
- Use the Helm Installation Guide to install Helm (if not already installed).
- Use the following command to add the Metrics Server Helm repository:
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server
- Do one of the following:
- To install the latest version, use the following command:
helm install metrics-server metrics-server/metrics-server
- To install a specific version, use the following command:
helm install metrics-server metrics-server/metrics-server -–version <version>
where<version>
is the version number of the Metrics Server you want to install.
- To install the latest version, use the following command:
- Use the following command to verify that the Metrics Server components are running:
kubectl get pods -n kube-system
Solution - Upgrade
You can use Kubernetes manifests or package managers to upgrade the Kubernetes Metrics Server.
Procedure Using the YAML Manifest
To upgrade the Kubernetes Metrics Server:
- Do one of the following:
- To upgrade to the latest version, use the following command:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- To upgrade to a specific version, use the following command:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v<version>/components.yaml
where<version>
is the version number of the Metrics Server you want to upgrade to.
- To upgrade to the latest version, use the following command:
- Use the following command to verify that the Metrics Server components are running:
kubectl get pods -n kube-system
Procedure Using HELM Chart Package Manager
To upgrade the Kubernetes Metrics Server:
- Use the Helm Installation Guide to install Helm (if not already installed).
- Use the following command to add the Metrics Server Helm repository:
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server
- Do one of the following:
- To upgrade to the latest version, use the following command:
helm upgrade metrics-server metrics-server/metrics-server
- To upgrade to a specific version, use the following command:
helm upgrade metrics-server metrics-server/metrics-server -–version <version>
where<version>
is the version number of the Metrics Server you want to upgrade to.
- To upgrade to the latest version, use the following command:
- Use the following command to verify that the Metrics Server components are running:
kubectl get pods -n kube-system