How to: view pods resource uage
kubectl top pod
```
output from
```
kubectl describe node
```
![image](https://user-images.githubusercontent.com/17856665/191446804-8bbf8678-70ef-4f1c-a88c-bcbe01f8b232.png)
1. Enable Metrics Server in your cluster
2. What is the cluster Node's minimum required CPU and memory?
3. Create a Pod as follows:
   - image `nginx:alpine`
   - does not restart, see `kubectl explain pod.spec`
   - only pulls a new image if not present locally, see `kubectl explain pod.spec.containers`
   - requires 0.2 CPU to start but does not exceed half of the cluster Node's CPU
   - requires 64Mi memory to start but does not exceed half of the cluster Node's memory
4. Review the running Pod and confirm resources configured as expected
5. Delete created resources
lab 6.7 solution
```sh
minikube addons enable metrics-server
kubectl get node # show node name
kubectl describe node $NODE_NAME | grep -iA10 "allocated resources:" # cpu 0.95, memory 460Mi
kubectl run mypod --image=nginx:alpine --restart=Never --image-pull-policy=IfNotPresent --dry-run=client -oyaml>lab6-7.yml
kubectl apply -f lab6-7.yml # cannot use `kubectl set` if pod don't exist
kubectl set resources pod mypod --requests=cpu=200m,memory=64Mi --limits=cpu=475m,memory=230Mi --dry-run=client -oyaml|less
nano lab6-7.yml # copy resources section of above output to pod yaml
```

```yaml
kind: Pod
spec:
  containers:
  - name: mypod
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 475m
        memory: 230Mi
      requests:
        cpu: 200m
        memory: 64Mi
```

```sh
kubectl delete -f lab6-7.yml
kubectl apply -f lab6-7.yml
kubectl describe -f lab6-7.yml | grep -iA6 limits:
kubectl delete -f lab6-7.yml
```