<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shambhu Kumar Sinha on Medium]]></title>
        <description><![CDATA[Stories by Shambhu Kumar Sinha on Medium]]></description>
        <link>https://medium.com/@shamre?source=rss-9905a5e9663c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OlSjzq_-npMHcpySeBrx3g.jpeg</url>
            <title>Stories by Shambhu Kumar Sinha on Medium</title>
            <link>https://medium.com/@shamre?source=rss-9905a5e9663c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:25:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shamre/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Go language features explained for Java Developer]]></title>
            <link>https://medium.com/@shamre/go-language-features-explained-for-java-developer-ed2f6af32eca?source=rss-9905a5e9663c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed2f6af32eca</guid>
            <dc:creator><![CDATA[Shambhu Kumar Sinha]]></dc:creator>
            <pubDate>Thu, 02 May 2024 05:41:11 GMT</pubDate>
            <atom:updated>2024-05-02T12:30:54.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*GvMbaiYzNmZCyC0cbQY-XA.png" /></figure><h3>Some facts about Go Language</h3><ol><li>Go started at Google, and Java at Sun Microsystem</li><li>17 vs 29 years of maturity in 2024</li><li>Go is based on C program syntax achieves max effects with min means but Java JRE is written in C.</li><li>Go started as system programming language but widely accepted now as general-purpose language, Java renamed from Oak.</li><li>Both are Typed language</li><li>Go proven to have better performance than Java</li><li>Go is a small, simple, easy to learn, easy to use and really fabulous language</li><li>Go provides standard libraries comes with “Batteries included” :) and decentered libraries but Java usages centralized approach like Maven</li><li>Go is kind of reduced set or stripped features of Java</li><li>No VM in Go but Java is based JVM</li><li>Go usage struct for complex data type and great support for JSON data handling and it is easy to implement with struct</li><li>Go implements some of the object-oriented features in very unusual approach</li><li>Go supports Pointers and Address unlike Java</li><li>No inheritance in Go, complex object behaviors are created by composition</li><li>No Method Overloading in Go</li><li>Two functions/methods cannot have same name in a package in Go</li><li>The panic and recover feature in Go are similar to the Exception handling in Java</li><li>Go concurrency model is based on Go routine something different than thread</li><li>Go also support automatic memory management</li><li>Go playground on web for playing with code and sharing</li></ol><h3>Side by side comparison</h3><h3>1. Java and Go both are strongly Typed</h3><ul><li>Java: Strongly typed, with explicit type declarations enforced at compile time.</li><li>Go: Also strongly typed, but offers type inference, allowing for more concise variable declarations and makes little easy by short variable ( := ) declaration</li></ul><h3>2. Package Management:</h3><ul><li>Java: Relies on tools like Maven etc. for dependency management, with centralized repo for libraries and packages.</li><li>Go: Utilizes a decentralized approach to package management with the go get command and the go.mod file, allowing us to specify and manage dependencies within their projects.</li></ul><p>Code Organization in Go</p><ol><li>Workspace</li><li>Module — Something like Maven for Java</li><li>Package</li></ol><ul><li>Go package has no dependency on folder(s) name of go source, but one folder must have only one package.</li><li>Go package always short name, without dot (.) unlike java and has no relation with folder name.</li><li>Go package while importing the package, need module name and folder(s) where package exist.</li><li>Go program Execution always starts with main package and function main.</li></ul><p>Code structure and naming convention in Go</p><ul><li>Suggested not to use long name but short name: <a href="https://go.dev/doc/code">How to Write Go Code — The Go Programming Language</a></li><li><a href="https://go.dev/blog/organizing-go-code">Organizing Go code — The Go Programming Language</a></li></ul><h3>3. Access Control</h3><ul><li>Java — Access control by declaring variables, methods and class as public, private, protected and default.</li><li>Go — Access control by Private and Public is by the first letter of the name for variable or function both. If the letter is lowercase, it is private. If it is uppercase, it is public. The scope of a private function/method/type is the package in which it is defined.</li></ul><h3>4. Unused variable and Blank identifier variable</h3><ul><li>Java — No complain and alright to define unused variable or not receiving return values of method.</li><li>Go — Unused variable, unused import gives compile time error but that can be replaced with underscore ( _ ) known as blank identifier.</li></ul><h3>5. Initializing variable or perform initialization during code load time</h3><ul><li>Java- When class is loaded in memory, static variables or code block is initialized.</li><li>Go- Supports init() method that is called when program is imported. These init() functions can be used within a package block and regardless of how many times that package is imported, the init() function will only be called once. if just want to call init() method then import package with Blank Identifier</li></ul><h3>6. Global variable</h3><ul><li>Java: Java got access modifier like public, private, protected and default attached to and even volatile to update the value from different threads update</li><li>Go: Global variables in Go are editable. Any code in any of the functions can edit the global variable.</li></ul><h3>7. Pointer and Address</h3><ul><li>Java references: Automatically managed memory; pointing to an object abstracts away the memory address.</li><li>Go pointers: Explicitly point to memory addresses; changes made through a pointer affect the original variable.</li><li><a href="https://go.dev/play/p/f0y_o9GiXVa">Play with Pointers:</a> <a href="https://go.dev/play/p/sLvPX4ngymO">https://go.dev/play/p/sLvPX4ngymO</a></li></ul><h3>8. Object-Oriented Programming (OOP)</h3><ul><li>Java: Purely object-oriented, where everything is an object and classes are fundamental.</li><li>Go: Supports some OOP principles like structs and methods, but also encourages composition over inheritance., Go implements it for structs only in unique way</li></ul><p>Go supports,</p><ol><li>Function</li><li>Method: <a href="https://go.dev/play/p/wU3XAWg_Fhu">Example: https://go.dev/play/p/wU3XAWg_Fhu, Method is associated with. </a>A function that accepts a special receiver argument is a method and receiver is instance of struct. The receiver is declared between the method name and the func keyword in its own parameter list.</li><li>Interface: <a href="https://go.dev/tour/methods/10">https://go.dev/tour/methods/10</a>. This helps implementing something polymorphism by using method.</li></ol><h3>9. Method overloading and overriding</h3><ol><li>Java: Purely object-oriented so overloading and overriding are key features of language</li><li>Go: No method Overloading and two functions/methods cannot have same name in a package in Go, except init()</li></ol><h3>10. Error/Exception Handling</h3><ul><li>Java: Utilizes checked exceptions, requiring methods to declare the exceptions they might throw.</li><li>Go: Emphasizes error handling via return values rather than exceptions, with no support for checked exceptions.</li></ul><ol><li>In Go, errors are returned “normally” from a function and you as the caller are responsible for handling them.</li><li><a href="https://go.dev/play/p/qitccG6T7ge">Example: https://go.dev/play/p/qitccG6T7ge</a></li></ol><h3>11. Logging</h3><ul><li>Java: there are many loggings’ libraries support including jdk logger and log4j</li><li>Go: provide basic logging, and recent version supports slog (structured logging). Rolling file and some of features need to use third party library support.</li></ul><h3>12. Unit Test</h3><ul><li>Java: JUnit is an open-source Unit testing framework for java</li><li>Go: Unit testing is an inbuilt tool/command for conducting automated tests</li><li><a href="https://go.dev/play/p/e08fPhaWgDF">Playground https://go.dev/play/p/e08fPhaWgDF</a></li></ul><h3>13. Generic</h3><ul><li>Java: Has generics, allowing classes and methods to work with objects of various types in a type-safe manner.</li><li>Go: Lacks generics, but developers can achieve similar functionality using interfaces and type assertions.</li><li><a href="https://go.dev/play/p/e08fPhaWgDF">Generic: https://go.dev/play/p/e08fPhaWgDF</a></li></ul><h3>14. Reflection</h3><ul><li>Java: Supports reflection, allowing programs to inspect and modify their own structure at runtime.</li><li>Go: Has limited support for reflection compared to Java, primarily used for inspecting types and accessing struct fields</li><li><a href="https://go.dev/play/p/gs_YddjW6v9">Example: https://go.dev/play/p/gs_YddjW6v9</a></li></ul><h3>15. Annotation</h3><ul><li>Java: Supports annotations for adding metadata to classes, methods, and other program elements, used for various purposes like configuration and code generation etc.</li><li>Go: Annotation is a go package that allows parsing and read Java Style annotation strings e.x @SomeAnnotation(param=”value”), this package is used by go-service to read and parse annotations in comments.</li></ul><h3>16. Concurrency Model</h3><ul><li>Java: Uses threads for concurrency, with libraries like java.util.concurrent for synchronization and coordination.</li><li>Go: Offers built-in support for concurrency with go-routines and channels, making it easier to write concurrent programs compared to Java’s thread-based model.</li></ul><p>Go routine is something like Virtual Threads (part of JDK 21)</p><h3>17. Stacktrace and dump</h3><ul><li>Java: thread dump and stack dump.</li><li>Go: supports Runtime API for Stacktrace dump</li></ul><ol><li>Similar to Java, SIGQUIT (kill -3 &lt;GO_PROCESS_PID_ID&gt; or if process running prompt is available then press ^\ keys ( CTRL+\ )) can be used to print a stack trace of a Go program and its goroutines. A key difference, however, is that by default sending SIGQUIT to Java programs do not terminate them, while Go programs do exit. This approach requires no code change to print a stack trace of all goroutines of existing programs. e.g.</li></ol><pre>$ kill -3 24456</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlx1HfYpUaO0m_9dXgMLQQ.png" /></figure><p><a href="https://pkg.go.dev/runtime">https://pkg.go.dev/runtime</a></p><h3>18. Memory management and GC</h3><ul><li>Java: Garbage collection is handled by the JVM’s garbage collector, which is optimized for Java’s memory management.</li><li>Go: Has its own garbage collector optimized for concurrent execution, with control over memory allocation and deallocation. Go implements concurrent, Tri-Color block (White-Balck-Gray), Mark and Sweep policy and uniquely implemented stack and heap memory management.</li><li>Garbage collection in Go</li><li>Manages memory allocation and deallocation automatically.</li><li>Picks up anything out of scope or nil</li><li>GC is triggered based on trigger ratio</li><li>GC runs concurrently using mark and sweep, Tri-Color block (White-Balck-Gray)</li><li>The GOGC is environment variable sets the initial garbage collection target percentage. A garbage collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage. The default is GOGC=1OO.</li><li>Setting GOGC= off disables the garbage collector entirely.</li></ul><p><a href="https://pkg.go.dev/runtime">runtime package — runtime — Go Packages</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*CYC3GAc5xEgtWw8Ts2aQ-Q.png" /><figcaption>Google search</figcaption></figure><h3>19. Profiling</h3><ul><li>Java: heap dump and profiling code using profiling API</li><li>Go: comes with inbuild Profiler and very efficient but not seen heap dump. <a href="https://go.dev/doc/diagnostics">https://go.dev/doc/diagnostics</a></li></ul><h3>20. Execution Model</h3><ul><li>Java: Code is typically executed on the Java Virtual Machine (JVM), providing platform independence but using GraalVM, Java code can be converted into native binary</li><li>Go: Code is compiled directly to machine code, resulting in faster execution and simpler deployment, but sacrificing some platform independence so it’s Fast native code</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed2f6af32eca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks for passing the CKAD exam # Note 4]]></title>
            <link>https://medium.com/@shamre/notes-and-some-important-concepts-required-for-passing-the-ckad-exam-note-4-f7b03553c9f4?source=rss-9905a5e9663c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7b03553c9f4</guid>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[ckad]]></category>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[objects]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Shambhu Kumar Sinha]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 04:39:17 GMT</pubDate>
            <atom:updated>2024-01-15T14:21:35.785Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tips and tricks for passing the CKAD exam — Notes #4 of 4</h3><blockquote>“Practice as if you are the worst, perform as if you are the best.”</blockquote><blockquote>— Mahatma Gandhi</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDWEongNPCCiiJU_1yqlvQ.png" /></figure><p>This is Part 4 of the series. If you landed here first, it is recommended that you begin reading from <a href="https://medium.com/@shambhukumarsinha/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">Part 1</a>. This article discusses essential strategies and techniques for enhancing efficiency in the CKAD test by focusing on Kubernetes Objects and associated topics.</p><h3>Concept building on Object management</h3><p>Tips and tricks</p><ol><li>Practicing creating or customizing different objects using YAML templates and imperative commands and using their configurations. It is often necessary to combine both strategies.</li><li>How to edit and replace pods, deployments, and other objects quickly.</li><li>Understanding and defining resource requirements, limits, and quotas for CPU and memory in the pod as well as the namespace.</li><li>Understand multi-container pod design patterns and the practice needed.</li><li>Scaling deployment or increasing the resource limit of the pod until the pod shows a running status.</li><li>How to work with labels, selectors, and annotations</li><li>Testing and debugging are essential parts of the exam, so they must be done for every problem solution.</li></ol><h3>Object creation and get details</h3><ol><li>Pod, deployment, service, and job are three objects that require a good amount of practice using imperative commands. I will cover tips for jobs and service later in this article. Some tips on pods and deployments,</li><li>Command-line help is a good and fast way to get details. It detailed out all options as well as some examples, and that is really helpful for working fast for a solution. Always practice and memorize some examples; while practicing, keep using those. Also, build a strategy for searching for the right details, e.g., using grep with a keyword. Sometime you may get ready examples for problems but need to remember those, e.g., getting details for a custom column can be done with help and modifying attributes as per the details needed.</li></ol><pre> # List resource information in custom columns<br>  kubectl get pod test-pod -o<br>custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image</pre><p>3. Try to practice all options that get displayed in help with imperative commands, at least for pods, deployments, and jobs.</p><p>4. Sometime, you need only an example and not really options, then use the grep option with -B100 or may use grep with other keywords to get details on screen and be better readable. So build a strategy and practice accordingly. Below is an example of setting up a service account.</p><pre>controlplane $ k set sa -h |grep Option -B100<br>Update the service account of pod template resources.<br><br> Possible resources (case insensitive) can be:<br><br> replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset<br><br>Aliases:<br>serviceaccount, sa<br><br>Examples:<br>  # Set deployment nginx-deployment&#39;s service account to serviceaccount1<br>  kubectl set serviceaccount deployment nginx-deployment serviceaccount1<br>  <br>  # Print the result (in YAML format) of updated nginx deployment with the service account from local file, without hitting the API server<br>  kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run=client -o yaml<br><br>Options:</pre><p>5. I would like to suggest some important options for getting resource details:</p><pre>- field-selector=&#39;&#39;<br>-L, - label-columns=[]<br> - no-headers=true<br>-o, - output=&#39;&#39;<br>-l, - selector=&#39;&#39;<br> - show-labels=true<br> - sort-by=&#39;&#39;</pre><p>6. I would like to suggest some important options for practicing pod creation.</p><pre>- annotations=[]<br> - command=false<br> - env=[]<br> - expose=false<br>-l, - labels=&#39;&#39;<br>-o, - output=&#39;&#39;<br> - privileged=false<br> - restart=&#39;Always&#39;<br> - rm=false</pre><p>7. Deployments do not have many attributes to practice, but a couple of things can be practiced.</p><pre>-r, --replicas=1<br>-o, --output=&#39;&#39;</pre><p><em>8. Do not get confused by the port option (Option — port=-) for Pods and Deployments. This option defines the containerPort and does not have any functionality, but it seems to be used for better readability. It is recommended to seek clarification on this concept.</em></p><p>9. Running pods cannot be edited other than the below configurations.</p><pre>spec.containers[*].image<br>spec.initContainers[*].image<br>spec.activeDeadlineSeconds<br>spec.tolerations</pre><p>10. Set Command is very useful, and I strongly recommend using it to set up your solution. Pod does not allow to change all attributes using set except image, activeDeadlineSeconds, and tolerations, but the set command gives YAML output with dry-run, and this YAML can be used for recreating Pod.</p><p>11. Deployment does not have this restriction since the pod template is a child of the deployment specification. Deployments can be easily edited for <strong>any field or property of the POD </strong>template. With every change, the deployment will automatically delete and create a new pod. The set command is very handy and really will speed up the solution.</p><p>12. Practice all Set commands documented in <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#set">Kubectl Reference Docs (kubernetes.io)</a></p><p>10. Kubectl command chaining is possible; that will really speed up the solution. See details in Documentation <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-selector-em-">Kubectl Reference Docs (kubernetes.io)</a>. You can build and practice command chaining with different commands.</p><pre>kubectl create service clusterip my-svc --clusterip=&quot;None&quot; -o yaml --dry-run=client | kubectl set selector --local -f - &#39;environment=qa&#39; -o yaml | kubectl create -f -<br>kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -</pre><p>13. Use label command to change label</p><pre>Examples:<br>  # Update pod &#39;foo&#39; with the label &#39;unhealthy&#39; and the value &#39;true&#39;<br>  kubectl label pods foo unhealthy=true<br>  <br>  # Update pod &#39;foo&#39; with the label &#39;status&#39; and the value &#39;unhealthy&#39;, overwriting any existing<br>value<br>  kubectl label --overwrite pods foo status=unhealthy<br>  <br>  # Update all pods in the namespace<br>  kubectl label pods --all status=unhealthy</pre><h3>Edit a POD and Deployment</h3><h4>Pod</h4><p>For example, you cannot edit the environment variables, service accounts, or resource limits of a running pod. But if you really want to, you have to delete the pod and run a new one with changed configurations.</p><h4>Deployment Management Practice</h4><p>Practice all the below strategies.</p><p><strong>Deployment strategy</strong></p><ol><li>Rolling Update — Default strategy, provided by Kubernetes.</li><li>Recreate — can be changed in Manifest, provided by Kubernetes.</li><li>Canary — Concept and require practice</li><li>Blue and Green — Concept and require practice</li></ol><p>Deployment rollout — Require practice</p><ol><li>status</li><li>history</li><li>undo — to revision</li><li>pause</li><li>resume</li><li><strong>Using the — record flag to update change-cause </strong>field but this is moved to annotation in recent version</li></ol><h3>Jobs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/0*4zIb0DQT4JVOiTBR.jpeg" /><figcaption>source: <a href="https://medium.com/teamsnap-engineering/properly-running-kubernetes-jobs-with-sidecars-ddc04685d0dc">https://medium.com/teamsnap-engineering/properly-running-kubernetes-jobs-with-sidecars-ddc04685d0dc</a></figcaption></figure><p><strong>ReplicaSet: </strong>Make sure number of pods are up and running</p><p><strong>Jobs:</strong> Make sure number of pods are ruining for executing a task</p><p>Important attribute to practice are</p><ul><li>backoffLimit: 6</li><li>completionMode: NonIndexed</li><li>completions: 1</li><li>parallelism: 1</li><li>activeDeadlineSeconds: 10</li></ul><pre>apiVersion: batch/v1<br>kind: Job<br>metadata:<br>  name: pi<br>spec:<br>  template:<br>    spec:<br>      containers:<br>      - name: pi<br>        image: perl:5.34.0<br>        command: [&quot;perl&quot;,  &quot;-Mbignum=bpi&quot;, &quot;-wle&quot;, &quot;print bpi(2000)&quot;]<br>      restartPolicy: Never<br>  backoffLimit: 6<br>  completionMode: NonIndexed<br>  completions: 1<br>  parallelism: 1<br>  activeDeadlineSeconds: 10</pre><h3>CronJob</h3><p>Important attribute to practice are</p><ul><li>concurrencyPolicy: Allow</li><li>failedJobsHistoryLimit: 1</li><li>schedule: ‘*/1 * * * *’</li><li>successfulJobsHistoryLimit: 3</li><li>startingDeadlineSeconds: 15</li></ul><pre>apiVersion: batch/v1<br>kind: CronJob<br>metadata:<br>  name: pi<br>spec:<br>  concurrencyPolicy: Allow<br>  failedJobsHistoryLimit: 1<br>  schedule: &#39;*/1 * * * *&#39;<br>  successfulJobsHistoryLimit: 3<br>  startingDeadlineSeconds: 15<br>  jobTemplate:<br>    metadata:<br>      creationTimestamp: null<br>      name: pi<br>    spec:<br>      template:<br>        metadata:<br>          creationTimestamp: null<br>        spec:<br>          containers:<br>          - command:<br>            - perl<br>            - -Mbignum=bpi<br>            - -wle<br>            - print bpi(2000)<br>            image: perl:5.34.0<br>            imagePullPolicy: IfNotPresent<br>            name: pi<br>            resources: {}<br>            terminationMessagePath: /dev/termination-log<br>            terminationMessagePolicy: File<br>          dnsPolicy: ClusterFirst<br>          restartPolicy: OnFailure<br>          schedulerName: default-scheduler<br>          securityContext: {}<br>          terminationGracePeriodSeconds: 30</pre><p><strong>Pracrice and memeorize Cron scheduler setting</strong></p><p># ┌───────────── minute (0–59)<br> # │┌───────────── hour (0–23)<br> # ││┌───────────── day of the month (1–31)<br> # │││┌───────────── month (1–12)<br> # ││││┌───────────── day of the week (0–6) (Sunday to Saturday;<br> # │││││ 7 is also Sunday on some systems)<br> # │││││ OR sun, mon, tue, wed, thu, fri, sat<br> # │││││<br> # * * * * *</p><p>Check details configuration of cron property at <a href="https://www.geeksforgeeks.org/crontab-in-linux-with-examples/">https://www.geeksforgeeks.org/crontab-in-linux-with-examples/</a></p><h3>Pod resources</h3><p>Three important concept need to understand</p><ol><li>Pod resource and setting using imperative command (Using set <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-resources-em-">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands</a> ) as well as declarative</li><li>ResourceQuota for namespace level</li></ol><pre>kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort<br>or<br>apiVersion: v1<br>kind: ResourceQuota<br>metadata:<br>  name: compute-resources<br>spec:<br>  hard:<br>    requests.cpu: &quot;1&quot;<br>    requests.memory: 1Gi<br>    limits.cpu: &quot;2&quot;<br>    limits.memory: 2Gi<br>    requests.nvidia.com/gpu: 4</pre><p>3. LimitRange for setting limit — For the POD to pick up default values for request and limit by creating a LimitRange in that namespace. LimitRange in that namespace are assigned a default CPU request to newly created containers of pod.</p><pre>apiVersion: v1<br>kind: LimitRange<br>metadata:<br>  name: cpu-limit-range<br>spec:<br>  limits:<br>  - default:<br>   cpu: 1<br>   defaultRequest:<br>   cpu: 0.5<br>   type: Container<br><br>apiVersion: v1<br>kind: LimitRange<br>metadata:<br>  name: mem-limit-range<br>spec:<br>  limits:<br>  - default:<br>   memory: 512Mi<br>   defaultRequest:<br>   memory: 256Mi<br>   type: Container</pre><h3>PV</h3><p>Some conversion like Gi vs G — not very important but sometime need this understanding.</p><ul><li>1 G (Gigabyte) = 1,000,000,000 bytes (10⁹)</li><li>1 Gi (Gibibyte) = 1,073,741,824 bytes (2³⁰ or 1024⁴)</li><li>1 M (Megabyte) = 1,000,000 bytes (10⁶)</li><li>1 Mi (Mebibyte) = 1,048,576 bytes (2²⁰ or 1024²)</li><li>1 K(Kilobyte) = 1,000 bytes (10³)</li><li>1 Ki (Kibibyte) = 1,024 bytes (2¹⁰ or 1024¹)</li></ul><h3>Label, Selector and Annotation</h3><p><strong>Label -</strong> are used to filter, group, or operate on the resources.</p><p><strong>Annotation</strong> — are used to easily access additional information about the Kubernetes resources.</p><p><strong>Selector — </strong>Labels allow for objects to be selected are known as Selector, which may not share other characteristics. Selectors are namespace-scoped. Use the <strong>— all-namespaces</strong> argument to select matching objects in all namespaces.</p><p>Labels are used for watch-loops, track and manage objects by Operator.</p><p>TODO</p><p>Using this output, one way we could select the pod would be to use the <strong>app</strong> pod label. In the command line, the colon(:) would be replaced with an equals (=) sign and the space removed. The use of <strong>-l</strong> or <strong>— selector</strong> options can be used with <strong>kubectl</strong>.</p><pre>ckad1$ kubectl -n test2 get - selector app=examplepod pod<br>NAME READY STATUS RESTARTS AGE<br>examplepod-1234-vtlzd 1/1 Running 0 25m</pre><h3>Persistent Volumes (PV) and ​Persistent Volumes claim (PVC)</h3><p>Practice all examples for PV, PVC, StorageClass, binding with PV with Pod as well as all different types of configurations from Kubernetes. I would recommend practice for following</p><ol><li>Configure persistent volume claims.</li><li>Manage volume access modes.</li><li>Deploy an application with access to persistent storage.</li><li>Create a PVC use it in a POD definition file by specifying the PVC Claim name under persistentVolumeClaim section in the volumes</li><li>Clear concept on dynamic provisioning of storage.</li><li>Practice on Configuring secrets and ConfigMaps as volume</li><li>Utilize persistent and ephemeral volumes</li><li>There are two API Objects which exist to provide data to a Pod already. Encoded data can be passed using a Secret and non-encoded data can be passed with a <strong>ConfigMap</strong>.</li><li><strong>Be aware that any capacity mentioned does not represent an actual limit on the amount of space a container can consume</strong>.</li><li>Practice <strong>emptyDir</strong> and <strong>hostPath</strong> volumes as well as projected volume as and particularly serviceAccountToken, configMap and downwardAPI configurations</li><li>Some notes</li></ol><ul><li>Persistent volumes are cluster-scoped, but</li><li>persistent volume claims are namespace-scoped.</li><li>With a <strong>StorageClass</strong> created, a user can request a claim, which the API Server fills via auto-provisioning.</li><li>The three <strong>access modes</strong></li></ul><ol><li>RWO (ReadWriteOnce), which allows read-write by a single node,</li><li>ROX (ReadOnlyMany), which allows read-only by multiple nodes,</li><li>RWX (ReadWriteMany), which allows read-write by many nodes.</li></ol><p>Volume Configurations example</p><pre>Mounting Secrets as Volumes<br>…<br>spec:<br>  containers:<br>  - image: busybox<br>    name: busy<br>    command:<br>    - sleep<br>    - &quot;3600&quot;<br>    volumeMounts:<br>    - mountPath: /mysqlpassword<br>      name: mysql<br>  volumes:<br>  - name: mysql<br>    secret:<br>      secretName: mysql</pre><h3>ConfigMap and Secret</h3><p>Good amount of practice is required for ConfigMap and Secret</p><p>Tips :</p><ol><li>There is no limit to the number of Secrets used, but there is a 1MB limit to their size</li><li>Configure Pod environmental variables from single or multiple</li><li>Use ConfigMap values in Pod commands</li><li>Populate Volume from ConfigMap</li><li>Add ConfigMap data to specific path in Volume</li><li>Set file names and access mode in Volume from ConfigMap data</li><li>Can be used by system components and controllers.</li></ol><p>Practice requires configuring below and practicing using the Set command.</p><ol><li>ENV</li><li>valueFrom</li><li>envFrom</li></ol><p>In the case of environment variables, your Pod manifest will use the <strong>valueFrom</strong> key and the <strong>configMapKeyRef</strong> value to read the values. For instance:</p><pre>env:<br>- name: SPECIAL_LEVEL_KEY<br>  valueFrom:<br>    configMapKeyRef:<br>      name: special-config<br>      key: special.how</pre><p>With volumes, you define a volume with the <strong>configMap</strong> type in your pod and mount it where it needs to be used.</p><pre>volumes:<br>- name: config-volume<br>  configMap:<br>    name: special-config</pre><p>practice base64 command for encoding and decoding secret data</p><h3>Service Account (SA)</h3><p>CLEAR concept on SA, and generally you get problems configuring SA for existing pods or deployments.</p><p>Always practice setting SA using the set command.</p><p>The problem even comes from debugging and misconfiguring SA.</p><p><a href="https://medium.com/@th3b3ginn3r/understanding-service-accounts-in-kubernetes-e9d2abe19df8">https://medium.com/@th3b3ginn3r/understanding-service-accounts-in-kubernetes-e9d2abe19df8</a></p><h3>Other Configuration</h3><p>Practice below topics from Kubernetes Documentations examples</p><ol><li>Taints Toleration</li><li>Node selector affinity</li><li>Multi container &amp; Monitoring</li></ol><h3>Multi-Container Pod Terminology</h3><p><strong>Multi-Container Pod Terminology</strong></p><ul><li>Ambassador</li><li>Adapter</li><li>Sidecar</li><li>initContainer</li></ul><h4>Some Notes:</h4><ul><li>When a POD is first created the initContainer is run, and the process in the initContainer must run to a completion before the real container hosting the application starts.</li><li>You can configure multiple such initContainers as well, like how we did for multi-pod containers. In that case each init container is run <strong>one at a time in sequential order</strong>.</li><li>If any of the initContainers fail to complete, Kubernetes restarts the Pod repeatedly until the Init Container succeeds.</li></ul><h3>Liveness, Readiness and Log</h3><p>Practice memeorize all configurations as well as their values</p><ul><li>initialDelaySeconds</li><li>periodSeconds</li><li>timeoutSeconds</li><li>successThreshold</li><li>failureThreshold</li><li>terminationGracePeriodSeconds</li></ul><h3>Security Context</h3><p>Generally, questions are starlight forward, and referring to Kubernetes documentation is generally sufficient.</p><h3>Labels and Annotation</h3><p>A service, as well as <strong>kubectl</strong>, uses a <em>selector</em> in order to know which objects to connect. There are two selectors currently supported:</p><ul><li><strong>set-based<br> </strong>Filters according to a set of values. The operators are <strong>in</strong>, <strong>notin</strong>, and <strong>exists</strong>. For example, the use of <strong>status notin (dev, test, maint)</strong> would select resources with the key of <strong>status</strong> which did not have a value of <strong>dev</strong>, <strong>test</strong>, nor <strong>maint</strong>.</li></ul><p>Note: error from server (BadRequest): Unable to find “/v1, Resource=pods” that match label selector “env exists (prod, uat)”, field selector “”: unable to parse requirement: found ‘exists’, expected: in, notin, =, ==, !=, gt, lt</p><p><strong><em>Get the pods with labels env=dev and env=prod</em></strong><a href="https://medium.com/bb-tutorials-and-thoughts/practice-enough-with-these-questions-for-the-ckad-exam-2f42d1228552"><strong><em> from</em></strong></a></p><pre>kubectl get pods -l &#39;env in (dev,prod)&#39;</pre><p><strong>Remove the labels for the pods that we created now and verify all the labels are removed</strong></p><pre>kubectl label pod nginx-dev{1..3} env-<br>kubectl label pod nginx-prod{1..2} env-<br>Remove label from pod key=value- append - at the end</pre><p>Valid label value:</p><ul><li>must be 63 characters or less (can be empty),</li><li>unless empty, must begin and end with an alphanumeric character ([a-z0–9A-Z]),</li><li>could contain dashes (-), underscores (_), dots (.), and alphanumerics between.</li></ul><pre>controlplane ~ ➜ k get po -l &#39;test notin (false)&#39;,test!=false<br>NAME READY STATUS RESTARTS AGE<br>test-dep-6d48b567df-2pr8f 1/2 CrashLoopBackOff 5 (96s ago) 4m56s<br>test-dep-6d48b567df-8dth2 1/2 CrashLoopBackOff 5 (113s ago) 4m56s<br>test-dep-6d48b567df-ccz5k 1/2 CrashLoopBackOff 5 (103s ago) 4m56s</pre><h3>Observability &amp; log</h3><p>Practice on log as well as describe command</p><ul><li>kubectl logs my-pod — follow</li><li>kubectl get event</li></ul><h3>Debug</h3><ol><li>Must be very good or requires good amount of practice on connecting to pod or connecting running pod. Sometime, Debug command is also helpful but for exam hardly you requires this Debug command.</li><li>-it command must be practiced enough to type and test Pod quickly. Most of time debugging or validating pod need this command.</li><li>If Pod is up and running and no container exits and need to debug, then use debug pod to connect pod</li></ol><h4>Not on stdin and tty (-it) command</h4><p>The short options -i and -t are the same as the long options — stdin and — tty. These instruct kubectl to route your terminal’s stdin input stream to the container (-i) and treat it as a TTY (-t). This sets up an interactive session where you can supply input to the process inside the container. This helps connecting pod and run the container’s shell. Whereas SSH automatically starts a shell process and binds your terminal’s input and output streams, kubectl makes each of these aspects customizable. You don’t have to start a shell in the container; you could run an arbitrary process instead, supply it some interactive input, and receive its output:</p><pre>kubectl exec -i -t my-pod -c main-app -- /bin/bash<br>kubectl exec -it demo-pod -- node cutom-script.js</pre><p>Combine — command or -i — tty options with kubectl run for Pods that run interactive shells or commands. Example: kubectl run -it — rm debug-pod — image=busybox — command — sh</p><h4>Some of problem for practice</h4><ol><li>Misconfiguration can be wrong image name, some typo in command etc.</li><li>Port configuration issue</li><li>OOMKilled</li><li>CPU Throttling</li></ol><h3>Networking</h3><h4>Service</h4><p>Practice all different types of service creation for pods and deployments. A good amount of practice is required for creating a service by <strong>exposing commands </strong>and <strong>creating a SVC command</strong>.</p><p>Expose command is a fast way to create a service, but the only challenge is the auto-generated node port value, which requires editing of the YAML file. On the other side, creating a service requires manual work for defining selectors, which is more error-prone. So, both the commands (expose and create) have their own challenges. While one of them cannot accept a selector, the other cannot accept a node port. <strong>I strongly recommend going with the `kubectl expose` command.</strong></p><h4>Note on Pod IP and networking</h4><ol><li><strong>Single IP per Pod — </strong>All containers in a Pod share the same network namespace of a container, known as the <em>pause container</em>. The pause container is used to get an IP address, then all the containers in the pod will use its network namespace.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*vdQfLouBGUGDLHGH" /><figcaption>Source: <a href="https://trainingportal.linuxfoundation.org/learn/course/kubernetes-for-developers-lfd259/kubernetes-architecture/kubernetes-architecture?page=13">https://trainingportal.linuxfoundation.org/learn/course/kubernetes-for-developers-lfd259/kubernetes-architecture/kubernetes-architecture?page=13</a></figcaption></figure><p>Kubernetes expects the configuration to enab!e Pod-to-Pod, communications to be available; it will not do it for you. Pods are assigned an IP address prior to application containers being started. The $eivice Object is used to contact Pods within the network using ClusterIP addresses, from outside Of the Cluster using NodePort addresses, and using a load balancer if configured with LoadBalancer service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BKRWtSrYmZnI_fWG" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fspeakerdeck.com%2Fplayer%2F005d36f0113d4773be8866496142485e&amp;display_name=Speaker+Deck&amp;url=https%3A%2F%2Fspeakerdeck.com%2Fthockin%2Fillustrated-guide-to-kubernetes-networking&amp;image=https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2F005d36f0113d4773be8866496142485e%2Fslide_0.jpg%3F6873468&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=speakerdeck" width="710" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/5351a3cf815fe924c2e9a05ba498cc21/href">https://medium.com/media/5351a3cf815fe924c2e9a05ba498cc21/href</a></iframe><ol><li>In general a Pod has the following DNS resolution: Pod-ip-address.my-namespace.pod.cluster-domain.example. For example, if a Pod in the default namespace has the IP address 172.17.0.3, and the domain name for your cluster is cluster.local, then the Pod has a DNS name: 172–17–0–3.default.pod.cluster.local</li><li>Any Pods exposed by a Service have the following DNS resolution available: pod-ip-address.service-name.my-namespace.svc.cluster-domain.example, from &lt;<a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a>&gt;</li></ol><h4>Ingress Controller</h4><ol><li>Start building concept form from official site: <a href="https://github.com/kubernetes/ingress-nginx/blob/main/README.md#readme">https://github.com/kubernetes/ingress-nginx/blob/main/README.md#readme</a></li><li>Basically from quick jump start: <a href="https://kubernetes.github.io/ingress-nginx/deploy/#quick-start">https://kubernetes.github.io/ingress-nginx/deploy/#quick-start</a></li><li>Two things to always keep in mind for an exam: 1st understanding concept of ingress and fixing configuration issues of ingress resource and 2nd fixing issue of ingress controller. Problems in exams generally come from these two areas.</li><li>practice creates ingress resources in an imperative way like this.</li></ol><pre>kubectl create ingress &lt;ingress-name&gt; - rule=&quot;host/path=service:port&quot;<br><br>Example <br>kubectl create ingress ingress-test - rule=&quot;wear.my-online-store.com/wear*=wear-service:80&quot;</pre><h4>Network Policy</h4><ol><li>This is very easy to solve, and really, one question will arise from this.</li><li>This requires a good amount of visualization of different pods and namespace connections to allow or deny.</li><li>Memorize configuration and practice with all different combinations of pod, namespace, port, labels, etc.</li><li>If the concept is clear, then this problem is generally very straight-forward.</li><li>Read or define configuration properly, as many times you will face issues with AND (YAML Dictionary definition) and OR (YAML Array definition).</li></ol><p>Gathering the information necessary to succeed on the CKAD exam is the goal of this blog. Consider yourself prepared for the test; you should be aware of all the material and know where to put your emphasis. By reading this, you may get the correct information and save a lot of time compared to doing your own research. Please do your best on the exam and let me know what you think by leaving a comment on this blog.</p><h4>Summary of this series</h4><ol><li>Part 1 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">About CKAD Test, CKAD Domains &amp; Competencies (Syllabus) # What to practice</a></li><li>Part 2 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-2-dd67db2146f1">Working with Linux commands, usage of JSON, YAML etc. for CKAD exam</a></li><li>Part 3 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-3-6115b500abbf">How to improve efficiency and some details on non Kubernetes object practice</a></li><li>Part 4 — <a href="https://medium.com/@shamre/notes-and-some-important-concepts-required-for-passing-the-ckad-exam-note-4-f7b03553c9f4">All about Kubernetes objects</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7b03553c9f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks for passing the CKAD exam — Notes # 3 of 4]]></title>
            <link>https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-3-6115b500abbf?source=rss-9905a5e9663c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6115b500abbf</guid>
            <dc:creator><![CDATA[Shambhu Kumar Sinha]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 17:54:02 GMT</pubDate>
            <atom:updated>2024-01-15T14:18:21.423Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tips and tricks for passing the CKAD exam — Notes #3 of 4</h3><blockquote>“<strong>You don’t understand anything until you learn</strong> it <strong>more than one way</strong>,”</blockquote><blockquote>— <em>Marvin Minsky</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDWEongNPCCiiJU_1yqlvQ.png" /></figure><p>This is Part 3 of this series, and if you landed up here first, you may would like to start reading from <a href="https://medium.com/@shambhukumarsinha/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">Part 1</a>. In this article, I am covering some tips these are related to the CKAD concept but needed for improving efficiency in the exam.</p><ol><li>Kubectl</li><li>Imperatives vs declarative</li><li>Help and Documentation</li><li>explain</li><li>Docker</li><li>Helm</li></ol><h3>Kubectl</h3><p><strong>kubectl is client tool of Kubernetes to create</strong> a variety of objects. There are several ways to apply all of the K8s objects into the k8s cluster.</p><ol><li><strong>Using Generators (Run, Expose)</strong></li><li><strong>Using Imperative way (Create)</strong></li><li><strong>Using Declarative way (Apply</strong>)</li></ol><p>All of the above ways have a different purpose and simplicity. For instance, If we want to check quickly whether the container is working as we desired then we might use <strong>Generators</strong>. Check details here: <a href="https://stackoverflow.com/questions/48015637/kubernetes-kubectl-run-vs-create-and-apply">refrence</a></p><p><a href="https://stackoverflow.com/questions/43941772/get-yaml-for-deployed-kubernetes-services">Get YAML for deployed Kubernetes services</a></p><h3>Imperative way vs declarative way</h3><p><strong>Imperative way: </strong>define on command line for quickly, generate a definition template easily.</p><p><strong>Declarative way:</strong> define in manifest file as steps or using definition files,</p><h3>Imperative Commands</h3><p>Imperative commands must be used to quickly do one-time activities and to create definition templates with ease.</p><p><strong>Some examples for creating Object using Imperative commands.</strong></p><p>Create an NGINX Pod and a Deployment</p><pre>kubectl run nginx --image=nginx<br>kubectl create deployment - image=nginx nginx</pre><p>Generate POD and Deployment Manifest YAML file (-o yaml). Don’t create it( — dry-run)</p><pre>kubectl run nginx --image=nginx --dry-run=client -o yaml<br>kubectl create deployment - image=nginx nginx - dry-run -o yaml</pre><p>Another way to do this is to save the YAML definition to a file and modify the definition file</p><pre>kubectl create deployment nginx - image=nginx - dry-run=client -o yaml &gt; nginx-deployment.yaml</pre><p>You can then update the YAML file with the replicas or any other field before creating the deployment.</p><p><strong>Tips: </strong>During your tests, this will help you saving a significant amount of time. Following two options that will be useful while working with the instructions below:</p><ol><li>Use the <strong>-dry-run=client</strong> argument if all you want to generate Object template on client side with bare minimum attributes requires, however, use the <strong>-dry-run=server </strong>option to view more attributes possibilities.</li><li>Along with -o yaml option resource definition will appear on the screen in YAML format and can be used for constructing object. <br>Instead of starting from scratch with each file, use the two above to rapidly construct a resource definition file that you can then edit and add resources to as needed.</li></ol><p>— dry-run=client will not create the resource, use -o yaml to output the resource definition in YAML format on screen.</p><p>Create yamls file template</p><pre>Kubectl get deployment -o yaml &gt;file.yaml</pre><h3>Kubectl create</h3><p>Imperative command is not available for, so has to create by declarative way using yaml</p><ol><li>Netpol</li><li>PV</li><li>PVC</li><li>StorageClass</li><li>LimitRange</li></ol><h4>Kubectl: Debug — Verbose Output</h4><p>Use the following syntax of the kubectl command to set the verbosity level from 0 to 9:</p><pre>$ kubectl &lt;command&gt; - v=&lt;verbosity_level&gt;<br>Examples:<br># Minimum verbosity<br>$ kubectl cluster-info - v=0<br># Debug level verbosity<br>$ kubectl cluster-info - v=4<br># Maximum verbosity<br>$ kubectl cluster-info - v=9<br><br>All the available verbosity levels of the kubectl command:<br>- v=0 : Generally useful for this to always be visible to a cluster operator.<br>- v=1 : A reasonable default log level if you don not want verbosity.<br>- v=2 : Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems.<br>- v=3 : Extended information about changes.<br>- v=4 : Debug level verbosity.<br>- v=5: Trace level verbosity.<br>- v=6: Display requested resources.<br>- v=7: Display HTTP request headers.<br>- v=8: Display HTTP request contents.<br>- v=9: Display HTTP request contents without truncation of contents.</pre><h3>Help and Documentation</h3><p>Focus on Kubernetes documentation for following: <a href="https://kubernetes.io/docs/reference/kubectl/conventions/">https://kubernetes.io/docs/reference/kubectl/conventions/</a></p><ol><li>Concepts</li><li>Tasks</li><li>Tutorials</li><li>Reference <br> — on command line tool (kubectl) <br> — four sections # for understanding imperative commands and docker commands</li><li>Practice all imperative commands referring documentation page: <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands</a></li></ol><h3>Command line documentation using explain</h3><p>Get all Object properties details using kubectl explain.</p><pre>kubectl explain pods|svc|deploy|rs</pre><p>Get all Object properties and any specific property details</p><pre>kubectl explain pods.spec<br>kubectl explain configMap.data</pre><p>Get all Object properties and any specific property details recursive</p><pre>kubectl explain configMap.data - recursive</pre><h3>Docker Container and POD</h3><p><a href="https://github.com/wsargent/docker-cheat-sheet#dockerfile">https://github.com/wsargent/docker-cheat-sheet#dockerfile</a></p><pre>docker run - name<br>docker run -it - rm busybox<br>docker pull shambhusinha/spring-boot-rest-hello:0.0.1-latest<br>docker run shambhusinha/spring-boot-rest-hello</pre><h4>Option is to view the docker image history:</h4><pre>docker image history my-image:latest</pre><h4>Docker ENTRYPOINT vs Pod command</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*8pZe70xr6E7a63vx.png" /><figcaption>Source: <a href="https://www.youtube.com/watch?v=OYbEWUbmk90&amp;list=PL2We04F3Y_43dAehLMT5GxJhtk3mJtkl5&amp;index=8">Docker for Beginners — Commands vs Entrypoint — Kubernetes (youtube.com)</a></figcaption></figure><h4>Docker example practice</h4><p>Create a Java class that keep executing for longer time</p><pre>public class Main {<br>  public static void main(String[] args) {<br>  // TODO Auto-generated method stub<br>    for (int i = 0; i &lt; 10000; i++) {<br>      System.out.println(&quot;I am now: &quot; +i);<br>      try {<br>        Thread.sleep(10000);<br>      } catch (InterruptedException e) {<br>      // TODO Auto-generated catch block<br>        e.printStackTrace();<br>      }<br>    }<br>  }<br>}</pre><p>Create Dockerfile</p><pre>FROM eclipse-temurin:17-jdk-jammy<br>WORKDIR /app<br>COPY Main.java ./<br>RUN javac Main.java<br>CMD [&quot;java&quot;, &quot;Main&quot;]</pre><h4>Build and tag the image</h4><pre># Building image and tagging with name javatest abd default version :latest<br>$ docker build . -t javatest<br># Building image and tagging with name javatest abd default version :v1.0.0<br>$ docker build . -t javatest:v1.0.0<br><br># show all images<br>$ docker image ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcH_UsY0T0waRbjl_IK1vw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJgRcZ01QnVt73wSDDIJyw.png" /></figure><pre># Run the image javatest:v1.0.0<br>$ docker run javatest:v1.0.0<br><br># show all running container<br>$ docekr ps <br>$ docekr ps -a<br><br>$ docker image inspect javatest:v1.0.0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMReg7Ri0p63zQB0W555Qg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJZ_bZIqoi31o8OhFSNk5g.png" /></figure><pre># Run local registry on port 5000<br>$ docker run -d -p 5000:5000 --name registry registry:2<br><br>curl localhost:5000<br>curl localhost:5000/v2/_catalog<br><br># loging to docker hub - user is shambhusinha<br>$ docker login<br><br># tag image with shambhusinha namespace name<br>$ docker image tag javatest:v1.0.0 shambhusinha/javatest:v1.0.0<br>$ docker push shambhusinha/javatest:v1.0.0<br><br>$ docker push shambhusinha/ckadi:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WZYoaBX6EuA0LCbIC1Tgw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2nmoroEQ-hPu1IrMiNgmA.png" /></figure><h3>Docker local registry</h3><p>docker run -d -p 5000:5000 — name registry registry:2</p><p><a href="https://distribution.github.io/distribution/">https://distribution.github.io/distribution/</a></p><p><a href="https://stackoverflow.com/questions/23733678/how-to-search-images-from-private-1-0-registry-in-docker">https://stackoverflow.com/questions/23733678/how-to-search-images-from-private-1-0-registry-in-docker</a></p><p><strong>Play with registry</strong></p><p>So I know this is a rapidly changing field but (as of 2015–09–08) I found the following in the<a href="http://docs.docker.com/registry/spec/api/"> Docker Registry HTTP API V2</a>:</p><h3>Listing Repositories (<a href="http://docs.docker.com/registry/spec/api/#listing-repositories">link</a>)</h3><p>GET /v2/_catalog</p><h3>Listing Image Tags (<a href="http://docs.docker.com/registry/spec/api/#listing-image-tags">link</a>)</h3><p>GET /v2/&lt;name&gt;/tags/list</p><pre>controlplane $ curl -X GET http://localhost:5000/v2/_catalog<br>  {&quot;repositories&quot;:[&quot;ubuntu&quot;]}<br>controlplane $ curl -X GET http://localhost:5000/v2/ubuntu/tags/list<br>  {&quot;name&quot;:&quot;ubuntu&quot;,&quot;tags&quot;:[&quot;latest&quot;]}<br>controlplane $ docker build . -t localhost:5000/javatest<br>controlplane $ docker push localhost:5000/javatest:latest<br>controlplane $ docker image ls<br>  REPOSITORY                TAG       IMAGE ID   CREATED         SIZE<br>  javatest                 latest   f23c59e62376 39 minutes ago 407MB<br>  localhost:5000/javatest  latest   f23c59e62376 39 minutes ago 407MB<br>controlplane $ docker build . -t localhost:5000/javatest:v1.0<br>controlplane $ curl -X GET http://localhost:5000/v2/_catalog<br>  {&quot;repositories&quot;:[&quot;javatest&quot;]}<br>controlplane $ curl -X GET http://localhost:5000/v2/javatest/tags/list<br>  {&quot;name&quot;:&quot;javatest&quot;,&quot;tags&quot;:[&quot;latest&quot;,&quot;v1.0&quot;]}<br>controlplane $ docker ps<br>  CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br>  aeded6944d99 registry:2 &quot;/entrypoint.sh /etc…&quot; 11 minutes ago Up 11 minutes 0.0.0.0:5000-&gt;5000/tcp, :::5000-&gt;5000/tcp registry</pre><h3>Dockerfile</h3><p><a href="https://docs.docker.com/engine/reference/builder/#dockerfile-reference">https://docs.docker.com/engine/reference/builder/#dockerfile-reference</a></p><h3>Docker Instructions <a href="https://stackify.com/docker-build-a-beginners-guide-to-building-docker-images/">https://stackify.com/docker-build-a-beginners-guide-to-building-docker-images/</a></h3><p><strong>Dockerfile Instruction</strong></p><p><strong>Explanation</strong></p><ol><li>FROM — We use “FROM” to specify the base image we want to start from.</li><li>RUN — RUN is used to run commands during the image build process.</li><li>ENV — Sets environment variables within the image, making them accessible both during the build process and while the container is running. If you only need to define build-time variables, you should utilize the ARG instruction.</li><li>COPY — The COPY command is used to copy a file or folder from the host system into the docker image.</li><li>EXPOSE — Used to specify the port you want the docker image to listen to at runtime.</li><li>ADD — An advanced form of COPY instruction. You can copy files from the host system into the docker image. You can also use it to copy files from a URL into a destination in the docker image. In fact, you can use it to copy a tarball from the host system and automatically have it extracted into a destination in the docker image.</li><li>WORKDIR — It’s used to set the current working directory.</li><li>VOLUME — It is used to create or mount the volume to the Docker container</li><li>USER — Sets the user name and UID when running the container. You can use this instruction to set a non-root user of the container.</li><li>LABEL — Specify metadata information of Docker image</li><li>ARG — Defines build-time variables using key-value pairs. However, these ARG variables will not be accessible when the container is running. To maintain a variable within a running container, use ENV instruction instead.</li><li>CMD — Executes a command within a running container. Only one CMD instruction is allowed, and if multiple are present, only the last one takes effect.</li><li>ENTRYPOINT — Specifies the commands that will execute when the Docker container starts. If you don’t specify any ENTRYPOINT, it defaults to “/bin/sh -c”.</li></ol><h3>Dockerfile sample</h3><pre>FROM centos:7<br>MAINTAINER Devopscube<br>RUN yum -y update &amp;&amp; \<br>yum -y install httpd-tools &amp;&amp; \<br>yum clean all<br>ENTRYPOINT [&quot;ab&quot; , &quot;http://google.com/&quot; ]<br>FROM ubuntu<br>RUN sh -c &quot;echo hello&quot;<br>COPY test.html /opt<br>ENTRYPOINT [&quot;sh&quot; , &quot;-c&quot; , &quot;echo&quot; , &quot;Hello&quot;]</pre><h3>Docker command</h3><pre>sudo docker build -t docker-practice .<br># Run image with psuedo-tty being attached to the screen<br>sudo docker run \<br> - interactive - tty \<br> - publish 12345:27017 \<br> - volume /srv/docker-practice/db:/data/db \<br> - rm - name docker-practice docker-practice<br># Run image as a daemon<br>sudo docker run \<br> - detach \<br> - publish 12345:27017 \<br> - volume /srv/docker-practice/db:/data/db \<br> - rm - name docker-practice docker-practice<br># Attach to the running docker image<br>sudo docker exec -it docker-practice /bin/sh<br># Stop running docker container<br>sudo docker stop docker-practice<br>kubectl exec -it demo-pod - /bin/sh<br>This specifies that you want to run the /bin/sh command in the first container within your demo-pod pod. The - separates the command to run from the kubectl arguments. Anything after the - will be passed to the container, as opposed to kubectl.<br>The -it is equivalent to using the - stdin (-i) and - tty (-t) flags. These instruct kubectl to route your terminal&#39;s stdin input stream to the container (-i) and treat it as a TTY (-t). This sets up an interactive session where you can supply input to the process inside the container. Without these flags, you&#39;d see a read-only output stream.<br>Whereas SSH automatically starts a shell process and binds your terminal&#39;s input and output streams, kubectl makes each of these aspects customizable. You don&#39;t have to start a shell in the container; you could run an arbitrary process instead, supply it some interactive input, and receive its output:<br>kubectl exec -it demo-pod - node my-script.js</pre><p>From &lt;<a href="https://www.containiq.com/post/using-kubectl-exec-shell-commands-examples">https://www.containiq.com/post/using-kubectl-exec-shell-commands-examples</a>&gt;</p><h3>Helm</h3><p>Helm requirs understanding and concept for</p><ol><li>chart</li><li>hub</li><li>repo</li><li>release</li><li>Local repo</li></ol><p><strong>High level diagram on chart</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lD42VCagrnNaEwKRG7rasQ.png" /></figure><p><strong>Helm basic commands</strong></p><pre>helm search hub<br>helm search hub - list-repo-url -o yaml<br>helm repo add k8sonlab https://charts.billias.cc<br>helm repo ls<br>helm search repo k8sonlab<br>helm install k8sonlab-1 k8sonlab/librephotos<br>helm ls<br>helm ls -a<br>helm ls -a -A<br>kubectl get all -A<br>helm search repo k8sonla</pre><p><strong>Helm commands for adding a chart name truecharts from hub and install</strong></p><pre>controlplane $ helm search repo truecharts<br>No results found<br><br>controlplane $ helm repo add truecharts https://charts.truecharts.org/<br>controlplane $ helm repo add truecharts https://charts.truecharts.org/<br>&quot;truecharts&quot; has been added to your repositories<br><br>controlplane $ helm repo ls<br>NAME URL<br>nginx-stable https://helm.nginx.com/stable<br>bitnami https://charts.bitnami.com/bitnami<br>k8sonlab https://charts.billias.cc<br>truecharts https://charts.truecharts.org/<br><br>controlplane $ helm search repo truecharts # repo added with many charts, so list all<br>NAME CHART VERSION APP VERSION DESCRIPTION<br>truecharts/acestream 3.0.0 2.0.2.8 IPTV service providing streaming, playlist, sea…<br>truecharts/actualserver 3.0.13 23.2.9 Actual is a super fast privacy-focused app for …<br>truecharts/adguard-home 4.0.16 0.107.25 Free and open source, powerful network-wide ads…<br><br>controlplane $ helm install my-truecharts-1 truecharts/acestream<br>NAME: my-truecharts-1<br>...<br><br>helm ls -a -A<br>NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION<br>apiserver team-yellow 1 2023–03–24 01:41:25.547304669 +0000 UTC deployed apache-9.2.19 2.4.56<br>my-truecharts-1 default 1 2023–03–24 01:51:49.568541287 +0000 UTC deployed acestream-3.0.0 2.0.2.8<br>webserver team-blue 1 2023–03–24 01:41:21.232856285 +0000 UTC deployed apache-9.2.19 2.4.56<br><br>controlplane $ helm uninstall my-truecharts-1<br>release &quot;my-truecharts-1&quot; uninstalled<br><br>controlplane $ helm install my-truecharts-1 truecharts/acestream -n shambhu<br>controlplane $ helm install my-truecharts-1 truecharts/notea -n shambhu<br>Error: INSTALLATION FAILED: create: failed to create: namespaces &quot;shambhu&quot; not found<br><br>controlplane $ k create ns shambhu<br>namespace/shambhu created<br><br>controlplane $ helm install my-truecharts-1 truecharts/notea -n shambhu<br>Release my-truecharts-1 has been cancelled.<br>Error: INSTALLATION FAILED: context canceled<br><br>controlplane $ helm ls -a -A<br>NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION<br>apiserver team-yellow 1 2023–03–24 01:41:25.547304669 +0000 UTC deployed apache-9.2.19 2.4.56<br>my-truecharts-1 shambhu 1 2023–03–24 02:01:20.745806305 +0000 UTC failed notea-2.0.9 latest<br>webserver team-blue 1 2023–03–24 01:41:21.232856285 +0000 UTC deployed apache-9.2.19 2.4.56<br><br>controlplane $ helm create my-test-chart<br>Creating my-test-chart<br><br>controlplane $ helm install ./my-test-chart/<br>Error: INSTALLATION FAILED: must either provide a name or specify - generate-name<br><br>controlplane $ helm install sellf-created-chart ./my-test-chart/<br>NAME: sellf-created-chart<br>...<br><br>controlplane $ helm ls -a -A<br>sellf-created-chart default 1 2023–03–24 02:12:27.653425951 +0000 UTC deployed my-test-chart-0.1.01.16.0<br>...<br><br>controlplane $ helm install sellf-created-chart ./my-test-chart/ -n self - create-namespace<br>NAME: sellf-created-chart<br>...<br><br>controlplane $ helm ls -a -A<br>NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION<br>sellf-created-chart self 1 2023–03–24 02:16:05.794302757 +0000 UTC deployed my-test-chart-0.1.0 1.16.0</pre><h3>Kubernetes CRD</h3><ol><li>Generally understand how CRD works and Practice creating CRD</li><li>Practice if created CRD is appearing in list of Kubernetes Objects using api-version as well as creating Object of CRDs</li><li>Memorizing their attributes and structure, as well as important configurations.</li><li>Practice on debugging misconfiguration of YAML file for issues.</li></ol><h3>Controller and Admission Controller</h3><p>I have not seen any question from this but building concept would be always helpful.</p><h3>API version</h3><p>Generally one easy question is asked from this chapater, so must have</p><ol><li>Good concpet on API versioning in kubernetes</li><li>Mostly question is for migration of old version manifest file to latest version and that requires Convert tool</li><li>practice installing Covert tool as well as manifest file migration and deployment with latest Kubernetes version. Documentation: <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-convert-plugin">https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-kubectl-convert-plugin</a></li><li>Example: <a href="https://pet2cattle.com/2022/06/kubectl-convert">kubectl convert plugin (pet2cattle.com)</a></li></ol><pre>apiVersion: extensions/v1beta1<br>kind: Ingress<br>metadata:<br>  name: beta-ingress<br>  annotations:<br>    kubernetes.io/ingress.class: alb<br>    alb.ingress.kubernetes.io/scheme: internal<br>    alb.ingress.kubernetes.io/target-type: ip<br>spec:<br>  rules:<br>    - http:<br>        paths:<br>          - backend:<br>              serviceName: example<br>              servicePort: 8080<br>            path: /*</pre><p>Command</p><pre>controlplane $ kubectl convert -f ingress.yaml --output-version networking.k8s.io/v1 &gt;v1.ingress.yaml<br>controlplane $ k apply -f v1.ingress.yaml</pre><p>Gathering the information necessary to succeed on the CKAD exam is the goal of this blog. Consider yourself prepared for the test; you should be aware of all the material and know where to put your emphasis. By reading this, you may get the correct information and save a lot of time compared to doing your own research. Please do your best on the exam and let me know what you think by leaving a comment on this blog.</p><h4>Summary of this series</h4><ol><li>Part 1 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">About CKAD Test, CKAD Domains &amp; Competencies (Syllabus) # What to practice</a></li><li>Part 2 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-2-dd67db2146f1">Working with Linux commands, usage of JSON, YAML etc. for CKAD exam</a></li><li>Part 3 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-3-6115b500abbf">How to improve efficiency and some details on non Kubernetes object practice</a></li><li>Part 4 — <a href="https://medium.com/@shamre/notes-and-some-important-concepts-required-for-passing-the-ckad-exam-note-4-f7b03553c9f4">All about Kubernetes objects</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6115b500abbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks for passing the CKAD exam — Notes #2 of 4]]></title>
            <link>https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-2-dd67db2146f1?source=rss-9905a5e9663c------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd67db2146f1</guid>
            <dc:creator><![CDATA[Shambhu Kumar Sinha]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 09:51:27 GMT</pubDate>
            <atom:updated>2024-01-15T14:19:18.102Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Regret for time wasted can become a power for good in the time that remains, if we will only stop the waste and the idle, useless regretting.”</blockquote><blockquote>— <a href="https://quotefancy.com/arthur-brisbane-quotes">Arthur Brisbane</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDWEongNPCCiiJU_1yqlvQ.png" /></figure><p>This is Part 2 of this series, and if you landed up here first, try to read <a href="https://medium.com/@shambhukumarsinha/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">Part 1</a> first. In this article, I am covering some tips and tricks for working with Linux commands, usage of JSON, YAML, etc. and these are not related to the CKAD concept but must needed for improving efficiency in the exam.</p><h3>Linux, YAML, JSON knowledge requires for CKAD exam</h3><h3>YAML &amp; JSON</h3><p>You must have a very good concept for using YAML, JSON, and configuring them for Kubernetes objects, even you must practice how to convert from JSON to YAML or vice versa.</p><p>I strongly recommend going through the <strong>KodeKloud course to Learn and Practice essential skills on YAML, JSON PATH for FREE</strong> Course — <a href="https://kodekloud.com/courses/json-path-quiz/">Free JSON Path Test Course | KodeKloud</a></p><p><strong>Configuration of XML to JSON and to YAML</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*L05j5MRCdU9YZ7Hn.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/0*HQSfHz9LEsVFaLky.png" /></figure><p><strong>JSON search and expression</strong>- Refer below link for detailed understanding</p><p><a href="https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html">https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html</a></p><h4><strong>YAML Multiline</strong></h4><p>Many problems require running Linux command configuration for pod, and sometimes commands can be multiline for better readability. Please understand how this works.</p><p><a href="https://yaml-multiline.info/">https://yaml-multiline.info/</a></p><p><strong>Block Style Indicator</strong>: The<a href="https://yaml.org/spec/1.2.2/#812-literal-style"> <em>block style</em></a> indicates how newlines inside the block should behave. If you would like them to be kept as newlines, use the <strong>literal</strong> style, indicated by a pipe (|). If instead you want them to be replaced by spaces, use the <strong>folded</strong> style, indicated by a right angle bracket (&gt;). (To get a newline using the folded style, leave a blank line by putting <em>two</em> newlines in. Lines with extra indentation are also not folded.)</p><h4>JQ- practice</h4><p>JQ basic commands may not require expertise but remembering few basic commands would be helpful</p><p>k get po my-d-6d966f5869–725k4 -o json |jq -c ‘paths | select(.[-1] == “status”)’</p><h4>YQ — practice</h4><p>Same thing for YQ, practice few basic commands e.g.</p><pre>yq e -o=props<br>k get po testpod -o json |yq e &#39;.metadata&#39; -<br>k get po testpod -o json |yq e &#39;.metadata.name&#39; -<br>k get po testpod -o json |yq e -o=props<br>k get po testpod -o json |yq e &#39;.status.phase&#39; -<br>k get po testpod -o yaml |yq e &#39;.status.phase&#39; -<br>k get po testpod -o json |yq e &#39;.status.conditions[2].type&#39; -</pre><h3>Alias and export</h3><p>Below are some aliases that would be useful for the exam, but this must be part of your individual strategy. Develop your strategy. The aliases mentioned below can be used as per your convenience. Along with alias, function can be used to speed up the execution of multiple commands. Please note: make these settings as soon as the test starts. It will take 4–5 minutes, but it will save time a lot and increase efficiency.</p><ol><li>The below export setting is used for generating a template of an object by using the $dc variable in imperative commands.</li></ol><pre>export dc=&#39; - dry-run=client -o yaml&#39;</pre><p>2. The below export setting is used for generating a template of an object that contains most of the configuration of the object by using the $ds variable in imperative commands.</p><pre>export ds=&#39; - dry-run=server -o yaml&#39;</pre><p>3. The below export setting is done for the deletion of an object forcefully.</p><pre>export fd=&#39; - force - grace-period=0&#39;</pre><p>4. The below alias is used for the deletion of an object very quickly by using fd &lt;pod name or any other object&gt;</p><pre>alias fd=&#39;k replace - force - grace-period=0 -f&#39;</pre><p>5. Set the default namespace in the current context. Have practice bringing back to the default namespace for the current context.</p><pre>alias nd=&quot;k config set-context - current - namespace default&quot;</pre><p>6. Display simple output of service, pod, and deployment in the current namespace.</p><pre>alias ka=&quot;k get svc,po,deploy&quot;</pre><p>7. Display detailed output of services, pods, and deployments in the current namespace.</p><pre>alias kas=&quot;k get svc,po,deploy –show-label -owide&quot;</pre><p>8. Set some vim configuration for better vi editor usability, and below are details of the configuration.</p><pre>echo set sts=2 ts=2 sw=2 et cuc cul &gt;&gt;.vimrc<br><br># details of settings<br>ts - tab space<br>sts - softtabstop<br>sw - shiftwidth<br>et - expand tab instead of space<br>nu - show number<br>ai - automated indenting<br>cuc - Vim to enable cursor column<br>cul - Vim cursor limit<br><br>Avoid au and ai that causes issue in copy paste as number and formatting</pre><p>9. Function for creating namespace as well as setting namespace in the current configuration context</p><pre>nnc(){ k create ns $1; k config set-context - current - namespace $1; }<br><br># Usages: nnc &lt;namespace&gt;</pre><p>10. Make a backup of your history so that you can restore it later if a session is lost.</p><h3>Linux Vi Editor</h3><p>Must gain good hands-on to use VIM or VI editor, below are some of command/infos</p><p><a href="https://www.javatpoint.com/vi-editor">Vi Editor with Commands in Linux/Unix Tutorial — javatpoint</a></p><p><a href="https://www.shell-tips.com/cheat-sheets/vim-quick-references/#gsc.tab=0">Vi and Vim Quick References: A One Page Cheat Sheet (shell-tips.com)</a></p><p>Cheat sheet : <a href="https://devhints.io/vim">https://devhints.io/vim</a></p><p><strong>Showing line number in editor</strong></p><pre>:set number</pre><p><strong>Visual mode — Change selection mode of line or character</strong></p><ul><li>Small v — for character selection</li><li>Shift v <strong>for</strong> sifting and playing with block -</li><li>Shift V the select line by moving arrow key and then use Shift &gt; to move right and &lt; to left</li><li>Use . (dot) to repeat moving</li></ul><p><strong>Other VIM command</strong></p><ol><li>Ctr B then arrow then move cursor using key: H J K L</li><li>INSERT Mode inline : i</li><li>INSERT Mode after line : a</li><li>Line insert: o, O</li><li>Copy Yanki: y, yy, 2yy, y$</li><li>Paste yanked: p</li><li>Delete: d</li><li>Undo: u</li><li>Move cursor on line: 0, ^, $</li><li>Word move select: w or &lt;n&gt;w can be combined with other command like delete d and copy Yanki</li><li>Go to line: &lt;n&gt;G</li><li>Ex command==&gt; : with q,w (ZZ save and quit) , edit and save in other file :w [newfilename]</li><li>Repeat previous command with . (dot)</li><li><a href="https://linuxize.com/post/vim-find-replace/"><strong>Replace word</strong></a> with :<strong>&lt;startLine</strong>,endLine<strong>&gt;</strong> s/<strong>&lt;oldString&gt;</strong>/<strong>&lt;newString&gt;</strong>/g</li></ol><p>For example, to search for the first occurrence of the string ‘foo’ in the current line and replace it with ‘bar’, you would use:</p><pre>:s/foo/bar/</pre><p>To replace all occurrences of the search pattern in the current line, add the g flag:</p><pre>:s/foo/bar/g</pre><p>If you want to search and replace the pattern in the entire file, use the percentage character % as a range. This character indicates a range from the first to the last line of the file:</p><pre>:%s/foo/bar/g</pre><p>If the {string} part is omitted, it is considered as an empty string, and the matched pattern is deleted. The following command deletes all instances of the string ‘foo’ in the current line:</p><pre>:s/foo//g</pre><p>Instead of the slash character (/), you can use any other non-alphanumeric single-byte character except as a delimiter. This option is useful when you have the ‘/’ character in the search pattern or the replacement string.</p><pre>:s|foo|bar|</pre><p>To confirm each substitution, use the c flag:</p><pre>:s/foo/bar/gc</pre><ol><li><strong>Running Commands in edit mode</strong></li></ol><p>The vi has the capability to run commands from within the editor. To run a command, you only need to go to the command mode and type :! command.</p><p>For example, if you want to check whether a file exists before you try to save your file with that filename, you can type :! ls and you will see the output of ls on the screen.</p><p><strong>Some other useful commands</strong></p><ol><li>grep -r ‘xyz’ &lt;file|dir&gt; to search in file</li><li>ssh and scp -get familiarize</li></ol><pre>student-node ~ ➜ k get nodes<br>NAME STATUS ROLES AGE VERSION<br>cluster1-node02 Ready &lt;none&gt; 30m v1.26.0+k3s2<br>cluster1-controlplane Ready control-plane,master 31m v1.26.0+k3s2<br>cluster1-node01 Ready &lt;none&gt; 30m v1.26.0+k3s2<br>student-node ~ ➜ tee test.txt<br>Hello world tee<br>Hello world tee<br>Yes<br>Yes<br>student-node ~ ✖ scp test.txt root@cluster1-controlplane:/tmp<br>test.txt 100% 20 56.4KB/s 00:00</pre><ol><li>Create file — by “Here Document” 😀 yes <strong>&lt;&lt;</strong> is known as</li></ol><pre>controlplane ~ ✖ cat &gt;test.txt &lt;&lt;EOF<br>&gt; Help Text<br>&gt; EOF<br>controlplane ~ ➜ ls<br>sample.yaml test.txt<br>controlplane ~ ➜ cat test.txt<br>Help Text</pre><p>From &lt;<a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/">https://kubernetes.io/docs/reference/kubectl/cheatsheet/</a>&gt;</p><pre># Create multiple YAML objects from stdin<br>controlplane ~ ➜kubectl apply -f - &lt;&lt;EOF<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: busybox-sleep<br>spec:<br>  containers:<br>  - name: busybox<br>    image: busybox:1.28<br>    args:<br>    - sleep<br>    - &quot;1000000&quot;<br>---<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: busybox-sleep-less<br>spec:<br>  containers:<br>  - name: busybox<br>    image: busybox:1.28<br>    args:<br>    - sleep<br>    - &quot;1000&quot;<br>EOF</pre><p><strong>tumx</strong></p><p>tmux command not very useful as scrolling requires more effort but sometime may be useful</p><pre>Ctr + b then % or Ctr + b then shift + %<br>Ctr + b then &quot; or Ctr + b then shift + &quot;</pre><p><strong>Some search and replace command</strong></p><p>VIM Remove 6 blank space before line in line (1 . means one blank char) by :%s/^……//gc</p><p><strong>Search word in all file in current dir</strong></p><pre>controlplane ~/mv ➜ grep -r kind .<br>./sample.yaml:kind: Pod</pre><p><strong>Find File in a dir</strong></p><pre>find &lt;dir&gt; -name &#39;name&#39;</pre><p><strong>Check http connection</strong></p><pre># 1. wget<br>wget -o- ip:port to check connection<br># 2. curl<br>curl to check connection<br># 3. nc as well<br>netstat -tulpn to check check port and process<br>nc -v -w z ip:port # to check connection<br>e.g.<br>nc -v -w 2 z 10.10.2.178:8080</pre><h4><strong>nc details</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*c4Ha_7TpyojpG6Mt" /></figure><p>Gathering the information necessary to succeed on the CKAD exam is the goal of this blog. Consider yourself prepared for the test; you should be aware of all the material and know where to put your emphasis. By reading this, you may get the correct information and save a lot of time compared to doing your own research. Please do your best on the exam and let me know what you think by leaving a comment on this blog.</p><h4>Summary of this series</h4><ol><li>Part 1 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">About CKAD Test, CKAD Domains &amp; Competencies (Syllabus) # What to practice</a></li><li>Part 2 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-2-dd67db2146f1">Working with Linux commands, usage of JSON, YAML etc. for CKAD exam</a></li><li>Part 3 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-3-6115b500abbf">How to improve efficiency and some details on non Kubernetes object practice</a></li><li>Part 4 — <a href="https://medium.com/@shamre/notes-and-some-important-concepts-required-for-passing-the-ckad-exam-note-4-f7b03553c9f4">All about Kubernetes objects</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd67db2146f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks for passing the CKAD exam — Notes #1 of 4]]></title>
            <link>https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b?source=rss-9905a5e9663c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8de04720279b</guid>
            <category><![CDATA[ckad-exam]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[exam-notes]]></category>
            <category><![CDATA[ckad]]></category>
            <dc:creator><![CDATA[Shambhu Kumar Sinha]]></dc:creator>
            <pubDate>Tue, 02 Jan 2024 12:47:34 GMT</pubDate>
            <atom:updated>2025-05-23T03:24:20.266Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>My motivation for writing these articles inspired by quote</blockquote><blockquote><strong>“You teach best what you most need to learn -Richard Bach”</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDWEongNPCCiiJU_1yqlvQ.png" /></figure><p>The Kubernetes CKAD exam is not all about knowledge and concepts but also about the efficiency of solving problems quickly.</p><p>I am covering a series of four articles from my CKAD exam notes as well as tips and tricks for clearing the CKAD exam. Starting here with the syllabus (the Domains &amp; Competencies) for CKAD and what to focus on, I will subsequently cover other important tips and tricks in the rest of the articles.</p><blockquote>Probably you need to know about the imperative way of working before reading further. Imperative ways of working with Kubernetes mean creating or configuring Kubernetes objects by using the kubectl command. The declarative way involves configuring Kubernetes objects in YAML files and using the kubectl apply or replace command. l will discuss both in the later part of this series.</blockquote><h3>CKAD Domains &amp; Competencies (Syllabus) # What to practice.</h3><p>Each Domains &amp; Competencies got some weightage marked in percentage.</p><h4><strong>A. Application Design and Build (20%)</strong></h4><ol><li>Define, build and modify container images. — Practice imperative commands for creating Pods, Deployments, and their different settings. Also, one question is generally comes from Docker or Podman, so we need good practice on creating Dockerfiles and their different instructions. A question was also asked for extracting image containers in OCI format, etc.</li><li>Understand Jobs and CronJobs- Practice imperative commands but memorize settings for Job as well as for CronJob for solving problems fast, I will discuss those later in the next article.</li><li>Understand multi-container Pod design patterns (e.g. sidecar, init, and others) — Practice adding multiple image containers in Pod and practice using the vim editor to copy, paste, and modify Pod configurations correctly and quickly.</li><li>Utilize persistent and ephemeral volumes — Practice searching Kubernetes documentation for different examples of PV, PVC, and storage classes, as well as usages of PVC in Pod.</li></ol><h4><strong>B. Application Deployment (20%)</strong></h4><ol><li>Use Kubernetes primitives to implement common deployment strategies (e.g. blue/green or canary) — Practice applying all four deployment strategies by editing or deploying Deployments. This requires Vim editor practice. There is no imperative command for strategy change except for cannery, where there may be a need to create different Deployments.</li><li>Understand Deployments and how to perform rolling updates — Learn the imperative command for rolling updates as well as the scale command.</li><li>Use the Helm package manager to deploy existing packages — Practice Helm commands and have a mental map of repo, hub, release, and local repository, as well as Kubernetes deployment.</li></ol><h4><strong>C. Application Observability and Maintenance (15%)</strong></h4><ol><li>Understand API deprecations — Practice on the Kubectl convert tool for migration and try to practice on api-resource and their version using proxy; generally, one question is based on this, and it’s very easy.</li><li>Implement probes and health checks — Practice configuring the liveness and readiness probes in the main container and NOT in the init container. Mug up all configurations of liveness and readiness probes and their structures.</li><li>Use the tools provided to monitor Kubernetes applications — Practice command for determining the maximum CPU or memory consumed by a pod or node is also asked to identify the pod with the maximum resource usage.</li><li>Utilize container logs — Practice checking pod logs for different containers as well as different types of issues; simulate issues; and practice seeing output in logs.</li><li>Debugging in Kubernetes — there are 5–6 ways of debugging the pod or Kubernetes objects issues, describe, logs, and events. Practice issues by simulating them, and check if those are able to be discovered by these different methods.</li></ol><h4><strong>D. Application Environment, Configuration and Security (25%)</strong></h4><ol><li>Discover and use resources that extend Kubernetes (CRD) — Practice creating CRD, and memorising their attributes and structure, as well as important configurations. Practice on debugging for issues.</li><li>Understand authentication, authorization and admission control — This requires concept understanding as well as the use of imperative commands and practices for access by defining roles and binding them to the user or service account.</li><li>Understanding and defining resource requirements, limits and quotas — use the imperative command for setting quotas, but LimitRange can only be done by declaration.</li><li>Understand ConfigMaps — you must be well versed in imperative commands for CM and Secret. There are a few different ways to use CM and Secret. Many times, chaining Kubectl commands is very useful. See the Kubectl command reference in the documentation.</li><li>Create &amp; consume Secrets — must be well versed in using imperative commands for CM and secret.</li><li>Understand ServiceAccounts — must be clear on the concept and practice of SA and role-binding and learn how to debug issues related to SA. How to configure SA using the imperative set command.</li><li>Understand security contexts — memorize a few frequently used security capabilities and practice these with different configurations. Mostly, referring to Kubernetes documentation is helpful or sufficient.</li></ol><h4><strong>E. Services anu Networking (20%)</strong></h4><ol><li>Demonstrate basic understanding of NetworkPolicies — They are very easy but always tricky, so they require good practice of configuration with various scenarios. No imperative command is available for NetPol.</li><li>Provide and troubleshoot access to applications via services — This part is hard, but the only thing to do is learn the concept and practice all previous questions.</li><li>Use Ingress rules to expose applications — Learn the imperative way to create Ingress.</li></ol><h3>A glimpse of the summary of 16 questions is generally asked and must be practiced accordingly</h3><ol><li>Create a pod and set up env, or questions can be around setting up with some other configurations.</li><li>Create a CornJob that runs every 2 minutes, with a timeout of 20 seconds; success: 3; failure: 4. Test this Cronjib by creating a job.</li><li>Build a local Dockerfile file and copy the container in OCI format to a specified location as a tar file.</li><li>There was a pod configured with the wrong service account as default and required a fix with another service account, but it must have the right permission.</li><li>Ingress for one url accessing many services or questions can be to fix issue of ingress configuration.</li><li>NetPol for pods accessing only two ports and a pod, or NetPol for pods accessing only two pods</li><li>One Deployment configuration can be given and had to update surge, etc., and some other easy stuff.</li><li>One Deployment had to update the ENV, CM, and image, then rollback to previous</li><li>Migrate Deployment from version 1.15 YAML to 1.26 and deploy it</li><li>One deployment was updated with a liveness probe, but the deployment had an intiContainer, so it was unclear which container should be probed.</li><li>A configuration file was given for deployment, and we had to implement a canary deployment strategy.</li><li>Pod creation with env from secret and create secret.</li><li>Apply memory limit of a crashing Pod and value of memory limit should be half of range limit defined for namespace.</li><li>Helm chart deployment from repo</li><li>One Deployment with a couple of PV and PVC as well as a storage class</li><li>Question on NodePort with some other changes by expose</li></ol><h3>The CKAD Exam preperation</h3><h4>A. Developing CKAD Concepts</h4><ol><li>Kubernetes Concept: You must be very good with all Kubernetes concepts as per the CKAD exam syllabus. It may require a little more reading than the syllabus, but try to stick with it. Building concepts and initial practices may require 4–5 months, depending on your speed. I recommend reading Kubernetes in Action: <a href="https://www.manning.com/books/kubernetes-in-action">https://www.manning.com/books/kubernetes-in-action</a></li><li>I recommend the following course and additional suggestions:</li></ol><ul><li>The Udemy course by Mumshad Mannambeth — <a href="https://www.udemy.com/course/certified-kubernetes-application-developer/">Kubernetes Certified Application Developer (CKAD) with Tests</a></li><li>If you just want to prepare for the CKAD exam, then there is no need to spend time setting up Minikube, subscribing to VMs, setting up nodes, etc., as you will get a full-fledged Kubernetes practice environment in KodeKloud once you subscribe to the Udemy course.</li><li>Go through the Kubernetes documentation multiple times and focus on the below topics.</li></ul><pre>1. Concepts<br>2. Tasks<br>3. Tutorials<br>4. Reference <br>       - focus on command line tool (kubectl) <br>       - all four sections <br>           # for understanding imperative commands and docker commands</pre><h4>B. Strategy for solving problems faster</h4><ol><li>Create a mental map of examples in the Kubernetes documentation, as it is permissible to use documentation during exams. Some examples can be directly copied from the documentation and slightly modified for the solution. Practice Kubectl’s Set command chaining for Deployment as well as for Pod.</li><li>You must be very good with the VIM editor, so learn to use various shortcut keys and commands. Being efficient in the editor saves lots of time.</li><li>Develop your strategy to solve a problem in 4 to 5 minutes; with 4–5 minutes, understand the problem, work on a solution, as well as test the solution. The following was my strategy to increase the speed of the solution:</li></ol><ul><li>Creating an alias or function (yes, function; I will share details later) to solve problems quickly, like listing all pods and services and deployment together with showing labels as well as detailed output (-o wide)</li><li>Use aliases or functions to test, as well as aliases for running a temporary pod and accessing a newly created pod and behaviour.</li></ul><h4>C. Right exam Practice</h4><ol><li>Must have an exam-like simulation for practice and must practice at least one month daily before the exam. One test, and also brushing up and practicing the problems on concept. I would suggest <strong>KodeKloud — Ultimate CKAD mock exam series</strong> as well as killer.sh that comes with the CKAD exam for two free practices, but both tests will have the same questions. Try to attempt the killer.sh exam 2–3 weeks before the exam, so that will help in building the exam strategy and test efficiency. Also, <a href="https://killercoda.com/playgrounds/scenario/kubernetes">Kubernetes 1.29 | Playgrounds | Killercoda</a> can be used for most of practice.</li><li>Configuring the VIM editor for fast editing</li><li>Once you solve the problem, testing is very important immediately, so have testing strategy practice while solving the problem during practice.</li><li>Should be good with some Linux commands like ssh, file copy, sudo, etc.</li></ol><h4>D. Strategy to track solved and unloved problems with weightage during exam.</h4><ol><li>Generally, a grid with five columns and each grid with points seems like a better strategy.</li><li>Also, generally, there will be 16 questions, and the question weights will be 8 or 6 or 4. So, the maximum number of questions will have a weight of 8.</li><li>I used a mouse-pad app from Accessories to note the question marks and track them; see below in the screen below the right corner for my question tracker strategy. I used a mark for defining position as well as an * for problem solved, and I tested an otherwise short note on question type.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aw4HvtZv4nSTFwg13q2RJQ.png" /></figure><p>Check here: <a href="https://github.com/piouson/kubernetes-bootcamp#exam-questions-approach">GitHub — piouson/kubernetes-bootcamp: A modern All-In-One guide to become proficient with Kubernetes core concept and pass the Certified Kubernetes Application Developer (CKAD) exam</a></p><h4><strong>E. Planning and precautions for appearing for exam</strong></h4><ol><li>Please refrain from taking the CKAD test on your company’s laptop as most company’s laptop prohibit unknown exe installations on computer and PSI browser may be not authorized software. It will take around ten to fifteen minutes to download and install the PSI browser (<a href="https://lh5.googleusercontent.com/X0gMiwExkdRGqdGpJ2pxuyWLoWFSbdjtyN7o6jKwo_YqyCviuHaGjzCQNJWcu_-hSW0jwg1jLLBNKShLQLRQHn09cmalc8ynWQ-zctq6E_u7LlRX8TkfF78EcKPeUoTm2Gw3XSnlfcuSFUbq_ck">see screenshot</a>), which is required for the exam’s remote connection. Installation requires administrative access on the computer on which you will be taking the test.</li><li>Due to the nature of the test and the limitations of the remote access computer, you will not be permitted to access your local desktop or system during the exam. While you won’t have access to the internet, you will have access to the documentation for Kubernetes and Helm. Downloads of any kind, including installers, are restricted to Kubernetes-only sites, such as the Convert tool.</li><li>Use a big monitor and a desktop system. A laptop is not suitable at all for the CKAD exam due to its small screen and a lot of restrictions on scrolling and searching documentation in Firefox. As well, we need to work with many nested windows, and it would be a very pathetic situation to use small screens. If possible, I would suggest using a 24+ inch monitor with a external webcam on the desktop system. Also, use a better mouse and keyboard. Using the touchpad caused a lot of issues.</li><li>Every problem has its own context, and a command is given to switch the context. So every time, you must run the set context command. Along with changing the namespace as well. Using the function (nnc ns, mentioned in the next topic) would be useful as well. You will find your solution disappearing because you are not setting the right context.</li><li>Try to copy everything from the questions rather than typing.</li><li>Do not worry about setting up vim for tabstop, etc. These are available, but you must set some variables for the other aliases discussed in the next topic.</li><li>You must be good with using “explain” commands and use it with grep with A5, B2, etc. This is an easier way to search for documentation than to go to HTML documentation. I will explain this in detail in a later topic.</li><li>Memories and practice Kubernetes important object attributes and structures in YAML. There will be almost a list of 15–20 attributes that you must have by heart.</li><li>Kubectl-convert is not available, so you need to install it and practice with the document location so that you can do it quickly. The conversion was 1.15 to 1.28.</li><li>The killer.sh session pretty much matches the exam, so you must practice. But the live exam is 10 times more restricted for appearance than for the level of problems. The explanation of the test report for killer.sh is also good and really gives a detailed solution.</li><li>You must go through<a href="https://docs.linuxfoundation.org/tc-docs/certification/lf-handbook2/exam-user-interface/examui-performance-based-exams"> https://docs.linuxfoundation.org/tc-docs/certification/lf-handbook2/exam-user-interface/examui-performance-based-exams</a></li><li>If comfortable, use tmux for breaking the screen into multiple sessions for working on multiple things, like opening a document or other template and copying. I never required this during the exam, but many have suggested it. There are many issues with the copy.</li><li>When the exam session begins, a mandatory guide will appear on the screen. Go through the details and do all the setup, like minimise the top bar and act quickly to set up all aliases, exports, etc. Keep max 3–4 minutes for these settings and arranging windows.</li><li>Read the note about namespace, context, and description of the problem at the top. And for each</li><li>Firefox browser will not be showing page search at the bottom by default, so you need to do a little drag-down window from the top and bring the browser a little up to show in the left bottom corner.</li></ol><h4>E. Some useful bookmark allowed during exam</h4><ul><li><a href="https://kubernetes.io/docs/reference/kubectl/overview/"><strong>https://kubernetes.io/docs/reference/kubectl/overview/</strong></a></li><li><a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/"><strong>https://kubernetes.io/docs/reference/kubectl/cheatsheet/</strong></a></li><li><a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-strong-getting-started-strong">https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-strong-getting-started-strong</a></li></ul><h4>C. Some reference</h4><ol><li><a href="https://docs.linuxfoundation.org/tc-docs/certification/tips-cka-and-ckad">https://docs.linuxfoundation.org/tc-docs/certification/tips-cka-and-ckad</a></li><li><a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_describe/">https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_describe/</a></li><li><a href="https://www.youtube.com/watch?v=hKVz-Mwo9DM">https://www.youtube.com/watch?v=hKVz-Mwo9DM</a></li><li>Helpful<a href="https://youtu.be/4yhdTz1NFU0"> https://youtu.be/4yhdTz1NFU0</a></li></ol><h4>D. Practice reference</h4><ol><li><a href="https://github.com/dgkanatsios/CKAD-exercises">https://github.com/dgkanatsios/CKAD-exercises</a></li><li><a href="https://github.com/lucassha/CKAD-resources">https://github.com/lucassha/CKAD-resources</a></li><li><a href="https://medium.com/bb-tutorials-and-thoughts/practice-enough-with-these-questions-for-the-ckad-exam-2f42d1228552">https://medium.com/bb-tutorials-and-thoughts/practice-enough-with-these-questions-for-the-ckad-exam-2f42d1228552</a></li><li><a href="https://github.com/piouson/kubernetes-bootcamp">https://github.com/piouson/kubernetes-bootcamp</a></li><li><a href="https://github.com/jayendrapatil/kubernetes-exercises/blob/main/topics/ingress.md">https://github.com/jayendrapatil/kubernetes-exercises/blob/main/topics/ingress.md</a></li></ol><h4>Must go through below documents and understand exam environment as well as does and don’t</h4><ol><li>Certified Kubernetes Application Developer: <a href="https://www.cncf.io/certification/ckad/">https://www.cncf.io/certification/ckad/</a></li></ol><p>2. Candidate Handbook: <a href="https://www.cncf.io/certification/candidate-handbook">https://www.cncf.io/certification/candidate-handbook</a></p><p>Gathering the information necessary to succeed on the CKAD exam is the goal of this blog. Consider yourself prepared for the test; you should be aware of all the material and know where to put your emphasis. By reading this, you may get the correct information and save a lot of time compared to doing your own research. Please do your best on the exam and let me know what you think by leaving a comment on this blog.</p><h4>Summary of this series</h4><ol><li>Part 1 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-8de04720279b">About CKAD Test, CKAD Domains &amp; Competencies (Syllabus) # What to practice</a></li><li>Part 2 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-2-dd67db2146f1">Working with Linux commands, usage of JSON, YAML etc. for CKAD exam</a></li><li>Part 3 — <a href="https://medium.com/@shamre/notes-for-passing-the-ckad-exam-and-understanding-the-concepts-of-kubernetes-part-3-6115b500abbf">How to improve efficiency and some details on non Kubernetes object practice</a></li><li>Part 4 — <a href="https://medium.com/@shamre/notes-and-some-important-concepts-required-for-passing-the-ckad-exam-note-4-f7b03553c9f4">All about Kubernetes objects</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8de04720279b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>