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:
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:Note: The kubectl utility on jump_host is configured to operate with the Kubernetes cluster.
Let’s create pod.yaml file with with these contents. Our updated file will be look like this:
apiVersion: v1
kind: Pod
metadata:
name: httpd-pod
labels:
app: httpd_pod
spec:
containers:
- name: httpd-container
image: httpd:latest
ports:
- containerPort: 80
resources:
limits:
cpu: 100m
memory: 20Mi
requests:
cpu: 100m
memory: 15Mi
Let’s create the pod:
kubectl apply -f pod.yml
Verify pod:
kubectl get pods