Complete the code to define a PriorityClass named 'high-priority' with a value of 1000.
apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: name: high-priority value: [1] globalDefault: false description: "High priority class for critical workloads"
The value field sets the priority number. Higher numbers mean higher priority. Here, 1000 is used for high priority.
Complete the code to assign the 'high-priority' PriorityClass to a Pod spec.
apiVersion: v1
kind: Pod
metadata:
name: critical-pod
spec:
priorityClassName: [1]
containers:
- name: app
image: nginxThe priorityClassName field assigns the pod to the specified PriorityClass. Here, 'high-priority' is used.
Fix the error in the PriorityClass definition by completing the missing field.
apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: name: [1] value: 1000 globalDefault: false description: "Critical workload priority"
The metadata.name must be set to the PriorityClass name. Here, 'high-priority' matches the intended critical workload class.
Fill both blanks to create a PriorityClass with a value of 2000 and set it as the global default.
apiVersion: scheduling.k8s.io/v1 kind: PriorityClass metadata: name: [1] value: [2] globalDefault: true description: "Default priority for critical workloads"
The name is set to 'critical-default' and value to 2000 for a very high priority. Setting globalDefault to true makes this the default PriorityClass.
Fill all three blanks to create a Pod spec that uses the 'critical-default' PriorityClass and runs an nginx container.
apiVersion: v1 kind: Pod metadata: name: [1] spec: priorityClassName: [2] containers: - name: [3] image: nginx
The pod is named 'nginx-pod', uses the 'critical-default' PriorityClass, and runs a container named 'app-container' with the nginx image.