Ultimate CKA, exam 4 - my comments on task 7 and 13

Firstly, I needed AI help to figure out what happened to API server connectivity from inside the cluster after restoring etcd - needed to delete all kube-proxy so that it recreates iptables rules correctly.

But notes on the ambiguity of the tasks:

Task 7

Identify the CPU and memory resource capacity on cluster2-node01 node and save the results in /root/cluster2-node01-cpu.txt and /root/cluster2-node01-memory.txt, respectively, on the cluster2-controlplane.

Store the values in the following format:

<Resource-name>: <Value>

The question is ambiguous - should resource-name be cpu or node name? We are splitting all four (two metrics, two nodes) between four files so there’s no logic behind this to guess.

Task 13

A pod called elastic-app-cka02-arch is running in the default namespace. The YAML file for this pod is available at /root/elastic-app-cka02-arch.yaml on the cluster3-controlplane . The single application container in this pod writes logs to the file /var/log/elastic-app.log .

One of our logging mechanisms needs to read these logs to send them to an upstream logging server, but we don’t want to increase the read overhead for our main application container. So, you need to recreate this POD with an additional co-located container named busybox that will run along with the application container and print to the STDOUT by running the command tail -f /var/log/elastic-app.log . You can use the busybox image for this container.

I did this using initContainers sidecar and added a short sleep at the beginning - following best practices. And even though the check for the pod is green, the check for the YAML is not. Surely, without the sleep (or creating the file in advance) the initContainer crashes prematurely but in real scenario we should use sidecar/init so that we don’t miss any logs of the main container.

In task 7, this is one you can check by looking at the solution list on the End Exam page:

echo "cpu: 16" > cluster2-node01-cpu.txt
echo "memory: 65838280Ki" > cluster2-node01-memory.txt

This is typically how this kind of question is answered.

In task 13, the second container is described as co-located container. rather than an initcontainer. When the actual exam wants you to do this, it will use the term "co-located container, rather than a “sidecar container”, which is the case you implemented. This is just something you need to know about the exam. Because you are using a regular container, you’ll need to use sleep for the second container to make sure that the first container starts before the second one.

Yes, for the second one it makes sense now.

But the first still should have some example in the task what is the expected format like: cpu: 123 or Where resource-name is either “cpu” or “memory”

The Resource name in the task description is tied to the file names. There are two files to store CPU and memory values, one for each.

is not necessarily CPU or memory, it can literally mean an instance, an object, a node, a pod.

Identify the CPU and memory resource capacity - it can literally be:

  • cpu resource capacity, memory resource capacity of the node, or
  • cpu and memory of the node resource capacity

Especially if you take into account stuff like resource "aws_instance" "myec2" in terraform for example, or even CustomResourceDefinitions point at that.