Question 31
You have a custom resource definition (CRD) named that represents a database resource in your Kubernetes cluster. You want to create a custom operator that automates the creation and management of these database instances. The operator should handle the following:
- Creation: When a new 'database.example.com' resource is created, the operator should provision a new PostgreSQL database instance on the cluster-
- Deletion: When a 'database.example_com' resource is deleted, the operator should clean up the corresponding PostgreSQL database instance.
- Scaling: If the 'spec-replicas' field of the 'database-example.com' resource is updated, the operator should scale the number of database instances accordingly.
Provide the necessary Kubernetes resources, custom operator code, and steps to implement this operator. You should use the 'Operator Framework' to build and deploy this operator
- Creation: When a new 'database.example.com' resource is created, the operator should provision a new PostgreSQL database instance on the cluster-
- Deletion: When a 'database.example_com' resource is deleted, the operator should clean up the corresponding PostgreSQL database instance.
- Scaling: If the 'spec-replicas' field of the 'database-example.com' resource is updated, the operator should scale the number of database instances accordingly.
Provide the necessary Kubernetes resources, custom operator code, and steps to implement this operator. You should use the 'Operator Framework' to build and deploy this operator
Question 32
You have a Deployment named 'web-app' running a containerized application with a complex startup sequence. The application relies on a database service that might be Slow to respond on startup. How would you implement Liveness and Readiness probes to ensure the application iS healthy and available to users, even during startup?
Question 33
You have a stateful application that requires persistent storage. You need to create a PersistentV01umeClaim (PVC) that Will be used by a Deployment to store application dat a. The PVC should have the following specifications:
- Access Modes: ReadWriteOnce
- Storage Class: 'fast-storage
- Storage Size: IOGi
Provide the YAML code for creating this PVC.
- Access Modes: ReadWriteOnce
- Storage Class: 'fast-storage
- Storage Size: IOGi
Provide the YAML code for creating this PVC.
Question 34
Context

Task:
1) First update the Deployment cka00017-deployment in the ckad00017 namespace:
To run 2 replicas of the pod
Add the following label on the pod:
Role userUI
2) Next, Create a NodePort Service named cherry in the ckad00017 nmespace exposing the ckad00017-deployment Deployment on TCP port 8888

Task:
1) First update the Deployment cka00017-deployment in the ckad00017 namespace:
To run 2 replicas of the pod
Add the following label on the pod:
Role userUI
2) Next, Create a NodePort Service named cherry in the ckad00017 nmespace exposing the ckad00017-deployment Deployment on TCP port 8888
Question 35
You have a microservice application that is deployed as a Deployment. You want to implement a mechanism to handle temporary network issues or other transient failures that may occur during the application's communication with external services. Explain how you can use readiness probes and liveness probes in combination with a restart policy to address these failures.



















