CKS MOCK EXAM 1 question8

Hi,

I am practicing CKS MOCK exam 1 question 8. Unable to understand steps properly for creation of admission controller and updating kube-apiserver with admission-config-file.
This is causing my kube-apiserver to become unresponsive.

Can you pls explain stepwise, although i have gone through the solution still stuck

To truly understand what you are getting wrong, know how to diagnose crashed API server.

If you crash a cluster in the exam and cannot recover it, you will score zero for every other question done on that cluster.

thanks for prompt response
pls explain solution for CKS MOCK TEST 1 Question 8 (ImageWebhook)

There are several things you can get wrong here that will crash the cluster

  • Syntax error in the policy file
  • Misunderstanding the relationship between the location of the policy in the controlplane file system and the container filesystem
  • Not getting the api server arguments correct.

I strongly recommend you work through the process of finding out why you are crashing the API server. Being able to do this in the exam can make the difference between passing and failing, bearing in mind what I pointed out in my previous post.

If you just want the answers, they are here. The detailed explanations for mock 1 and 2 were written by me. I have yet to improve mock 3.

As per solution shared, we are creating the admission config under /root/CKS/ImagePloicy however in the kubeapiserver --admission-control-config-file we are using the path as /etc/admission-controllers

Additionally under /etc we do not find directory as admission-controller

Can you pls check and assist.
Is it possible to have a quick call to close this.

There really is not that much to this provided you do not confuse what goes where.

In the above image

  1. Create the admission configuration. Here I have used cat to do it, but that gives the same result as doing
    vi /root/CKS/ImagePolicy/admission-configuration.yaml
    putting the policy in there and then saving it. The crucial thing is that this file must be at the given path. You do not create it as /etc/admission-controllers/admission-configuration.yaml. That is the path inside kube-apiserver container as provided by the existing volume mount.
    Note also that this file is loaded by api server from the container’s file system. This means that the kubeconfig file which you are told is in /root/CKS/ImagePolicy on the host will appear in /etc/admission-controllers inside the container. If this is where your confusion lies, return to CKA lectures on volume mounts.
  2. Edit the kube-apiserver manifest to set the needed command line arguments.
  3. Watching the containers to see kube-apiserver come back up, which it will
  4. Update the image of the pod.

If you make any of the mistakes I listed in previous post, it will not work.