7. Kubernetes: Resource Requirements

Опубликовано: 21 Ноябрь 2024
на канале: iMustLearn
77
0

** Example:01 **
vi my-resource-req.yaml

apiVersion: v1
kind: Pod
metadata:
name: my-resource-req-pod
spec:
containers:
name: my-resource-req-container
image: busybox
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 3600']
resources:
requests:
cpu: 200m
memory: 10Mi
limits:
cpu: 1
memory: 20Mi

kubectl create -f my-resource-req.yaml

kubectl get pods

kubectl describe pod my-resource-req-pod

kubectl exec -it my-resource-req-pod top

kubectl get pods -o wide

kubectl describe node [node]