General Kubernetes II
1.
What is the purpose of a Kubernetes StatefulSet?
To ensure a specific number of pod replicas are running
To manage stateful applications with unique identities
To deploy a single pod on multiple nodes
To automatically scale the number of nodes in the cluster
2.
How can you expose a Kubernetes service internally within the cluster without exposing it externally?
NodePort service type
LoadBalancer service type
ClusterIP service type
Internal service type
3.
What is the purpose of the 'PodDisruptionBudget' resource in Kubernetes?
To control the disruption of pods during voluntary disruptions
To define resource constraints for a pod
To manage external network traffic
To specify the node affinity for the pods
4.
How can you specify resource constraints (CPU and memory) for a container in a Kubernetes Pod?
resourceLimits
containerResources
podConstraints
resources
5.
What is the purpose of the 'RollingUpdate' deployment strategy in Kubernetes?
To perform a rolling restart of pods
To scale the application horizontally
To enable automatic rollback on failure
To configure rolling updates for external services
6.
How do you check the logs of a specific container within a Kubernetes Pod?
kubectl pod logs
kubectl container logs
kubectl logs pod -c
kubectl get logs
7.
What is the purpose of the 'PersistentVolume' in Kubernetes?
To store sensitive information like passwords
To manage the configuration of external services
To define persistent storage that can be used by pods
To enable automatic rollback on failure
8.
How can you define environment variables for a container in a Kubernetes Deployment?
envVars
variables
environment
env
9.
What is the purpose of the 'Job' resource in Kubernetes?
To ensure a specific number of pod replicas are running
To manage stateful applications with unique identities
To run a batch process to completion
To configure automatic pod restarts
10.
How can you scale the number of replicas in a Kubernetes Deployment imperatively (command-line approach)?
kubectl scale
kubectl resize
kubectl deploy
kubectl replicas
11.
What is the purpose of the 'PodSecurityPolicy' in Kubernetes?
To configure network policies
To specify the node affinity for the pods
To define the security context for a pod
To manage external dependencies required by the main container
12.
How can you expose a Kubernetes service using an ingress resource?
NodePort service type
ClusterIP service type
LoadBalancer service type
Ingress resource
13.
What is the purpose of the 'StorageClass' in Kubernetes?
To define persistent storage for applications
To manage external network traffic
To configure load balancing for services
To manage storage provisioning in a dynamic and scalable way
14.
How do you check the status of a Kubernetes Deployment?
kubectl status deployment
kubectl describe deployment
kubectl get status deployment
kubectl deployment status
15.
How can you roll back a deployment to a specific revision in Kubernetes?
kubectl rollback deployment
kubectl undo deployment
kubectl rollout undo deployment
kubectl restore deployment
16.
What is the purpose of the 'ResourceQuota' resource in Kubernetes?
To control the disruption of pods during voluntary disruptions
To specify resource constraints for a pod
To define resource constraints for a namespace
To configure network policies
17.
How can you specify node affinity for a pod in a Kubernetes Deployment?
nodeSelector
nodeAffinity
affinitySelector
podNodeAffinity
18.
What is the purpose of the 'ConfigMap' in Kubernetes?
To store sensitive information like passwords
To define environment variables for a container
To manage the configuration of external services
To configure pod affinity
19.
How can you expose a Kubernetes service externally using a specific port?
NodePort service type
LoadBalancer service type
ClusterIP service type
ExternalIP service type
20.
What is the role of the 'readinessProbe' in a Kubernetes Pod?
To check if a pod is ready to serve traffic
To restart the pod if it fails
To terminate the pod if it exceeds resource limits
To monitor the CPU usage of the pod