Lab Information
The Nautilus DevOps team has noticed performance issues in some Kubernetes-hosted applications due to resource constraints. To address this, they plan to set limits on resource utilization. Here are the details:
Create a pod named httpd-pod with a container named httpd-container. Use the httpd image with the latest tag (specify as httpd:latest). Set the following resource limits:
Requests: Memory: 15Mi, CPU: 100m
Limits: Memory: 20Mi, CPU: 100m
Note: The kubectl utility on jump_host is configured to operate with the Kubernetes cluster.
Lab Solutions
Step 1: Create the HTTPD Pod with Resource Limits
Create the httpd pod with resource requests and limits
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: httpd-pod
spec:
containers:
- name: httpd-container
image: httpd:latest
resources:
requests:
memory: "15Mi"
cpu: "100m"
limits:
memory: "20Mi"
cpu: "100m"
ports:
- containerPort: 80
EOF
Step 2: Verification
Check if the pod is running:
kubectl get pod httpd-pod
kubectl describe pod httpd-pod


Top comments (0)