Deployment and Setup
Prerequisites
Before deploying Metrics Server, ensure:
- Kubernetes cluster is running
- kubectl is configured
- Cluster has sufficient resources
Deployment Methods
1. Direct Kubernetes Deployment
## Download Metrics Server manifest
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
## Verify installation
kubectl get deployment metrics-server -n kube-system
2. Helm Installation
## Add Helm repository
helm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server/
## Install Metrics Server
helm upgrade --install metrics-server metrics-server/metrics-server
Configuration Options
graph LR
A[Metrics Server Config] --> B[Resource Limits]
A --> C[TLS Settings]
A --> D[Node Selector]
A --> E[Tolerations]
Key Configuration Parameters
Parameter |
Description |
Default Value |
--kubelet-insecure-tls |
Allow insecure TLS connections |
false |
--metric-resolution |
Interval between metric collections |
15s |
--kubelet-preferred-address-types |
Address types for kubelet connection |
InternalIP,Hostname |
Troubleshooting Common Installation Issues
TLS Certificate Verification
## Patch deployment to skip TLS verification
kubectl patch deployment metrics-server \
-n kube-system \
--type='json' \
-p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"}]'
Verification Steps
## Check Metrics Server pods
kubectl get pods -n kube-system | grep metrics-server
## Verify metrics collection
kubectl top nodes
kubectl top pods
LabEx Tip
LabEx Kubernetes environments provide pre-configured Metrics Server setups for seamless learning and practice.