Tips on preparing for Certified Kubernetes Application Developer (CKAD)

    8
    34



    Tips on preparing for Certified Kubernetes Application Developer (CKAD)

    Commands shared in the PPT
    kubectl run nginx –image=nginx (deployment)
    kubectl run nginx –image=nginx –restart=Never (pod)
    kubectl run nginx –image=nginx –restart=OnFailure (job)
    kubectl run nginx –image=nginx –restart=OnFailure –schedule=”* * * * *” (cronJob)

    kubectl run nginx -image=nginx –restart=Never –port=80 –namespace=myname –command –serviceaccount=mysa1 –env=HOSTNAME=local –labels=bu=finance,env=dev –requests=’cpu=100m,memory=256Mi’ –limits=’cpu=200m,memory=512Mi’ –dry-run -o yaml – /bin/sh -c ‘echo hello world’

    kubectl run frontend –replicas=2 –labels=run=load-balancer-example –image=busybox –port=8080
    kubectl expose deployment frontend –type=NodePort –name=frontend-service –port=6262 –target-port=8080
    kubectl set serviceaccount deployment frontend myuser
    kubectl create service clusterip my-cs –tcp=5678:8080 –dry-run -o yaml

    source

    Previous articleTop 50 Python Interview Questions and Answers||Python Interview Preparation Freshers and Experienced
    Next article1 Videoda #Apache Kafka Nedir? Apache Kafka Neden Kullanılır? Apache Kafka Nasıl Kurulur?

    34 COMMENTS

    1. Thanks for the tips
      the 'kubectl run nginx –image=nginx –restart=OnFailure –schedule="* * * * *"' command won't work anymore it is deprecated
      some extra tips:

      in vi you can replace all tabs to spaces simply by:
      <esc>:%s/t/ /g
      (two spaces between / /)
      if you want to expand tabs and stuff easily and correctly, just edit .vimrc and place this command there:
      set ts=2 sts=2 sw=2 et
      which means: tabstop=2 softtabstop=2 shiftwidth=2 expandtab
      or perform this command in the vim editor itself on the : but then it is only valid for that session…

    2. You can quickly set up a short .vimrc which will help navigate yaml files:

      syntax on
      filetype plugin indent on
      set cursorcolumn
      set cursorline

      autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab

      If you are spending time memorizing unix one-liners, it might be worth it to familiarize yourself with vim over nano.

    3. 5th command should be like this:
      kubectl run nginx -image=nginx –restart=Never –port=80 –namespace=myname –command –serviceaccount=mysa1 –env=HOSTNAME=local –labels=bu=finance,env=dev –requests='cpu=100m,memory=256Mi' –limits='cpu=200m,memory=512Mi' –dry-run -o yaml – /bin/sh -c 'echo hello world'

    4. Hi Murali, Can you please clarify the following:
      1) If I can use the Yaml Definition files of various objects say (volumes, pvc etc) from the official documentation during the CKAD exam. Its very difficult to memorize all the fields, especially sub-fields.
      2) Please suggest if all the questions weigh same points or few questions carry more marks than others.

    5. @ ~11:00 when you discuss using contexts, I assume that you have previously created the context, mycontext? Otherwise, by only running `kubectl config set-context mycontext –namespace=mynamespace`, without defining a "user" or "cluster", you would not be able to view any existing resources in that namespace even if you have set the "mynamespace" context as your current context (i.e. `kubectl config use-context mynamespace`). Can you please confirm as I think this may cause confusion for viewers?

    6. For the Unix tips presented at ~20:45, it would be really helpful to show exactly how these can be used in the context of a typical exam question. It's not clear exactly how these commands could be used or why they're useful. This would make for a great follow-up video or blog post.