CKA-2025 MOCK Q-06 PRIORITY
Generate a PriorityClass named urgent-priority for urgent workloads,
setting the value to 10 less than the highest current user-defined priority class value.
Patch the Deployment mysql-writer in the database namespace to use the urgent-priority class and verify a successful rollout.
Note – Pods from other Deployments in the database namespace should be evicted if resources Cruch
kubectl create namespace database
# redis-cache Deployment
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-cache
namespace: database
spec:
replicas: 2
selector:
matchLabels:
app: redis-cache
template:
metadata:
labels:
app: redis-cache
spec:
containers:
- name: redis
image: redis:7
resources:
requests:
cpu: "400m"
memory: "256Mi"
EOF
# mysql-writer Deployment
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-writer
namespace: database
spec:
replicas: 2
selector:
matchLabels:
app: mysql-writer
template:
metadata:
labels:
app: mysql-writer
spec:
containers:
- name: mysql
image: mysql:8
resources:
requests:
cpu: "400m"
memory: "256Mi"
env:
- name: MYSQL_ROOT_PASSWORD
value: example
EOF
Comments
Post a Comment