<?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 Namrata D on Medium]]></title>
        <description><![CDATA[Stories by Namrata D on Medium]]></description>
        <link>https://medium.com/@namrata23?source=rss-c4f13e72b793------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Namrata D on Medium</title>
            <link>https://medium.com/@namrata23?source=rss-c4f13e72b793------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:10:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@namrata23/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[Top AI Overall Coding Models]]></title>
            <link>https://namrata23.medium.com/top-overall-coding-models-bb048a65f846?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb048a65f846</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 30 Jan 2026 20:08:49 GMT</pubDate>
            <atom:updated>2026-01-31T23:29:37.792Z</atom:updated>
            <content:encoded><![CDATA[<p>The coding-assistant landscape in early 2026 is more competitive than ever. Instead of a single “best” model, we now have <strong>clear leaders for different coding needs</strong> — from deep reasoning and agentic workflows to fast everyday coding and private, local development.</p><p>Below is a practical breakdown of the <strong>top coding models and platforms</strong>, based on real-world developer usage and strengths.</p><h3>🏆 Top Overall Coding Models</h3><p>These models consistently rank at the top for <strong>complex reasoning, multi-step coding tasks, and production-grade problem solving</strong>.</p><h3>Claude 3.5 Sonnet &amp; Claude 3.7 / Opus 4.1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*cvDazY7SkDO7h4ReJa6zEA.png" /></figure><h4>Claude continues to be a favorite for serious engineering work.</h4><p><strong>Best for:</strong></p><ul><li>Complex, multi-step coding tasks</li><li>Strong reasoning and architectural thinking</li><li>Long, coherent refactors and explanations</li><li>Reading and understanding large chunks of code</li></ul><p>Developers often prefer Claude for <strong>“think-first” coding</strong>, where correctness and clarity matter more than raw speed.</p><h3>GPT-4o</h3><p>GPT-4o is the go-to model for fast, flexible development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*jtDTgY16uHL6ck3B5-zaXg.png" /></figure><p><strong>Best for:</strong></p><ul><li>Quick coding help and prototyping</li><li>General-purpose programming across languages</li><li>Multimodal tasks (text + image + code)</li><li>Image-to-code and UI interpretation</li></ul><p>While it may not always outperform specialized models in deep reasoning, GPT-4o excels in <strong>speed, versatility, and usability</strong>.</p><h3>Gemini 2.5 Pro</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8BxbrMNmGfAXf__8dS6mXQ.png" /></figure><p>Gemini stands out for handling scale.</p><p><strong>Best for:</strong></p><ul><li>Very large context windows</li><li>Working with massive codebases</li><li>Cross-file and cross-repo analysis</li><li>Enterprise-level documentation and refactoring</li></ul><p>It’s particularly useful when <strong>context size becomes the bottleneck</strong> rather than raw reasoning.</p><h3>OpenAI o3-mini-high &amp; o1-pro</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jj8_nwM5_4AVxshG.jpg" /></figure><p>From <strong>OpenAI</strong>, these models are optimized for <strong>logic-heavy and agentic coding workflows</strong>.</p><p><strong>Best for</strong></p><ul><li>Algorithmic and constraint-driven problems</li><li>Infrastructure and DevOps logic</li><li>Tool-using and agent-style coding</li><li>Structured planning → execution → validation</li></ul><p>They’re especially effective in <strong>automated coding pipelines</strong> rather than one-off prompts.</p><h3>How to Choose the Right Model (Practical Guidance)</h3><p>Instead of asking <em>“Which model is best?”</em>, the better question is:<strong><em>“Which model fits my workflow?”</em></strong></p><p>Use this simple decision guide:</p><ul><li><strong>If you write production code and care about correctness</strong> → Claude</li><li><strong>If you need fast answers and multimodal help</strong> → GPT-4o</li><li><strong>If you work with very large repositories</strong> → Gemini 2.5 Pro</li><li><strong>If you automate coding or DevOps workflows</strong> → OpenAI o-series</li><li><strong>If cost matters most</strong> → GPT-4o Mini</li></ul><p>Most experienced teams don’t use one model — they <strong>combine them</strong>.</p><h3>Cost at a Glance</h3><p><strong>Category:</strong></p><p><strong>Winner Cheapest overall. </strong>GPT-4o Mini</p><p><strong>Best cost-to-performance. </strong>GPT-4o</p><p><strong>Most expensive. </strong>Claude Sonnet</p><p><strong>Best for huge context </strong>Gemini 2.5 Pro</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb048a65f846" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run LLMs locally or in Docker with Ollama & Ollama-WebUI]]></title>
            <link>https://namrata23.medium.com/run-llms-locally-or-in-docker-with-ollama-ollama-webui-379029060324?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/379029060324</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[genarative-ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[model]]></category>
            <category><![CDATA[ollama]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Tue, 07 May 2024 16:43:29 GMT</pubDate>
            <atom:updated>2024-05-08T14:11:13.192Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*u66N5Z-2YLOSnnhcndIB4g.png" /></figure><p><strong>Run open-source LLM, such as Llama 2, Llama 3 , Mistral &amp; Gemma locally with Ollama.</strong></p><p><a href="https://ollama.com/">Ollama</a> is an open-source tool designed to enable users to operate, develop, and distribute large language models (LLMs) on their personal hardware. Compatible with a variety of models such as Llama 3, Mistral, and Gemma, Ollama provides a user-friendly command-line interface and supports operating systems including macOS, Linux, and Windows. For ease of installation and management, Ollama also supports deployment within a Docker container.</p><p>We’ll explore how to run Ollama on a local setup &amp; in Docker. This process includes installing the software, configuring it to your environment.</p><h4>1. Running Ollama Locally</h4><p>To start using Ollama, you first need to install it on your system. You can download it from <a href="https://ollama.com/">https://ollama.com/ </a>. Since I have macOS I will use homebrew which is convenient command line utility for mac users .</p><pre>brew install ollama<br>brew services start ollama</pre><p>Ollama listens on port 11434 for incoming connections. To check if it’s working, open your web browser and go to http://localhost:11434/. Next, choose the large language model (LLM) you want to use locally. For example, if you want to run models like llama2, llama3, mistral and others you would use the following command.</p><pre>ollama pull mistral<br>   #    or <br>ollama pull llama3<br>   # or <br>ollama pull llama2 <br></pre><p>Ollama has a REST API for running and managing models.</p><h4>Generate a response</h4><pre>curl http://localhost:11434/api/generate -d &#39;{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;prompt&quot;:&quot; Why is the colour of sea blue ?&quot;<br>}&#39;</pre><h4>2. Running Ollama on Docker with Ollama UI</h4><h4>Prerequisites:</h4><p>Install Docker Desktop on your machine. <a href="https://www.docker.com/products/docker-desktop/">https://www.docker.com/products/docker-desktop/ </a>. This is essential for managing and running applications within containers.</p><h4>I. Ollama in a Docker container (CPU only)</h4><p>Open your terminal mac, window or linux and use the following command to fetch and run the official Ollama image from Docker Hub.</p><pre>docker run -d --name ollama -p 11434:11434 -v ollama_storage:/root/.ollama \<br>  ollama/ollama:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSqjXJUrLKUMkRDP7ah4rA.png" /></figure><p>-v ollama_storage:/root/.ollama: This option attaches a volume called &quot;ollama_storage&quot; to /root/.ollama within the container. It serves as persistent storage, preserving data generated by the application even after the container is restarted or recreated.</p><h4>II . Running Ollama &amp; WebUI with docker compose</h4><p>Clone the official repository of Ollama WebUI and run the following command to start the ollma on docker compose . Ensure that you stop the Ollama Docker container before you run the following command:</p><pre>git clone https://github.com/ollama-webui/ollama-webui<br>cd ollama-webui<br>docker compose up -d</pre><h4>III. How to access the Ollama WebUI</h4><p>Open Docker Dashboard then Containers then Click on WebUI port. The next step is to signup and created your account which will help interact with ollama locally with WebUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E0ouKYaiy1uJWBj5SV0ilQ.png" /></figure><p>You’ve successfully accessed Ollama with Ollama WebUI with docker .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lv8t3bRhvnVM0QvlcHwCXA.png" /></figure><p>Finally pull the model you need and begin interacting with it eg mistral:7b . First, navigate to the settings by clicking on your name tab, which is located at the lower left side of the interface. Then, proceed to pull the file of your choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W4cltZ1kLer2MK2pepEotQ.png" /></figure><p>When starting the application, the models are not automatically loaded into the UI. Therefore, you need to manually pull the desired models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PVPXRo6nDEblR11UOsjHQ.png" /></figure><p>You now have access to a range of tools and features within the WebUI, including:</p><ul><li>Engage Ollama to produce diverse forms of creative text, including poems, scripts for plays or movies.</li><li>Utilize the platform to seamlessly translate text across various languages, enhancing communication and understanding.</li><li>Leverage the system to assist with coding by providing smart completions and insightful coding suggestions.</li></ul><p><strong>IV. Running a large language model (LLM) locally has several benefits:</strong></p><ol><li><strong>Privacy and Security:</strong> Keeps sensitive data within your controlled environment, reducing the risk of breaches.</li><li><strong>Customization</strong>: Allows for modifications to the model to better suit specific needs.</li><li><strong>Offline Availability</strong>: Functions without internet connectivity, crucial for areas with limited access.</li><li><strong>Regulatory Compliance</strong>: Easier to adhere to data governance laws and regulations.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=379029060324" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use locals with terraform ?]]></title>
            <link>https://namrata23.medium.com/using-locals-in-terraform-77084637d414?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/77084637d414</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 21 Jul 2023 17:58:31 GMT</pubDate>
            <atom:updated>2023-07-21T18:21:27.945Z</atom:updated>
            <content:encoded><![CDATA[<p>A local value assigns a name to an expressions so you can use the name multiple times within a module. It is helpful to avoid repeating the same values or expressions multiple times in a configuration, but if overused they can also make a configuration hard to read . Locals values are not set by the user input or values in terraform files, instead, they are set ‘locally’ to the configuration .</p><h3>Benefits:</h3><p>Lets understand the benefits -</p><ol><li>Terraform locals can be re-used multiple times in the terraform configuration file.</li><li>When you use locals within the terraform locals you need to update its value once and it should reflect all over the place where it is referred.</li></ol><h3>Example:</h3><pre>locals {<br> key1 = value1<br> key2 = value2<br>} </pre><h4>Using it to create a simple resources in GCP</h4><ol><li>The <strong>locals</strong> block is used to define local variables. In this case, we define a local variable named bucket name, which is constructed using the project and environment variables. This allows us to create unique bucket names based on the environment.</li></ol><p>2. The second block creates the GCS bucket. We use the<strong> local.bucket_name</strong> variable as the name for the bucket, which ensures that the bucket name will be unique for each environment.</p><pre><br>locals {<br>  # Define the bucket name based on some variables<br>  bucket_name = &quot;my-bucket-${var.environment}-${var.project_name}&quot;<br>}<br><br>resource &quot;google_storage_bucket&quot; &quot;my_bucket&quot; {<br>  name     = local.bucket_name<br>  location = var.bucket_location<br><br>  versioning {<br>    enabled = true<br>  }<br>}</pre><p><strong>Let’s look a bit complex problem Problem.</strong></p><p>To use locals to create multiple instances in different projects and regions, you can define a list of instance configurations and use for_each with locals to loop through and create instances accordingly.</p><pre>locals {<br>  instances = {<br>    &quot;instance-1&quot; = {<br>      project_id  = &quot;project-1-id&quot;<br>      region      = &quot;us-west1&quot;<br>      zone        = &quot;us-west1-a&quot;<br>      machine_type = &quot;n1-standard-1&quot;<br>    },<br>    &quot;instance-2&quot; = {<br>      project_id  = &quot;project-2-id&quot;<br>      region      = &quot;europe-west1&quot;<br>      zone        = &quot;europe-west1-b&quot;<br>      machine_type = &quot;n1-standard-2&quot;<br>    },<br>    &quot;instance-3&quot; = {<br>      project_id  = &quot;project-3-id&quot;<br>      region      = &quot;asia-east1&quot;<br>      zone        = &quot;asia-east1-a&quot;<br>      machine_type = &quot;n1-standard-2&quot;<br>    }<br>    // Add more instance configurations as needed<br>  }<br>}<br><br>resource &quot;google_compute_instance&quot; &quot;instances&quot; {<br>  for_each = local.instances<br><br>  name         = each.key<br>  machine_type = each.value.machine_type<br>  zone         = each.value.zone<br>  project      = each.value.project_id<br>}</pre><p>This cleaner approach provides a more straightforward way to define and manage multiple instances in different projects and regions. You can easily add or modify instance configurations within the local.instances map to create more instances or update existing ones.</p><p><em>Overall, locals provide an intelligent approach to manage intermediate values in your Terraform configuration, making it more maintainable, readable, and efficient. They are a key feature that helps make Terraform configurations more elegant and manageable, especially as the infrastructure complexity grows.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbRTdXdDrxgFNv7ZmeKbhw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77084637d414" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to pass the CKS exam tips and tricks with examples (Part I)]]></title>
            <link>https://namrata23.medium.com/how-to-pass-the-cks-exam-tips-and-tricks-with-examples-part-i-5e481481d603?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e481481d603</guid>
            <category><![CDATA[çks]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[exam]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 15:42:59 GMT</pubDate>
            <atom:updated>2023-07-14T15:42:59.965Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMiLkwxvjSAoUht4OUwrIg.png" /></figure><p>The Certified Kubernetes Security Specialist (CKS) exam is a certification that validates one’s ability to design and implement secure Kubernetes clusters. The exam is challenging and requires significant preparation to pass. The exam Syllabus can be found in the link provided blow. h<a href="https://training.linuxfoundation.org/certification/certified-kubernetes-security-specialist/">ttps://training.linuxfoundation.org/certification/certified-kubernetes-security-specialist/</a> . In this article we will cover the common questions types which you can expect in the CKS exam .</p><p><em>SAVE TIME IN EXAM WITH FEW USEFUL COMMANDS</em></p><p>Once you’ve access to your terminal it worth to spend spend ~1 minute to setup your environment. This will save a lot of time in your exam.</p><pre>alias k=kubectl                         # will already be pre-configured<br>export do=&quot;--dry-run=client -o yaml&quot;    # k create deploy nginx --image=nginx $do<br>export now=&quot;--force --grace-period 0&quot;   # k delete pod x $now</pre><h3>CKS ( Topics and Resources)</h3><p>1. <strong>Get Context </strong>: You have access to multiple clusters through kubectl contexts. Write all context names into a file /opt/contexts .</p><pre>k config get-contexts -o name &gt; /opt/contexts</pre><pre># /opt/contexts<br>gimmic@infra-new<br>uat<br>prod<br>stage</pre><p><strong>Extract the certificate of user</strong> : From the kubeconfig extract the certificate of user uat and write it decoded to /opt/cert. If the user. uat is user 2 we can use the following command .</p><pre>k config view --raw -ojsonpath=&quot;{.users[2].user.client-certificate-data}&quot; | base64 -d &gt; /opt/cert</pre><p>2. <strong>Security with Falco: </strong>here we have a use a particular context to use the cluster eg.</p><p><strong>Example</strong> : kubectl config use-context uat</p><p>Falco will is installed with default configuration on nodes eg . cluster1-node1. Connect to node using the command ssh cluster1-node1. First we can investigate Falco config in the /etc/falco directory. This is the default configuration, if we look into falco.yaml .</p><pre>➜ ssh cluster1-node1<br>➜ root@cluster1-node1:~# service falco status<br>➜ root@cluster1-node1:~# cd /etc/falco<br>➜ root@cluster1-node1:/etc/falco# ls<br>#  you should see the following files<br>falco.yaml  falco_rules.local.yaml  falco_rules.yaml  k8s_audit_rules.yaml  rules.available  rules.d</pre><pre># /etc/falco/falco.yaml<br>...<br># Where security notifications should go.<br># Multiple outputs can be enabled.<br><br>syslog_output:<br>  enabled: true<br>.....</pre><p>This means that Falco is writing into syslog. We have to do 2 tasks now.</p><p>Find a <em>Pod</em> running image nginx which creates unwanted package management processes inside its container.</p><p>Find a <em>Pod</em> running image httpd which modifies /etc/passwd. Save the Falco logs for case 1 under /opt/falco.log in format: (time-with-nanoseconds, container-id, container-name,user-name. The commands to find the offending pods look like this:</p><pre>➜ root@cluster1-node1:~# cat /var/log/syslog | grep falco | grep nginx | grep process<br>➜ root@cluster1-node1:~# cat /var/log/syslog | grep falco | grep httpd | grep passwd</pre><p>We need the container ID of the pod too. The following command is helpful in getting the container ID.</p><pre>➜ root@cluster1-node1:~# crictl ps -id  &lt;processid&gt;</pre><p><strong><em>Eliminate offending Pods by scaling the replicas to 0 . Use Falco from command line . We can also use Falco directly from command line, but only if the service is disabled:</em></strong></p><pre>➜ root@cluster1-node1:~# service falco stop</pre><p><strong>Create logs in correct format</strong></p><p>The task requires us to store logs for “unwanted package management processes” in format time,container-id,container-name,user-name. The output from falco shows entries for &quot;Error Package management process launched&quot; in a default format. Let&#39;s find the proper file that contains the rule and change it:</p><pre>➜ root@cluster1-node1:~# cd /etc/falco/<br>➜ root@cluster1-node1:/etc/falco# grep -r &quot;Package management process launched&quot;<br>./falco_rules.yaml:    Package management process launched in container (user=%user.name user_loginuid=%user.loginuid .<br>➜ root@cluster1-node1:/etc/falco# cp falco_rules.yaml falco_rules.yaml_ori<br>vim falco_rules.yaml<br>➜ root@cluster1-node1:/etc/falco# vim falco_rules.yaml<br></pre><pre>change the file format as expected<br><br>(Example) <br><br># Container is supposed to be immutable. Package management should be done in building the image.<br>- rule: Launch Package Management Process in Container<br>  desc: Package management process ran inside container<br>  condition: &gt;<br>    spawned_process<br>    and container<br>    and user.name != &quot;_apt&quot;<br>    and package_mgmt_procs<br>    and not package_mgmt_ancestor_procs<br>    and not user_known_package_manager_in_container<br>  output: &gt;<br>    Package management process launched in container %evt.time,%container.id,%container.name,%user.name<br>  priority: ERROR</pre><p>For all available fields we can check <a href="https://falco.org/docs/rules/supported-fields">https://falco.org/docs/rules/supported-fields</a>, which should be allowed to open during the exam.Next we check the logs in our adjusted format</p><p>3. <strong>Apiserver Security:</strong></p><p>Use to context to use a particulat cluster eg kubectl config use-context workload-uatThe security investigation of the k8s cluster1 (workload-uat) states the following about the apiserver setup that it is accessible through a NodePort <em>Service.</em></p><p>Change the apiserver setup so that it is only accessible through a ClusterIP <em>Service</em></p><p>We can also check the <em>Service</em> and see its of type NodePort.</p><pre>kubectl get svc</pre><p>The apiserver runs as a static <em>Pod</em>, so we can edit the manifest. But before we do this we also create a copy in case we mess things up:</p><pre>➜ root@cluster1-master1:~# cp /etc/kubernetes/manifests/kube-apiserver.yaml ~/1_kube-apiserver.yaml<br><br>➜ root@cluster1-master1:~# vim /etc/kubernetes/manifests/kube-apiserver.yaml<br></pre><p>Remove the line which says “— — kubernetes-service-node-port=31111”. Once the changes are made, give the apiserver some time to start up again. Check the apiserver’s <em>Pod</em> status and the process parameters. We need to delete the <em>Service</em> for the changes to take effect.</p><pre>➜ root@cluster1-master1:~# kubectl -n kube-system get pod | grep apiserver<br>➜ root@cluster1-master1:~# ps aux | grep kube-apiserver | grep node-port</pre><p>4. <strong>Pod Security Policies : </strong>Suppose we have a <em>Deployment</em> hacker in <em>Namespace</em> hello which mounts /run/containerd as a hostPath volume on the <em>Node</em> where its running. This means that the <em>Pod</em> can access various data about other containers running on the same <em>Node</em>. You’re asked to forbid this behavior by:</p><ol><li>Enabling Admission Plugin PodSecurityPolicy in the apiserver.</li><li>Creating a <em>PodSecurityPolicy</em> named psp-mount which allows hostPath volumes only for directory /tmp.</li><li>Creating a <em>ClusterRole</em> named psp-mount which allows to use the new <em>PSP</em></li><li>Creating a <em>RoleBinding</em> named psp-mount in <em>Namespace</em> hello which binds the new <em>ClusterRole</em> to all <em>ServiceAccounts</em> in the <em>Namespace</em> hello</li></ol><p>Restart the <em>Pod</em> of <em>Deployment</em> hacker afterwards to verify new creation is prevented.</p><p>To solve this we need to run the following commands. If it mounts containerd we will see it in the volume section.</p><pre>k -n hello get pod | grep hacker<br><br>k -n hello  describe pod hacker-69b6db5f5d-ldbdh  # (example)<br># if it mounts  containerd we will se it in the volume section<br><br>Volumes:<br>  containerdata:<br>    Type:          HostPath (bare host directory volume)<br>    Path:          /run/containerd</pre><p><strong><em>for this Enable Admission Plugin for PodSecurityPolicy . Log in to the master node</em></strong></p><pre>➜ ssh cluster1-master1<br>➜ root@cluster1-master1:~# cp /etc/kubernetes/manifests/kube-apiserver.yaml ~/4_kube-apiserver.yaml<br>➜ root@cluster1-master1:~# vim /etc/kubernetes/manifests/kube-apiserver.yaml</pre><pre>#   - --enable-admission-plugins=NodeRestriction,PodSecurityPolicy      # change</pre><p>Enabling the <em>PSP</em> admission plugin without authorizing any policies would prevent any <em>Pods</em> from being created in the cluster. That’s why there is already an existing <em>PSP</em> default-allow-all which allows everything and all <em>Namespaces</em> except hello use it via a <em>RoleBinding.</em></p><pre>apiVersion: policy/v1beta1<br>kind: PodSecurityPolicy<br>metadata:<br>  name: psp-mount<br>spec:<br>  privileged: true<br>  seLinux:<br>    rule: RunAsAny<br>  supplementalGroups:<br>    rule: RunAsAny<br>  runAsUser:<br>    rule: RunAsAny<br>  fsGroup:<br>    rule: RunAsAny<br>  volumes:<br>  - &#39;*&#39;<br>  allowedHostPaths:             # task requirement<br>    - pathPrefix: &quot;/tmp&quot;</pre><pre>k -f 4_psp.yaml create</pre><p>Create the pods . So far the <em>PSP</em> has no effect because we gave no RBAC permission for any <em>Pods</em>-<em>ServiceAccounts</em> to use it yet. So we do:</p><p>The following command will create a <em>ClusterRole</em> like:</p><pre># kubectl -n hello create clusterrole psp-mount --verb=use --resource=podsecuritypolicies --resource-name=psp-mount</pre><pre># kubectl -n hello create rolebinding psp-mount --clusterrole=psp-mount --group system:serviceaccounts</pre><p>And for the <em>RoleBinding we use the above command .</em></p><p>Test new PSP. We restart the <em>Deployment</em> and check the status.</p><pre>➜ k -n hello rollout restart deploy hacker</pre><p>We see FailedCreate and checking for <em>Events</em> shows more information about why. We will edit the deployment and in volume section the path will be /tmp.</p><pre>k -n hello edit deploy hacker</pre><p><em>PodSecurityPolicies</em> can be really hard to come around at first, but once done they’re a powerful part in the security tool box. Though they’ll be <a href="https://github.com/kubernetes/enhancements/issues/2579">replaced with something else</a> in future K8s releases.</p><p><strong>5. CIS Benchmark : Y</strong>ou’re ask to evaluate specific settings of cluster against the CIS Benchmark recommendations. The tool used is kube-bench.</p><p>First we ssh into the master node run kube-bench against the master components:</p><pre>ssh cluster1-master1<br>➜ root@cluster1-master1:~# kube-bench run --targets=master<br><br># EXAMPLES<br>...<br>== Summary ==<br>41 checks PASS<br>13 checks FAIL<br>11 checks WARN<br>0 checks INFO</pre><p>We see some passes, fails and warnings. Let’s check the required task (1) of the controller manager.</p><p>On the master node ensure (correct if necessary) that the CIS recommendations are set for:</p><ol><li>The --profiling argument of the kube-controller-manager</li><li>The ownership of directory /var/lib/etcd</li></ol><p>On the <strong>worker node</strong> ensure (correct if necessary) that the CIS recommendations are set for:</p><ol><li>The permissions of the kubelet configuration /var/lib/kubelet/config.yaml</li><li>The --client-ca-file argument of the kubelet</li></ol><pre>➜ root@cluster1-master1:~# kube-bench run --targets=master | grep kube-controller -A 3<br>➜ root@cluster1-master1:~# vim /etc/kubernetes/manifests/kube-controller-manager.yaml</pre><p>Edit the file make changes in the file (— — profiling=false # add) . We wait for the <em>Pod</em> to restart, then run kube-bench again to check if the problem was solved.</p><p>Next task (2) is to check the ownership of directory /var/lib/etcd, so we first have a look:</p><pre>➜ root@cluster1-master1:~# ls -lh /var/lib | grep etcd</pre><p>If the owner-ship looks like user root and group root. change it to etcd:etcd</p><pre>➜ root@cluster1-master1:~# chown etcd:etcd /var/lib/etcd</pre><p>Number 3</p><p>To continue with number (3), we’ll head to the worker node and ensure that the kubelet configuration file has the minimum necessary permissions as recommended:</p><pre>➜ ssh cluster1-worker1<br><br>➜ root@cluster1-worker1:~# kube-bench run --targets=node<br><br>EXAMPLE<br>...<br>== Summary ==<br>15 checks PASS<br>10 checks FAIL<br>2 checks WARN<br>0 checks INFO</pre><p>Also here some passes, fails and warnings. We check the permission level of the kubelet config file. If we get 777 it is highly permissive access level and not recommended by the kube-bench guidelines:</p><pre>➜ root@cluster1-worker1:~# chmod 644 /var/lib/kubelet/config.yaml</pre><p>]Finally for number (4), let’s check whether --client-ca-file argument for the kubelet is set properly according to kube-bench recommendations:</p><pre>➜ root@cluster1-worker1:~# ps -ef | grep kubelet<br><br>➜ croot@cluster1-worker1:~# vim /var/lib/kubelet/config.yaml</pre><p>If theclientCAFile points to the location of the certificate, which is correct.</p><pre># /var/lib/kubelet/config.yaml<br>apiVersion: kubelet.config.k8s.io/v1beta1<br>authentication:<br>  anonymous:<br>    enabled: false<br>  webhook:<br>    cacheTTL: 0s<br>    enabled: true<br>  x509:<br>    clientCAFile: /etc/kubernetes/pki/ca.crt</pre><p><strong>6. Verify the Platform Binaries</strong></p><p>There are Kubernetes server binaries located at /opt/binaries. You&#39;re provided with the following verified sha512 values for these:</p><p><strong>kube-controller-manager (Verified Binary ) </strong>60100cc725e91fe1a949e1b2d0474237844b5862556e25c2c655a33boa8225855ec5ee22fa4927e6c46a60d43a7c4403a27268f96fbb726307d1608b44f38a60</p><p>Delete those binaries that don’t match with the sha512 values above. We can actually compare everything properly before. Let’s look at kube-controller-manager again.</p><pre>➜ cd /opt/binaries <br>ls<br>kube-controller-manager  kube-proxy  <br>➜ sha512sum kube-controller-manager &gt; compare<br>➜ vim compare</pre><p>Edit to only have the provided hash and the generated one in one line each. compare the two hashes and the delete the binary if they are not alike.</p><pre>➜ cat compare | uniq</pre><p>These are the few example and questions which you might expect in the exam. More to come in the next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e481481d603" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Traffic Director With TCP Services & TCP Route Using Envoy Proxies.]]></title>
            <link>https://namrata23.medium.com/traffic-director-with-tcp-services-tcp-route-using-envoy-proxies-9d3f6a6305af?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d3f6a6305af</guid>
            <category><![CDATA[traffic-director]]></category>
            <category><![CDATA[tcp]]></category>
            <category><![CDATA[managed-instance-group]]></category>
            <category><![CDATA[internal-load-balancer]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Tue, 27 Jun 2023 02:28:13 GMT</pubDate>
            <atom:updated>2023-06-27T02:31:16.211Z</atom:updated>
            <content:encoded><![CDATA[<p>Traffic Director is Google Cloud’s fully managed application networking platform and service mesh. We can deploy global load balancing across clusters and virtual machine (VM) instances in multiple regions, offload health checking from service proxies, and configure traffic control policies. Today we will set up Traffic Director which uses TCP route &amp; TCP services.</p><p>Traffic Director which uses TCP route &amp; TCP services is similar to the Envoy sidecar proxy configuration as in the HTTP services. The difference being the backend service provides a TCP service and routing based on TCP parameters.</p><h4>Prerequisites:</h4><ol><li>Enable billing.</li><li>Enable the required APIs as described below .</li></ol><pre>gcloud services enable \<br>  osconfig.googleapis.com \<br>  trafficdirector.googleapis.com \<br>  compute.googleapis.com \<br>  networkservices.googleapis.com</pre><p>2. Decide how you want to install Envoy.</p><p>3. Grant the required permissions.</p><p>4. If you are using Compute Engine, enable the Cloud DNS API and configure Cloud DNS.</p><p>5. Ensure that the service account used by the Envoy proxies has sufficient permissions to access the Traffic Director API.</p><p>The next step involves setting up Envoy on VMs. On Compute Engine, we can automatically add Envoy to applications running on the VMs. We will use a VM template that installs Envoy, connects it to Traffic Director, and also configures VM’s networking. Before we begin we need to have the required permissions. It is strongly recommend that we configure new Envoy deployments with xDS v3, or migrate to xDS v3 if we have an existing deployment that uses xDS v2. To enable SA IAM <a href="https://cloud.google.com/iam/docs/understanding-roles#other-roles">Traffic Director Client role</a> (roles/trafficdirector.client), is set which wraps the required permissions. We can use the following gcloud command for that purpose.</p><pre>gcloud projects add-iam-policy-binding PROJECT \<br>    --member serviceAccount:SERVICE_ACCOUNT_EMAIL \<br>    --role=roles/trafficdirector.client</pre><h3>How To Set Up TCP Services:</h3><ol><li>First we need to create a file called mesh.yaml to create the mesh resource specification.</li></ol><pre>name: sidecar-mesh</pre><p>2. Use the mesh.yaml file to create the mesh resource.</p><pre>gcloud network-services meshes import sidecar-mesh \<br>  --source=mesh.yaml \<br>  --location=global</pre><h4>Configure the TCP server</h4><p>For the purpose of demo , we will create a backend service which uses VMs using <a href="https://cloud.google.com/compute/docs/instance-groups#managed_instance_groups">managed instance groups</a> that serve a test TCP service on port 80.</p><ol><li>Create a Compute Engine template with a service on port 80.</li></ol><pre>gcloud compute instance-templates create tcp-vm-template \<br>  --scopes=https://www.googleapis.com/auth/cloud-platform \<br>  --tags=allow-health-checks \<br>  --image-family=debian-10 \<br>  --image-project=debian-cloud \<br>  --metadata=startup-script=&quot;#! /bin/bash<br>sudo apt-get update -y<br>sudo apt-get install netcat -y<br>while true;<br>  do echo &#39;Hello from traffic Director&#39; | nc -l -s 0.0.0.0 -p 80;<br>done &amp;&quot;</pre><p>2. The next step is to create a managed instance group based on the template.</p><pre>gcloud compute instance-groups managed create tcp-mig \<br>  --zone=Zone \<br>  --size=1 \<br>  --template=tcp-vm-template</pre><p>3. Set the named ports on the created managed instance group to port 80.</p><pre>gcloud compute instance-groups set-named-ports tcp-mig <br>   --zone=ZONE <br>   --named-ports=tcp:80</pre><p>4. Create a health check for the instances.</p><pre>gcloud compute health-checks create tcp tcp-health-check --port 80</pre><p>5. Create a firewall rule to allow incoming health check connections to instances in your network.</p><pre>gcloud compute firewall-rules create tcp-health-checks \<br>   --network default \<br>   --action allow \<br>   --direction INGRESS \<br>   --source-ranges=35.191.0.0/16,130.211.0.0/22 \<br>   --target-tags allow-health-checks \<br>   --rules tcp:80</pre><p>6. The following step is to create a global backend service with a load balancing scheme of type INTERNAL_SELF_MANAGED and attach the health check to the backend service. Here we use managed instance group that runs the sample TCP service that we created earlier.</p><pre>gcloud compute backend-services create tcp-service-mig \<br>    --global \<br>    --load-balancing-scheme=INTERNAL_SELF_MANAGED \<br>    --protocol=TCP \<br>    --health-checks tcp-health-check</pre><p>7. Finally we attach the managed instance group to the backend service.</p><pre>gcloud compute backend-services add-backend tcp-service-mig \<br>  --instance-group tcp-mig \<br>  --instance-group-zone=ZONE \<br>  --global</pre><h4>Setting up routing with TCP route</h4><ol><li>In a file called tcp_route.yaml create the TcpRoute specification.</li></ol><pre>name: tcp-route<br>meshes:<br>- projects/$PROJECT_NUMBER/locations/global/meshes/sidecar-mesh<br>rules:<br>- action:<br>    destinations:<br>    - serviceName: projects/$PROJECT_NUMBER/locations/global/backendServices/tcp-service-mig<br>  matches:<br>  - address: &#39;10.0.0.1/32&#39;<br>    port: &#39;80&#39;</pre><p>2. Using the tcp_route.yaml specification, create the TcpRoute resource.</p><pre>gcloud network-services tcp-routes import tcp-route \<br>  --source=tcp-route.yaml \<br>  --location=global</pre><h4>Create a TCP client with an Envoy sidecar to access the application</h4><p>For this we need to create a instance template and then create a VM with Envoy that is connected to Traffic Director.</p><pre>gcloud beta compute instance-templates create td-client-template \<br>  --image-family=debian-10 \<br>  --image-project=debian-cloud \<br>  --service-proxy=enabled,mesh=sidecar-mesh \<br>  --metadata=startup-script=&quot;#! /bin/bash<br>sudo apt-get update -y<br>sudo apt-get install netcat -y&quot;<br><br><br>gcloud compute instances create td-vm-client \<br>  --zone=ZONE \<br>  --source-instance-template td-client-template</pre><p>2. Log in to the VM that we created and verify connectivity to the test services that we created using the netcat utility.</p><pre>gcloud compute ssh td-vm-client</pre><pre>echo &#39;Hello  from traffic Director&#39; | nc 10.0.0.1 80</pre><p>The test service should return the phrase <strong>Hello from traffic Director.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AaYliw0iM_J9syH0S6EmGw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d3f6a6305af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to pass CKA Exam : Resources and Topics]]></title>
            <link>https://namrata23.medium.com/how-to-pass-cka-exam-resources-and-topics-7df323fc2c5c?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/7df323fc2c5c</guid>
            <category><![CDATA[best-courses]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[resources]]></category>
            <category><![CDATA[ckad-exam]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 28 Oct 2022 18:22:59 GMT</pubDate>
            <atom:updated>2022-10-28T18:28:37.569Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to pass Certified Kubernetes Administrator (CKA Exam) : Resources and Topics</h3><p>CKA is not a tough exams but still the exams tests your time management and coding skills rather than testing your knowledge in multiple choice questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V2Cs88p_l6ySN6_ur6Pzgg.jpeg" /></figure><p>There are many resources to study but if you really want to crack the exam in one go follow these simple steps. Practice is the key here . You should know the imperative commands to save your time during the exam. These command are useful for both CKA &amp; CKAD exam .</p><p><strong>CKA Exam Syllabus (<em>TopicWeightage)</em></strong></p><ol><li>Cluster Architecture, Installation &amp; Configuration 25%</li></ol><p>2. Services &amp; Networking 20%</p><p>3. Troubleshooting 30%</p><p>4. Workloads &amp; Scheduling15%</p><p>5. Storage10%</p><p><strong>Best courses and resources for CKA preparation :</strong></p><ul><li><a href="https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/">https://www.udemy.com/course/certified-kubernetes-administrator-with-practice-tests/</a></li><li><a href="https://click.linksynergy.com/deeplink?id=CuIbQrBnhiw&amp;mid=39197&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcertified-kubernetes-administrator%2F">Certified Kubernetes Administrator 2022</a> [Udemy Best Course]</li><li><a href="https://cloudacademy.com/learning-paths/certified-kubernetes-administrator-exam-preparation-242/">https://cloudacademy.com/learning-paths/certified-kubernetes-administrator-exam-preparation-242</a>/</li><li><a href="https://killer.sh/cka">https://killer.sh/cka</a></li><li><a href="https://github.com/bbachi/CKAD-Practice-Questions">https://github.com/bbachi/CKAD-Practice-Questions</a></li><li><a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/">https://kubernetes.io/docs/reference/kubectl/cheatsheet/</a></li><li><a href="https://github.com/ahmetb/kubernetes-network-policy-recipes">https://github.com/ahmetb/kubernetes-network-policy-recipes</a>.(network policies.</li></ul><p><strong>Pre Setup during the exam : ( saves times) </strong>Once you’ve gained access to your terminal it wise to spend a couple of minute to setup your environment.</p><pre>alias k=kubectl                        <br>export do=&quot;--dry-run=client -o yaml&quot; <br>  <br>k create deploy nginx --image=nginx $do<br>export now=&quot;--force --grace-period 0&quot;  <br> <br>k delete pod x $now</pre><h3><strong>CKA ( Topics and Resources)</strong></h3><ol><li><strong>Schedule Pod on Master Node/Worker nodes : </strong>Create Pod which can <strong>only</strong> be scheduled on a <em>master node</em> do not add new labels on any nodes. Here we need to add the toleration for running on master nodes, but also the nodeSelector to make sure it only runs on master nodes. If we only specify a toleration the <em>Pod</em> can be scheduled on master or worker nodes. <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/#example-use-cases">https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/#example-use-cases</a></li></ol><pre>tolerations:                                 <br>- effect: NoSchedule                         <br>  key: node-role.kubernetes.io/master        <br>- effect: NoSchedule                         <br>  key: node-role.kubernetes.io/control-plane <br>nodeSelector:                                <br>  node-role.kubernetes.io/control-plane: &quot;&quot;</pre><p><strong>2. Context : </strong>You have access to multiple clusters from your main terminal through kubectl contexts. Get the context and write them into a file.</p><pre>k config get-contexts<br># write the name of contexts to a file<br>k config get-contexts -o name &gt; /tmp/context.file</pre><p><strong>3. Scale down StatefulSet/deployments : </strong>Create a deployment with <br> 3 replicas . Next, deploy the application on with a new version of image, by performing a rolling update. Finally, rollback that update to the previous version. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">https://kubernetes.io/docs/concepts/workloads/controllers/deployment/</a></p><p><strong>4. Configure a LivenessProbe</strong> <strong>ReadinessProbe</strong> which does check if the url is reachable. <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/</a></p><p><strong>5. Kubectl sorting</strong>:<em> </em>There are various <em>pods </em>in all namespaces. Write a command into into a file which lists all <em>pods </em>sorted by their AGE or UID. Also list all the pods showing name and namespace. (few examples are listed below)</p><p><a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/">https://kubernetes.io/docs/reference/kubectl/cheatsheet/</a></p><pre><strong># List all the pods showing uid and creationTimestamp</strong></pre><pre>1. kubectl get pod -A --sort-by=.metadata.creationTimestamp<em><br>2. kubectl get pod -A --sort-by=.metadata.uid</em></pre><pre><em># </em><strong>List PersistentVolumes sorted by capacity</strong><br>3. kubectl get pv --sort-by=.spec.capacity.storage</pre><pre>#<strong>List all the pods showing name and namespace with a json path expression</strong><br>4. kubectl get pods -o=jsonpath=&#39;{.items[*][&#39;metadata.name&#39;, &#39;metadata.namespace&#39;]}&#39;</pre><pre>#<strong>List the nginx/httpd  pod with custom columns POD_NAME and POD_STATUS</strong></pre><pre>5. kubectl get po -o=custom-columns=&#39;POD_NAME:.metadata.name, POD_STATUS:.status.containerStatuses[].state&#39;</pre><pre><strong># Check the image version in pod without the describe command</strong></pre><pre>6. kubectl get po nginx -o jsonpath=&#39;{.spec.containers[].image}{&#39;\n&#39;}&#39;</pre><pre><strong># Get list of all the pods showing name and namespace with a jsonpath expression</strong></pre><pre>7. kubectl get pods -o=jsonpath=&#39;{.items[*][&#39;metadata.name&#39; , &#39;metadata.namespace&#39;]}&#39;</pre><p><strong>6. RBAC ServiceAccount Role RoleBinding </strong>Create a new <em>ServiceAccount</em> in a given <em>Namespace</em> . Create a <em>Role</em> and <em>RoleBinding </em>for the same.<em> </em><a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">https://kubernetes.io/docs/reference/access-authn-authz/rbac/</a></p><p><strong><em>RBAC combinations and 3 valid ones:</em></strong></p><ol><li><em>Role</em> + <em>RoleBinding</em> (available in single <em>Namespace</em>, applied in single <em>Namespace</em>)</li><li><em>ClusterRole</em> + <em>RoleBinding</em> (available cluster-wide, applied in single <em>Namespace</em>)</li><li><em>ClusterRole</em> + <em>ClusterRoleBinding</em> (available cluster-wide, applied cluster-wide)</li><li><em>Role</em> + <em>ClusterRoleBinding</em> (<strong>NOT POSSIBLE:</strong> available in single <em>Namespace</em>, applied cluster-wide)</li></ol><p><strong>7. Storage, PV, PVC, Pod volume: </strong>Create a <em>PersistentVolume</em> with capacity of <em>2Gi</em>, accessMode <em>ReadWriteOnce</em>, hostPath “/mnt/data” and no storageClassName defined. Next create a new <em>PersistentVolumeClaim</em> . It should request <em>2Gi</em> storage, accessMode <em>ReadWriteOnce</em> and should not define a storageClassName. The <em>PVC</em> should bound to the <em>PV</em> correctly. Finally create a new <em>Deployment </em>with the nginx image<em> </em>which mounts that volume at “/usr/share/nginx/html” . <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/">https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/</a></p><p><strong>8. Node and Pod Resource Usage</strong>: If the metrics-server is installed in the cluster. You want to know the kubectl commands to:</p><ol><li>show <em>Nodes</em> resource usage ( <em>k top node</em>)</li><li>show <em>Pods</em> and their containers resource usage (<em>k top pod</em> )</li></ol><p><strong>9. Kill Scheduler, Manual Scheduling:</strong></p><p>The first step is ssh into the <em>master node</em>. <strong>Temporarily</strong> stop the kube-scheduler, this means in a way that you can start it again afterwards. Create a single <em>pod </em>and confirm its created but not scheduled on any node as the kube-scheduler is stopped . Now you’re the scheduler, schedule that <em>Pod</em> on the master node . This can be done by adding a nodeName in the the spec section of the pod definition file. The next step is the force replace the pods which is in pending state. The <em>Pod</em> will start running on the master now as requested, although no tolerations were specified. <strong>Start the scheduler again. </strong>Schedule a second test Pod and make sure it is running on the worker node as expected.</p><p><strong>10. DaemonSet on all Nodes :</strong> Create a <em>DaemonSet</em> with image httpd:2.4-alpine and add some labels . The <em>Pods</em> it creates should request cpu and memory. The <em>Pods</em> of that <em>DaemonSet</em> should run on all nodes, master and worker. For this make sure to add the toleration so that it is scheduled on master and worker nodes. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/">https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/</a></p><pre>tolerations:                                  <br>- effect: NoSchedule                          <br>  key: node-role.kubernetes.io/master         <br>- effect: NoSchedule                          <br>  key: node-role.kubernetes.io/control-plane  </pre><p><strong>11. Multi Containers and Pod shared Volume: </strong>Create a <em>Pod</em> named multi-container-pod in with three containers, named con1, con2 and con3. There should be a volume attached to that <em>Pod</em> and mounted into every container, but the volume shouldn&#39;t be persisted or shared with other <em>Pods</em>.</p><p><strong>12. Cluster Event Logging: </strong>The following command is handy</p><pre><em>kubectl get events -A --sort-by=.metadata.creationTimestamp</em></pre><p><strong>13. Namespaces and Api Resources: </strong>Create a new <em>Namespace</em> . Write the names of all namespaced Kubernetes resources (like <em>Pod</em>, <em>Secret</em>, <em>ConfigMap</em>…) into a file. Find the <em>Namespace</em> with the highest number of Roles defined in it and write its name and amount of <em>Roles</em> into a new file.</p><p><strong>14. Fix Kubelet</strong>: If the kubelet is not running on worker nodes . Fix it and confirm that cluster has nodes available in Ready state . You should be able to schedule a <em>Pod</em> on that worker nodes afterwards. For this we need to ssh in the worker nodes and check the status . If the kubelet is stopped start the kublet.</p><pre>ps aux | grep kubelet<br>systemctl status kubelet <br>systemctl start kubelet <br>systemctl enable kubelet</pre><p><strong>15. Create Secret and mount into Pod: </strong>Create a <em>Pod</em> of image busyboxwhich should keep running for some time. Create a <em>Secret</em> from a file in the <em>some</em> namespace and mount it readonly into the <em>Pod</em> at /tmp/secret. Create a new <em>Secret</em> in same namespace<em> </em>called secret2 which should contain user=user and pass=1234. These entries should be available inside the <em>Pod&#39;s</em> container as environment variables USER and PASS. Confirm everything is working. <a href="https://kubernetes.io/docs/concepts/configuration/secret/">https://kubernetes.io/docs/concepts/configuration/secret/</a></p><p><strong>16. Update Kubernetes Version and join cluster: </strong>One of the node is running an older Kubernetes version and is not even part of the cluster. Update Kubernetes on that node to the exact version that&#39;s running on master. Then add this node to the cluster. The detailed steps are defined in the document . <a href="https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade">https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade</a></p><p><strong>17. Create a Static Pod and Service: </strong>Create a Static Pod named static-pod in some namespace on master node . It should use the nginx image and have resource requests for CPU and memory. Then create a NodePort <em>Service</em> named static-pod-service which exposes that static-pod on port 80 and check if it has <em>Endpoints</em> and if its reachable through the master internal IP address. You can connect to the internal node IPs from your main terminal.</p><p><strong>18. Etcd Snapshot Save and Restore: </strong>Make a backup of etcd running on master and save it on the master node at /tmp/etcd-backup.db. Then create a <em>Pod</em> of your kind in the cluster. Finally restore the backup, confirm the cluster is still working . <a href="https://discuss.kubernetes.io/t/etcd-backup-and-restore-management/11019">https://discuss.kubernetes.io/t/etcd-backup-and-restore-management/1101</a>9</p><p><strong>19. NetworkPolicy</strong>: Create a new NetworkPolicy which allows Pods in namespace test to connect to port 9000 of Pods in namespace echo.Further ensure that the new NetworkPolicy:<br> * does not allow access to Pods, which don&#39;t listen on port 9000<br> * does not allow access from Pods, which are not in namespace test</p><p><a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/">https://kubernetes.io/docs/concepts/services-networking/network-policies/</a></p><p><strong>20. Monitor the logs of pod foo</strong> : Extract log lines corresponding to error <em>unable-to-access-website .</em></p><p><strong>21. Add an init container</strong> to a pod definition file or pod . The init container should create an empty file named /workdir/calm.txt. If the empty file is not created the the pod should exit. <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/">https://kubernetes.io/docs/concepts/workloads/pods/init-containers/</a></p><p><strong>22. Schedule a pod on the node : </strong>Create pod with a image nginx and schedule on the node which has a label disk=ssd <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/">https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/</a></p><p><strong>23. Adding a sidecar container</strong> . Adding a sidecar container, using the busybox image, to the existing Pod X . The new sidecar container should run few commands. Use a Volume, mounted at /var/log, to make the log file available to the sidecar container. <a href="https://kubernetes.io/docs/concepts/cluster-administration/logging/">https://kubernetes.io/docs/concepts/cluster-administration/logging/</a></p><p><strong>24. Create a new nginx Ingress resource : </strong>Create a resource named minimal-ingress in the namespace default . Exposing service test on path /testpath using service port 80 . <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p><p><strong>IMPORTANT : </strong>You get two free sessions of killer.sh with your exam voucher. The sessions last 36 hours each and the questions are harder than the real CKA exam. The environment/ layout of the terminal is very similar to the real exam so it helps to become comfortable with how the real exam would look.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7df323fc2c5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Create Multiple AWS Resources Using Terraform]]></title>
            <link>https://aws.plainenglish.io/how-to-create-multiple-aws-resources-using-terraform-9cfd3fc98198?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cfd3fc98198</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 02:32:19 GMT</pubDate>
            <atom:updated>2021-04-05T17:06:38.132Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform is an open-source infrastructure as code software tool that provides a consistent CLI workflow to manage many cloud services. Terraform codifies cloud APIs into declarative configuration files.</p><p>In this example, we will show you how to build multiple interdependent recourses using Terraform on AWS.</p><h3>1. Install Terraform</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*zl3XnSpMQUpsry2C.png" /></figure><p>Download Terraform <a href="https://www.terraform.io/downloads.html">here</a> and follow the guide <a href="https://www.terraform.io/intro/getting-started/install.html">here</a> on how to install Terraform on your specific system.</p><p>Once you have successfully installed Terraform, continue to the next section.</p><h3>2. Next Step-AWS Account</h3><ol><li>Create a new user for terraform in the IAM Section of your AWS account .</li><li>Select <strong>Programmatic access </strong>and enter your user details.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8wkXlTmQx7-d8YsUYnijkQ.png" /><figcaption><strong>Add user called terraform and give it Administrator Access</strong></figcaption></figure><p>3. Click next and select the Administrator Access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jC4pvv47vLsdp1loLTzXQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LNUckY3zw8OC4WkOWHFj4g.png" /></figure><p>4. Once the user is created you will get an <strong>Access key ID </strong>and <strong>Secret access key. </strong>Store these in a safe location as you will need these later. Download the csv file.</p><h3>3. Third step install AWS CLI:</h3><p><a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html">Installing or updating to the latest version of the AWS CLI</a></p><p>Once you install aws-cli you will see like this if you run the following command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rG6QxXlr4YLTJQ--XklS0Q.png" /></figure><p>I have installed cli and terraform in my windows laptop and created folder terraform which has as the unzipped files from the terraform downloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZzMxUTgbGI4htJUOaaFEwA.png" /></figure><h3>4. Build and Destroy your resources using Terraform</h3><ol><li>Move to your terraform working directory . In the command line run aws configure provide the aws access key id and secret access key along with the region. I wanted to make my resources in Oregon so I choose us-west -2 .</li><li>The key and secret is what you downloaded earlier as a csv file.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*UotW_5Qlu0xxhxoyLkjcdw.png" /></figure><p>3. Create a provider file since we are using AWS we will specify the provider as AWS. When working with terraform we should always save the file as .tf extension ( eg provider.tf ). Save the file in the same terraform directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*BXfYrg7bK-ewvIU8ayYHNQ.png" /></figure><p>4. Now we will run the “terraform init” command where we created our provider.tf file to download and initialize the appropriate provider plugins. In this case, we are downloading the AWS provider plugin we specified in our provider.tf file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*ksM58WKS9sSIW0GfGRMDTQ.png" /></figure><p>We have AWS account and created an IAM user, let’s spin up our resources using Terraform.</p><p>5. Create new file called resourses.tf . We will now create VPC, 2 public, 2 private subnets, internet gateway , route table and ec2 instance using terraform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*GOzAYoii_mY2XwkEF_Y52Q.png" /></figure><p>6. First we will define our resource VPC with name and cidr block. Next we will define two public subnets. We have to reference the VPC name in the vpc_id . The cidr blocks for the subnets should be defined here. If we choose to launch public subnet then the map_public_ip_on_launch parameter should be enabled to true . If we do not specify this any instance launched in this subnet will not have a public ip.</p><p>7. If you want to create private subnets we have to reference the vpc_id . Note that map_public_ip_on_launch parameter is not required in the private subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*zW5BmjBQqAvso9bZNfNOLg.png" /></figure><p>8. We will now create internet gateway and attach it to VPC. We can add a route in public route table with target as internet gateway. The public subnets should also be associated with the public route table so that they have access to the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*KiYtObFSeTFryk3ZvY_9Bg.png" /></figure><p>9. We will then use the resource identifier “aws_instance” to state that we are trying to bring up an EC2 instance followed by the name identifier “my_instance”.</p><p>10. We provide the AMI type on AWS. An AMI is an identifier is specific to AWS region and type . You can find the specific AMI you wish to deploy per region <a href="https://cloud-images.ubuntu.com/locator/ec2/">here</a>. We will also provide the “instance_type”. In this example, we will use a t2.micro instance type as it is supported by the <a href="https://aws.amazon.com/free/">AWS Free Tier</a> package.</p><p>In the user data section we can specify the commands and the software&#39;s which we wish to install . We are deploying simple apache web server here .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*w9uhv5PjfHj7EQGc7VRc3Q.png" /></figure><p>11. The next step is terraform plan which will tell us what resources are created along with any errors in your file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*zMXE8I6czfkyQVOVsy-0Bg.png" /></figure><p>12.Finally terraform apply is used to create all the resources. We successfully created 10 resources using terraform script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*kBJV_DNcpB8xsKbR65EjiQ.png" /></figure><p>13. We can see the default Apache page .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVO0A7GTn8inKUktBXu7-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BntGuLCCZYv07ZZSpfJzxA.png" /><figcaption><strong>The ec2 instance terraform created</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqqFryU4VahfUm4PYdAvTA.png" /><figcaption><strong>The development VPC is created</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWy4SciLczyyUXJlavUOrQ.png" /><figcaption><strong>The attached internet gateway to VPC</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivNK4ZDv8GKO7PS_iVZn6g.png" /><figcaption><strong>2 public and 2 Private subnets are created</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-oVp5Gvm2BCkmn2-medf4g.png" /><figcaption><strong>Route table associated with public subnets</strong></figcaption></figure><p>14. Finally terraform destroy is used to destroy all the ten resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhsfHh94a6qm7tPBJIwV8Q.png" /></figure><h4>Conclusion</h4><p>Thank you for reading. I hope you have found this useful. If so, be sure to let me know in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cfd3fc98198" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/how-to-create-multiple-aws-resources-using-terraform-9cfd3fc98198">How To Create Multiple AWS Resources Using Terraform</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Publish to an Amazon SNS topic while keeping the messages secure in a private network ?]]></title>
            <link>https://namrata23.medium.com/how-to-publish-to-an-amazon-sns-topic-while-keeping-the-messages-secure-in-a-private-network-8ce53cd57051?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce53cd57051</guid>
            <category><![CDATA[aws-sns]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Thu, 07 Jan 2021 19:39:03 GMT</pubDate>
            <atom:updated>2021-01-08T02:57:55.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Publish to an Amazon SNS topic while keeping the messages secure in a private network using CloudFormation.</h3><p><strong>The architecture is defined below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*41qPPPaAdwAyB1gQ.png" /></figure><p>Before you start, you need an Amazon Web Services (AWS) account. If you haven’t created an account already, go to <a href="https://aws.amazon.com/">https://aws.amazon.com/</a>, and then choose <strong>Create a Free Account</strong>.</p><p>The stack for this process includes the following resources:</p><ul><li>A<strong> VPC</strong> and the associated networking resources, <strong>including a subnet</strong>, a <strong>security group,</strong> an <strong>internet gateway</strong>, and a <strong>route table</strong>.</li><li>An <strong>Amazon EC2</strong> instance that’s launched into the subnet in the VPC.</li><li>An <strong>Amazon SNS topic</strong>.</li><li>Two <strong>AWS Lambda functions</strong>. These functions receive messages that are published to the Amazon SNS topic, and they log events in CloudWatch Logs.</li><li>Amazon <strong>CloudWatch</strong> metrics and logs.</li><li>An IAM role that allows the Amazon EC2 instance to use Amazon SNS, and an IAM role that allows the Lambda functions to write to CloudWatch logs.</li></ul><p><strong>Create the AWS resources</strong></p><p>To set up the infrastructure, you use an AWS CloudFormation <em>template</em>.</p><p>Download the <a href="https://github.com/aws-samples/aws-sns-samples/blob/master/templates/SNS-VPCE-Tutorial-CloudFormation.template">template file</a> from the GitHub website. <a href="https://github.com/aws-samples/aws-sns-samples/blob/master/templates/SNS-VPCE-Tutorial-CloudFormation.template">https://github.com/aws-samples/aws-sns-samples/blob/master/templates/SNS-VPCE-Tutorial-CloudFormation.template</a></p><ol><li>Sign in to the <a href="https://console.aws.amazon.com/cloudformation">AWS CloudFormation console</a>.</li><li>Choose <strong>Create Stack</strong>.</li><li>On the <strong>Select Template</strong> page, choose<strong><em> Upload a template to Amazon S3, or choose the file</em></strong>, and choose <strong>Next</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VF1x_73R88rVenm5uAYEow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzFlkqDDXXAo7qA5GopCpw.png" /></figure><p>5. On the <strong>Specify Details</strong> page, specify stack and key names:</p><p>For Stack name, type name <strong>VPC-SNS.</strong></p><p>For<strong> KeyName</strong>, choose <strong>KeyPair</strong> for that region if you do not have create new key pair .</p><p>For SSH Location, keep the default value of 0.0.0.0/0 and click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYpDK9oHDDasA-uOcIGfrA.png" /><figcaption><strong>Keep everything default here</strong></figcaption></figure><ol><li>On the <strong>Review</strong> page, verify the stack details.</li><li>Under <strong>Capabilities</strong>, acknowledge that AWS CloudFormation might create IAM resources with custom names.</li><li>Choose <strong>Create</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxVM3-yLeB9afCUFmBeosw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBZwCPhZ71_k1RBRMfcGCA.png" /><figcaption><strong>Creation is in progress</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*yzGNxa22sa02LEsq3qg2zQ.png" /></figure><h4>Confirm that your Amazon EC2 instance lacks internet access</h4><p><strong>To connect to your Amazon EC2 instance</strong></p><ol><li>Open the Amazon EC2 console .</li><li>In the list of instances, select <strong>VPCE-Tutorial-EC2Instance </strong>as this is the instance name given in the template.</li><li>Copy the hostname that’s provided in the <strong>Public DNS (IPv4)</strong> column</li><li>Login to putty and ping any website to see if we are connected to internet or not.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*TdH6_2RtOYK0M_huNt36XA.png" /></figure><h4>Create an Amazon VPC endpoint for Amazon SNS</h4><ol><li>Open the Amazon VPC console .</li><li>In the navigation menu on the left, choose <strong>Endpoints</strong>.</li><li>Choose <strong>Create Endpoint</strong>. On the <strong>Create Endpoint</strong> page, for <strong>Service category</strong>, keep the default choice of <strong>AWS services</strong>.</li><li>For <strong>Service Name</strong>, choose the service name for Amazon SNS.</li><li>The service names vary based on the chosen region. For example, if you chose US west (oregon), the service name is <strong>com.amazonaws.</strong><em>us-west-2</em><strong>.sns</strong>.</li><li>For <strong>VPC</strong>, choose the VPC that has the name <strong>VPCE-Tutorial-VPC</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SJ7ghvz8hffHMNVxcT0m6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9xIDClhcpOHYjXnWVw1lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVLMkHbcBfSR45npjWpAAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxk1gPdSyXGDXDf16IXz2w.png" /></figure><h4>Publish a message to your Amazon SNS topic</h4><p>The VPC you created includes an endpoint for Amazon SNS, you can log in to the Amazon EC2 instance and publish messages to the topic.</p><p>If your terminal is no longer connected to your Amazon EC2 instance, connect again</p><p>Run the command below to publish a message to your Amazon SNS topic. You should get a message ID :</p><p><strong>aws sns publish — region <em>us-west-2 </em>— topic-<em>arn arn:aws:sns:us-west-2:392804924255:VPCE-Tutorial-Topic</em> — message “Hello”</strong></p><p><em>Change the region and the topic arn from the sns topic .</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmoYAnndGYfkgaQcCe8utw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*op7GD3AIAABVrGOEhnfrzw.png" /></figure><h4>Verify your message deliveries</h4><ol><li>Open the AWS Lambda console .</li><li>On the <strong>Functions</strong> page, choose <strong>VPCE-Tutorial-Lambda-1</strong>.</li><li>Choose <strong>Monitoring</strong>.</li><li>Check the <strong>Invocation count</strong> graph. This graph shows the number of times that the Lambda function has been run.</li><li>The invocation count matches the number of times you published a message to the topic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*g417RMEkCE7GfziN5DUB-w.png" /></figure><h4><strong>Verify that the CloudWatch logs were updated</strong></h4><ol><li>Open the CloudWatch console.</li><li>In the navigation menu on the left, choose <strong>Logs</strong>.</li><li>Check the logs that were written by the Lambda functions:</li><li>Choose the <strong>/aws/lambda/VPCE-Tutorial-Lambda-1/</strong> log group.</li><li>Choose the log stream.</li><li>Check that the log includes the entry From <strong><em>SNS:HELLO</em></strong></li><li>Choose <strong>Log Groups</strong> at the top of the console to return the <strong>Log Groups</strong> page. Then, repeat the preceding steps for the /aws/lambda/VPCE-Tutorial-Lambda-2/ log group.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bU31Xg8hJN-vXItFGq3CpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYlrheljmqntw98FE7rFPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBuy57Z6NCAVpFDF3Y4e5A.png" /></figure><h4>Clean up</h4><ol><li>Open the Amazon VPC console .</li><li>In the navigation menu on the left, choose <strong>Endpoints</strong>.</li><li>Select the endpoint that you created.</li><li>Choose <strong>Actions</strong>, and then choose <strong>Delete Endpoint</strong>.</li><li>In the <strong>Delete Endpoint</strong> window, choose <strong>Yes, Delete</strong>.</li><li>The endpoint status changes to <strong>deleting</strong>. When the deletion completes, the endpoint is removed from the page.</li></ol><p><strong>To delete your AWS CloudFormation stack</strong></p><ol><li>Open the AWS CloudFormation console at <a href="https://console.aws.amazon.com/cloudformation/">https://console.aws.amazon.com/cloudformation</a>.</li><li>Select the stack <strong>VPC-SNS</strong></li><li>Choose <strong>Actions</strong>, and then choose <strong>Delete Stack</strong>.</li><li>In the <strong>Delete Stack</strong> window, choose <strong>Yes, Delete</strong>.</li><li>The stack status changes to <strong>DELETE_IN_PROGRESS</strong>. When the deletion completes, the stack is removed from the page.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_7plQ2OCNOP1VlIINW-HfQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce53cd57051" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Pass Google Cloud Professional Data Engineer Tips And Tricks]]></title>
            <link>https://namrata23.medium.com/how-to-pass-google-cloud-professional-data-engineer-exam-without-it-background-74ff03ddf007?source=rss-c4f13e72b793------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ff03ddf007</guid>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[google-certified]]></category>
            <category><![CDATA[pass]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[Namrata D]]></dc:creator>
            <pubDate>Fri, 16 Oct 2020 23:42:43 GMT</pubDate>
            <atom:updated>2021-04-06T17:40:50.311Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To Pass Google Cloud Professional Data Engineer Exam Tips and Tricks .</h3><p><strong>* This article covers the most recent exam syllabus. *</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p2dd9lZcBryLm4yE.png" /></figure><p>I passed this certification exam with nearly two months of studying: I do not have 3+ years of experience as recommended by Google to pass this exam, and it has been only 4 months since I have started learning cloud . I think the key to my success was just studying the right way for this exam.</p><p>I had to learn data engineering skills from scratch. I studied extra hard for this exam, and to some extent I think harder than necessary . I came across the Google Cloud Professional Data Engineer Certification and took several online courses to gain a better insight of the technology as it has in the scope of data analytics.</p><p>You don&#39;t need to be a IT professional in order to pass the exam , still you do need to know the basics of coding, object-orientated programming, basics of system, product lifecycle management, code design, staging and deployment . There are lot of contents and theoretical knowledge that you need to memorize for the exam . <strong><em>The application of the knowledge is very essential to tackle the question in the certification exam .</em> </strong>I took up the following courses for the GCP data engineering exam.</p><h3><strong>Courses</strong></h3><h4><strong><em>1. Coursera : Data Engineering with Google Cloud</em></strong></h4><p><strong>** Rating (6.5/10) but essential **</strong></p><p><strong>Cost </strong>: $49 USD/month with 7 days trial</p><p>Coursera was the first online course which I took and it is taught by Google professionals . The courses is divided into six short courses which has lots of presentations, hands-on labs and demos. I found this course to be quite advanced for someone without any prior experience . I wasn’t even aware of technologies like Hadoop, map reduce, data pipelines etc. I watched all the videos a couple of times to make myself familiar with the unfamiliar terminologies.<strong> <em>Though I highly recommend taking this course, but it is not enough to pass the exam.</em></strong></p><h4><a href="https://acloud.guru/learn/5f976530-ee6d-4311-93eb-029928768171?_ga=2.83732240.742137043.1602799725-1902012085.1602799725"><strong>2a. Cloud Guru : Google Certified Professional Data Engineer by Matthew Ulasien</strong></a><strong> (Originally on Linux Academy )</strong></h4><p><strong>**Rating (9/10)**</strong></p><p><strong>Cost</strong>: 50 USD /month (1 week free trial)</p><p>The course has several highlights. They cover each of the topics separately which makes is very easy to understand . Moreover the explanations are very clear and concise . This course comes with the <a href="https://www.lucidchart.com/documents/view/0ca44a63-4ea4-4d78-8367-2465512d21be/1"><strong>Data Dossier eBook</strong></a> (essentially the collated course materials) which is in-depth lucid chart for all the systems. <strong>They have labs, practice quizzes and one final exam</strong>. I must say that this is a phenomenal resource for understanding the basic concepts of GCP if you are a beginner . The lectures and the quizzes after each module are also very helpful .</p><h4><strong>2 B. </strong><a href="https://acloud.guru/learn/gcp-certified-professional-data-engineer"><strong>Cloud Guru</strong> : Google Certified Professional Data Engineer by Tim Berry:</a></h4><p><strong>**Rating 8.5 /10 **</strong></p><p>The next one is <a href="https://acloud.guru/learn/gcp-certified-professional-data-engineer?_ga=2.83732240.742137043.1602799725-1902012085.1602799725">Google Certified Professional Data Engineer by Tim Berry </a>. The modules are recently updated and is also very effective for the exam . The material of this course is somewhat different from <strong>Matthew Ulasein</strong> course on the same platform. It gives key highlights of what is expected in the exam . They also have practice exam, labs and quizzes.</p><p><strong><em>If you are new to GCP these two courses help to strike the balance between breadth and depth and gives a solid understanding of what is expected in the Professional Data Engineer certification exam.</em></strong></p><p><strong>Note :</strong><em> You also take up both courses by paying 50 US $ /month(1 Week free trail). The quizzes and exam were available even after your subscription ends</em>.</p><p><strong>3. Ma</strong><a href="https://developers.google.com/machine-learning/crash-course/ml-intro"><strong>chine Learning Crash Course (free)</strong></a></p><p><strong>**Rating 9/10**</strong></p><p>This course is Google’s fast-paced, practical introduction to machine learning. I used this course as a quick refresher since I had already covered some of the algorithms and concepts in another certification. It is well structured and gives you a good foundation of machine learning.</p><p>I would say these three resources provided me enough content for the exam. Google Cloud Platform gives $300 free credit for anyone who signs up to use its products. Leverage it and feel free to explore .</p><p><strong><em>Disclaimer </em></strong><em>: Delete the resources after you are done with the labs .</em></p><p><strong>4. Google Documentation</strong>: I know it is impossible to read the entire documentation but make sure to find out the answer of any questions in the documentation if you are unsure .</p><h4><strong>Optional:</strong></h4><p><strong>Linux Academy </strong><a href="https://linuxacademy.com/cp/modules/view/id/52"><em>SQL Primer</em></a><em> </em>. You will also need some SQL knowledge for BigQuery and BigQuery ML.</p><h3><strong>Important :</strong></h3><p>The question were focused mainly on the following topics:</p><p><strong>BigQuery </strong>best practices, <a href="https://cloud.google.com/bigquery/docs/best-practices-costs.">https://cloud.google.com/bigquery/docs/best-practices-costs.</a> BigQuery ML, syntax for <strong>wildcards, </strong>partitioned tables. The partitioned based on ingestion time, timestamp or date. IAM roles and authorized views. <a href="https://cloud.google.com/bigquery/docs/access-control">https://cloud.google.com/bigquery/docs/access-control</a>. <strong>Difference between Viewer credentials and Owner credentials<em>.</em></strong><em> </em>BigQuery Data Transfer Service is also very important. Big Query and Data Studio along with <strong>caching/pre-fetch cache.</strong> How you connect<strong> Data Studio</strong> to storage solutions. Learn the difference between<strong> default caching &amp; pre-fetch caching </strong>. How to link BigQuery and GCS with <strong>permanent tables and temporary tables.</strong><a href="https://cloud.google.com/bigquery/external-data-cloud-storage">https://cloud.google.com/bigquery/external-data-cloud-storage</a></p><p>Difference between <strong>Kafka </strong>and <strong>pub/Sub</strong> along with the connectors. <a href="https://cloud.google.com/pubsub/docs/overview">https://cloud.google.com/pubsub/docs/overview</a></p><p><strong>Dataproc</strong>: . It is a best practice to use Google Cloud Storage instead of using HDFS. You can delete the instance after data processing. You should be aware when to use <strong>HDFS instead of GCS</strong>. <a href="https://cloud.google.com/dataproc/docs/concepts/dataproc-hdfs">https://cloud.google.com/dataproc/docs/concepts/dataproc-hdfs</a></p><p><strong>Pipelines with Cloud Dataflow : </strong>Learn fundamental of date pipeline like PCollection, PTrasform, ParDo , CoGroupByKey, GroupByKey, Combine, Flatten , Pipeline I/O etc . Expect to see a couple of question on these topics.</p><p><strong>Datalab and Dataprep </strong>basics which are covered in cloud guru <strong>.</strong></p><p><strong>NoSQL Data warehouse with Cloud Bigtable</strong> and when to use it. Designing the row keys and how to avoid hot spotting (Read the documentation) <a href="https://cloud.google.com/bigtable/docs/schema-design">https://cloud.google.com/bigtable/docs/schema-design</a></p><p><strong>The above topics cover more than 60–70 % of exam questions </strong>.</p><p>Data security encryption and decryption including <strong>CMEK, CSEK and Client-Side Encryption . </strong><a href="https://cloud.google.com/kms/docs/">https://cloud.google.com/kms/docs/</a></p><p><strong>Machine Learning</strong> : Different models in ML . How to do feature scaling , overfitting and underfitting . What is regularization ? Difference between testing and training data set . <a href="https://towardsdatascience.com/l1-and-l2-regularization-methods-ce25e7fc831c?gi=b89612114f53">Understand L1/L2 regularization</a> etc.</p><p><strong>Cloud Composer </strong>DAGS and workflow orchestration.</p><p>Difference between <strong>Cloud Spanner </strong>and <strong>Cloud SQL along with read replica and failover replica.</strong></p><p><strong>Datastore</strong>: backup and migration and <strong>Firestore</strong>.</p><p><strong>Pre-Trained ML Cloud APIs</strong> is also very important especially cloud vision API, Text to speech API , Cloud video intelligence API , Dialogue flow etc.</p><h3><strong>Important from exam prospective:</strong></h3><p>I can’t stress this enough <strong>the practice exams are extremely important. </strong>I personally went through the practice questions on Linux Academy, Cloud Guru and <a href="https://cloud.google.com/certification/practice-exam/data-engineer">Google</a> again and again to make sure I understood the answers. I practiced exams from these resources multiple times till I was able to achieve more than 90 %. <strong><em>I am also attaching the link to various other practice exam which are extremely helpful in understanding the type of questions you will be expecting in the exam</em></strong>.</p><ul><li><a href="https://cloud.google.com/bigquery/docs/best-practices-costs.">https://www.examtopics.com/exams/google/professional-data-engineer/view/1/</a> <strong>(free )</strong></li><li><a href="https://www.whizlabs.com/google-cloud-certified-professional-data-engineer/">https://www.whizlabs.com/google-cloud-certified-professional-data-engineer/</a> <strong>(free &amp; paid)</strong></li><li><a href="https://www.testpreptraining.com/blog/how-to-prepare-for-google-professional-data-engineer/">https://www.testpreptraining.com/blog/how-to-prepare-for-google-professional-data-engineer/ </a>(<strong><em>paid</em></strong>)</li></ul><h3><strong>My experience:</strong></h3><p>There are many individuals that passed the Professional Data Engineering exam and share their experience online about how to prepare for the exam . I feel only a few come from a non-technical background, since the recommended experience to take the exam is 3 years (industry ) and 1 year (designing and managing solutions) using GCP. Thought I had to study extra hard I could pass the exam in 3 months of preparation.<strong><em> If I can do it so can you.</em></strong></p><p>Google official documentation is bit too lengthy still it is advisable to know best practice of all the products mentioned in the exam guide . The exam is challenging but if you study well you can become certified too.</p><p><strong><em>Last but not the least give the practice exams like you are giving a real certification exam. It helps !</em></strong></p><h3><strong>Most important:</strong></h3><p>Read the official Google exam guide properly to find out the changes in the syllabus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/0*B3jpfjTsNZA7U96t.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ff03ddf007" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>