Question 51

You are developing a microservices application consisting of several deployments. One of the deployments, named 'order-service- deployments , is responsible for processing orders. Each order requires a specific backend service to process the order. You need to design a mechanism that automatically assigns an appropriate backend service to each order processing pod based on the order type. For example, orders for "books" should be assigned to the 'book-service' backend, while orders for "electronics" should be assigned to the 'electronics-service backend. Explain how you would implement this dynamic backend service assignment mechanism.

Question 52

You have a Deployment named 'my-app-deployment' running a Flask application. You need to configure a rolling update strategy with a maximum of one pod unavailable at any time. You also want to trigger an automatic update whenever a new image is pushed to the Docker Hub repository. Additionally, you want to analyze the application logs during the update process to ensure everything is working smoothly. How would you achieve this?

Question 53

You're managing a Kubernetes cluster with various applications. You want to implement a mechanism that automatically scales deployments based on CPU utilization. The scaling should be triggered when CPU utilization exceeds 70% and should scale down to 50% utilization.

Question 54

You are running a Kubernetes cluster with a deployment for a critical application. The application uses sensitive data stored in a secret. To ensure security, you need to implement a policy that prevents the deployment of pods for this application if the secret containing the sensitive data is missing. How would you implement this using Custom Resource Definitions (CRDs) and Admission Webhooks?

Question 55

You have a Deployment named 'my-app-deployment' that runs 3 replicas of a Spring Boot application. This application needs to access a PostgreSQL database hosted on your Kubernetes cluster. You need to create a Custom Resource Definition (CRD) to define a new resource called 'Database' to represent the PostgreSQL database instances within your cluster. This CRD should include fields for specifying the database name, username, password, and the host where the database is deployed. Further, you need to configure the 'my- app-deployment' to use the 'Database' resource to connect to the PostgreSQL instance dynamically.