Question 96

Exhibit:

Given a container that writes a log file in format A and a container that converts log files from format A to format B, create a deployment that runs both containers such that the log files from the first container are converted by the second container, emitting logs in format B.
Task:
* Create a deployment named deployment-xyz in the default namespace, that:
* Includes a primary
lfccncf/busybox:1 container, named logger-dev
* includes a sidecar Ifccncf/fluentd:v0.12 container, named adapter-zen
* Mounts a shared volume /tmp/log on both containers, which does not persist when the pod is deleted
* Instructs the logger-dev
container to run the command

which should output logs to /tmp/log/input.log in plain text format, with example values:

* The adapter-zen sidecar container should read /tmp/log/input.log and output the data to /tmp/log/output.* in Fluentd JSON format. Note that no knowledge of Fluentd is required to complete this task: all you will need to achieve this is to create the ConfigMap from the spec file provided at /opt/KDMC00102/fluentd-configma p.yaml , and mount that ConfigMap to /fluentd/etc in the adapter-zen sidecar container
  • Question 97

    You have a stateful set named 'mysql-statefulset' that runs a MySQL database. The database data is stored in a PersistentV01umeClaim (PVC) named 'mysql-pvc' _ You want to ensure that the PVC is always mounted to the same pod, even after a pod restart or replacement. Additionally, you want to configure the PVC to use a specific storage class tor data persistence.

    Question 98

    You have a container image for your application that includes both the application code and its dependencies. However, you've noticed that the image size is becoming increasingly large. How would you optimize tne container image to reduce its size and improve deployment efficiency?

    Question 99

    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

    Question 100


    Context
    As a Kubernetes application developer you will often find yourself needing to update a running application.
    Task
    Please complete the following:
    * Update the app deployment in the kdpd00202 namespace with a maxSurge of 5% and a maxUnavailable of
    2%
    * Perform a rolling update of the web1 deployment, changing the Ifccncf/ngmx image version to 1.13
    * Roll back the app deployment to the previous version