# ScriptCrunch: Cloud, DevOps & MLOps Guides > ScriptCrunch is an independent publication and blog focussed on tutorials and learning resources for developers, DevOps enigneers, system administrators, and IT professionals Public Ghost content for AI and LLM tooling. This file includes a bounded export of public pages first, then recent public posts. Append `.md` to any post or page URL to get the content in Markdown (for example, `/example-post.md`). ## Pages ### About this site URL: https://scriptcrunch.com/about/ Last updated: 2025-09-25T16:58:20.000Z ScriptCrunch is an independent publication launched in September 2025\. If you subscribe today, you'll get full access to the website as well as email newsletters about new content when it's available. Your subscription makes this site possible, and allows ScriptCrunch to continue to exist. Thank you! ### Access all areas By signing up, you'll get access to the full archive of everything that's been published before and everything that's still to come. Your very own private library. ### Fresh content, delivered Stay up to date with new content sent straight to your inbox! No more worrying about whether you missed something because of a pesky algorithm or news feed. ### Meet people like you Join a community of other subscribers who share the same interests. ### Home Advertising Area URL: https://scriptcrunch.com/home-advertising-area/ Last updated: 2019-07-25T01:28:10.000Z _No content available._ ### Blog URL: https://scriptcrunch.com/blog-68d52e3ce24216001bf69fcd/ Last updated: 2020-07-22T19:09:30.000Z _No content available._ ### Explore our Categories ✨ URL: https://scriptcrunch.com/explore-our-categories/ Last updated: 2025-09-26T05:08:50.000Z Whether you're a photography aficionado or simply intrigued by the art of visual storytelling, our blog is your gateway to exploring the mesmerizing world of renowned photographers and the captivating narratives. ### Intro Page URL: https://scriptcrunch.com/homepage/ Last updated: 2026-06-23T07:52:37.000Z # Hi, We are ScriptCrunch Community 👋 We are certified DevOps engineers sharing practical DevOps tutorials, Kubernetes certification tips, cloud best practices, and hands-on learning resources. ### About URL: https://scriptcrunch.com/about-us/ Last updated: 2020-07-26T16:54:59.000Z ## What Scripcrunch is all about? There are significant shifts that happened in IT in terms of managing infrastructure and applications. Coding has become an integral part of infrastructure automation and application deployments. With evolving philosophies like DevOp and SRE, it is very important for everyone to know some level of coding a good level of scripting to develop and support the projects. In Scripcrunch.com we focus on articles, script snippets, code snippets, and guides that can help you in your day to day DevOps project tasks​ Also, we publish articles focussed on learning new tools and technologies. Be it Linux, cloud, automation, configuration management and what not. ### Privacy Policy URL: https://scriptcrunch.com/privacy-policy-68d52e3ce24216001bf69fcf/ Last updated: 2020-07-27T14:44:27.000Z ## Privacy Policy At Scriptcrunch, accessible from https://scriptcrunch.com, one of our main priorities is the privacy of our visitors. This Privacy Policy document contains types of information that is collected and recorded by Scriptcrunch and how we use it. If you have additional questions or require more information about our Privacy Policy, do not hesitate to contact us. This Privacy Policy applies only to our online activities and is valid for visitors to our website with regards to the information that they shared and/or collect in Scriptcrunch. This policy is not applicable to any information collected offline or via channels other than this website. ## Consent By using our website, you hereby consent to our Privacy Policy and agree to its terms. ## Information we collect The personal information that you are asked to provide, and the reasons why you are asked to provide it, will be made clear to you at the point we ask you to provide your personal information. If you contact us directly, we may receive additional information about you such as your name, email address, phone number, the contents of the message and/or attachments you may send us, and any other information you may choose to provide. When you register for an Account, we may ask for your contact information, including items such as name, company name, address, email address, and telephone number. ## How we use your information We use the information we collect in various ways, including to: - Provide, operate, and maintain our website - Improve, personalize, and expand our webste - Understand and analyze how you use our website - Develop new products, services, features, and functionality - Send you emails - Find and prevent fraud ## Log Files Scriptcrunch follows a standard procedure of using log files. These files log visitors when they visit websites. All hosting companies do this and a part of hosting services' analytics. The information collected by log files include internet protocol (IP) addresses, browser type, Internet Service Provider (ISP), date and time stamp, referring/exit pages, and possibly the number of clicks. These are not linked to any information that is personally identifiable. The purpose of the information is for analyzing trends, administering the site, tracking users' movement on the website, and gathering demographic information. ## Cookies and Web Beacons Like any other website, Scriptcrunch uses 'cookies'. These cookies are used to store information including visitors' preferences, and the pages on the website that the visitor accessed or visited. The information is used to optimize the users' experience by customizing our web page content based on visitors' browser type and/or other information. For more general information on cookies, please read ["What Are Cookies"](https://www.cookieconsent.com/what-are-cookies/?ref=scriptcrunch.com). ## Google DoubleClick DART Cookie Google is one of a third-party vendor on our site. It also uses cookies, known as DART cookies, to serve ads to our site visitors based upon their visit to www.website.com and other sites on the internet. However, visitors may choose to decline the use of DART cookies by visiting the Google ad and content network Privacy Policy at the following URL – [https://policies.google.com/technologies/ads](https://policies.google.com/technologies/ads?ref=scriptcrunch.com) ## Advertising Partners Privacy Policies You may consult this list to find the Privacy Policy for each of the advertising partners of Scriptcrunch. Third-party ad servers or ad networks uses technologies like cookies, JavaScript, or Web Beacons that are used in their respective advertisements and links that appear on Scriptcrunch, which are sent directly to users' browser. They automatically receive your IP address when this occurs. These technologies are used to measure the effectiveness of their advertising campaigns and/or to personalize the advertising content that you see on websites that you visit. Note that Scriptcrunch has no access to or control over these cookies that are used by third-party advertisers. ## Third Party Privacy Policies Scriptcrunch's Privacy Policy does not apply to other advertisers or websites. Thus, we are advising you to consult the respective Privacy Policies of these third-party ad servers for more detailed information. It may include their practices and instructions about how to opt-out of certain options. You can choose to disable cookies through your individual browser options. To know more detailed information about cookie management with specific web browsers, it can be found at the browsers' respective websites. ### Disclaimer URL: https://scriptcrunch.com/disclaimer/ Last updated: 2020-07-27T14:56:07.000Z ## Disclaimer Any opinions and views that are expressed here are **purely individual opinions.** ### **Email** Email addresses mentioned in the comment form will always be used for privacy and **never be used for spamming or sold to anyone.** ### **Comments** We love comments, but any comments which are abusive, spread hatred, are racial, or in any way hurting anyone’s opinions will **never be entertained.** We keep our comments moderated to maintain the integrity of individuals. We reserve all rights to accept or reject comments. ### Affilaite Disclaimer Periodically we will review or mention products and services on our website. If we believe it is a **good** service, it might contain an affiliate link, which means I may receive a commission or some form of compensation if you buy the service we recommend. ### Membership URL: https://scriptcrunch.com/membership/ Last updated: 2026-06-23T07:59:15.000Z _No content available._ ### Subscribe URL: https://scriptcrunch.com/subscribe/ Last updated: 2025-09-26T05:07:39.000Z _No content available._ ### signin URL: https://scriptcrunch.com/signin/ Last updated: 2025-09-26T05:08:05.000Z _No content available._ ## Posts ### [75% OFF] Linux Foundation Coupon Codes & CKA Coupons (Aug 2026) URL: https://scriptcrunch.com/linux-foundation-coupon/ Last updated: 2026-09-01T07:10:46.000Z Looking for an active [Linux](https://scriptcrunch.com/tag/linux/) Foundation coupon code? Get up to 75% off CKA, CKAD, CKS, Kubestronaut bundles, training, Skillcreds, and IT professional programs with our verified promo codes for September 2026. Also, we have added saving tips on all the **Linux Foundation** offerings for better savings. 📌 ****Note:** We update the coupons every month after getting it verified from the official ****Linux Foundation** team. ## Linux Foundation Coupons (September 2026) We have updated all the active [**The Linux Foundation**](https://training.linuxfoundation.org/?ref=scriptcrunch.com) coupons for **September 2026**. The following are the latest **site-wide active coupons.** ### \[UpTo 38% OFF\] Linux Foundation DevOps Sale As part of the exclusive [DevOps](https://scriptcrunch.com/tag/devops/) Sale, you can get upto **30% off** the Linux Foundation certifications using our exclusive coupon. This sale is **valid for a limited time.** [Redeem 30% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **SCRIPT30** at checkout **Note**: It applies to CKA | CKAD | CKS | KCNA | KCSA as well. Get up to **38% discount** on the certification bundles using code **SCRIPT30**. The following are the popular certification bundles. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) **Hurry Up**: This coupon is valid only for limited time ⏳ ### \[Save 35%\] Linux Foundation Certification Bundle Discounts When you bundle certifications, you can save up to $788 on the subscription. The following are the best certification bundles. Use code **SCRIPT30** with the bundles to save up to 35% (Coupon + bundle discount) | **Certification Bundle** | **Offer Price** | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | | [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \- Kubestronaut Bundle | $788 Savings using | | CKA + CKAD + CKS Bundle | Save $528 on [K8s](https://scriptcrunch.com/tag/kubernetes/) Bundle | | CKA + CKS Exam Bundle | Save $355 | | KCNA + CKA Exam Bundle | $210 Savings | | Linux Foundation Certified IT Associate (LFCA)+ [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) and Cloud Native Associate (KCNA) Exam Bundle | [Save $224 on LFCA + KCNA certification bundle](https://scriptcrunch.com/recommends/lfca-kcna/) | ## How to Apply Your Linux Foundation Promo Code Follow the steps given below to apply the Linux Foundation Promo Code during the purchase. **Step 1:** Click the enroll now button of the certification or the program you want to purchase ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2026/06/image.png) **Step 2:** In the checkout page, you will get an option with text box saying "Enter Coupon Code". Type or paste the SCRIPT30 coupon and click apply. You should see the discount getting applied instantly as shown in the image below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2026/06/image-1.png) **Step 3:** Proceed with the checkout after verifying the discount. ⚠️ ****Important Note:** Dont hurry with the checkout. [Go](https://scriptcrunch.com/tag/go/) through all our coupons and see which one matches your requirement and offers the maximum savings. For example, if you planning for more than one certification in a year, make sure, you use a coupon with the certification bundle to get maximum savings. If you have doubts, drop a comment below. Our certified engineers will help you out. ## Expired Coupons We keep track of all the expired coupons and promotions from the Linux Foundation as these offers get activated again this year or next years special windows. ### \[Up to 40% OFF\] Linux Foundation Flash Sale \[Expired\] The Linux Foundation is offering **35% OFF** on its individual certifications and bundles for this ongoing flash sale. [Redeem 35% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **AUG26F35** at checkout Also, you can get up to a **40% discount** on the certification bundles using code **AUG26F40**. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ### \[UpTo 35% OFF\] Linux Foundation 35th Anniversary Sale \[Expired\] Linux Foundation is offering a **35% discount** on its exclusive anniversary sale. You will get a discount for all individual certifications, training programs, and more [Redeem 35% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **TUX35SC** at checkout You can also get up to **35% discount** on the following certification bundles using code **TUX35SC**. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ### \[75% OFF\] Linux Foundation Prime Sale is Live \[Expired\] Get a **40% discount** onthe Linux Foundation certifications using the exclusive coupon. You will get discounts for Linux Foundation certifications, trainings, courses, and bundles. [Redeem 40% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **JPRIME26CCSC** at checkout Get up to 55% discount on the certification bundles using code **JPRIME26BSC**. 1. [Linux Foundation Kubestronaut Bundle](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \[KCNA + KCSA + CKA + CKAD + CKS\] 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) ($477 Savings) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) (50% Discount) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) ($372 savings) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) ($372 Savings) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ($287 Savings) Get **75% discount** on the following super bundles using code **JPRIME26SBSC** - [Cybersecurity Super Bundle](https://trainingportal.linuxfoundation.org/collections/cybersecurity-bundle?ref=scriptcrunch.com) - [Cloud Native Developer Super Bundle](https://trainingportal.linuxfoundation.org/collections/devsecops-super-bundle?ref=scriptcrunch.com) - [Cloud Native Super Bundle](https://trainingportal.linuxfoundation.org/collections/cloud-native-containers-package?ref=scriptcrunch.com) Get flat 20% discount on THRIVE-Annual using code **JPRIME26TOSC** ⏳ ****Note:** The prime day sale is valid only till June 26th. Lockin the offer before it expires. ### \[45% OFF\] Linux Foundation Kubecon Sale \[Expired\] Linux Foundation's kubecon sale is live now, You can get upto **35% off** the Linux Foundation [Kubernetes certifications](https://scriptcrunch.com/tag/kubernetes-certifications/) using our exclusive coupon. [Redeem 35% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **35KUBESC** at checkout Use **35KUBESC** code for thefollowing Kubernetes bundles to get upto 45% discount. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) (45% combined discount) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) **Hurry Up**: This kubecon coupon is valid only for limited time ⏳ ### \[Upto 75% OFF\] Linux Foundation February Lunar New Year Sale (Expired) As a part of **Linux Foundation’s Lunar New Year Sale**, get **up to 75% off** on e-learning courses, certifications, SkillCreds, and IT professional programs. For individual certifications, you can get upto **35% off** (CKA, CKS, CKAD, etc). [Redeem 35% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **LUNAR26SC** at checkout **Hurry Up**: This is a limited time sale ⏳ You can save flat 50% discount on the following Kubernetes bundles using code **LUNAR26BUNSC** - [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) - [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) - [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) - [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) - [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2026/02/image-2.png) Use the **LUNAR26K8SC** coupon code, to get **48% off** on the following Kubestronaut bundle at [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) Also, get **40% off** on instructor-led courses by using the **LUNAR26ILTSC** code. The Linux Foundation is also offering **75% off** on Super Bundles. Use the code **LUNAR26SBSC** to get your discount for the following bundles. - [Cloud Native Super Bundle](https://trainingportal.linuxfoundation.org/collections/cloud-native-containers-package?ref=scriptcrunch.com) \[CKA Certification & 6 Courses\] - [Cybersecurity Super Bundle](https://trainingportal.linuxfoundation.org/collections/cybersecurity-bundle?ref=scriptcrunch.com)\[CKA, CKS & LFCS certification & 6 courses\] - [Cloud Native Developer Super Bundle](https://trainingportal.linuxfoundation.org/collections/devsecops-super-bundle?ref=scriptcrunch.com)\[CKAD & 5 Courses\] > Get **50% off** on other bundles (excluding Kubernetes by using the code **LUNAR26BUNSC**. ### \[UpTo 45% OFF\] Linux Foundation Kubernetes Birthday Sale \[Expired\] You can get upto **35% off** the Linux Foundation certifications on this Kubernetes Birthday sale. This sale is valid forCKA, CKAD, CKS, KCNA, KCSA**,** IT professional programs, and training programs [Redeem 35% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **HBDK826CCSC** at checkout And, get up to **45% discount** on the certification bundles using code **HBDK826SC.** 1. [Linux Foundation Kubestronaut Bundle](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ### \[40% OFF\] Linux Foundation Women's Days Sale \[Expired\] Get a 40% flat discount on all Linux Foundation certifications, IT Professional programs, courses, and instructor-led training programs as part of this sale. [Redeem 40% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon:** use code **IWD26SC** at checkout **Validity**: This offer is valid till March 8, 2026 If you are looking for multiple certifications, make use of the following certification bundles. Use code **IWD26SC** at checkout. 1. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 4. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ### \[UpTo 40% OFF\] Linux Foundation Holiday Sale \[Expired\] As part of the Holiday sale, you can get upto **40% off** the Linux Foundation certifications using our exclusive coupon. This is a limited-time offer, so grab it soon before it expires. [Redeem 40% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **HOLIDAY25SC** at checkout Get up to **40% discount** on the certification bundles using code **HOLIDAY25SC**. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \- Kubestronaut bundle (40% Discount) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) ($370+ Savings) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) (40% Discount) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) ($290+ savings) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) ($229+ Savings) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ($205+ Savings) ### \[65%\] Linux Foundation Cyber Monday & Black Friday Sale (Expired) 💡 ****Note**: Next cyber monday sale will be live on November 2026. The biggest **Linux foundation Cyber Monday deal** is live now. You will get up to a **65% discount** on all the Linux Foundation training, certification, Skillcreds, IT professional programs and instructor led courses. [REDEEM 50% CYBER MONDAY DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use code **CW25SC** for certifications at checkout. Using code **CW25BUNSC** you can save up to 68% on Certification bundles. 1. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) ($500 Savings) 2. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) ($747 Savings) 3. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) ($338 Savings) 4. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) ( $407 Savings) 5. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ($330 Savings) Use code **CW25K8BUNSC** to save 60% onKubestronaut bundle 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \- Kubestronaut bundle ($1087 Savings) Following are the list of all the other Cyber Monday deals from the Linux Foundation to **save up to 65%**. | **Deal Type** | **Deal Information** | Best Deal | | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | [Certification Offer](https://training.linuxfoundation.org/cyber-monday-2023/?ref=scriptcrunch.com#coursescertifications) | \[**50% Discount**\] If you pick any training or certification separately, you will **get a 50% discount.**1\. CKA, CKAD, CKS, LFCT, LFCS - ~~$395~~ $1972\. PCA, KCSA, CAPA, FCFP, KCNA - ~~$250~~ $125 | Use code ****CW25SC** at checkout. | | [The Power Bundles ](https://training.linuxfoundation.org/cyber-monday-2023/?ref=scriptcrunch.com#powerbundles) | \[**65% Discount**\] In this bundle, you will get training and two exam registrations for a 65% Discount. That is $773 in Savings | 1\. CKA + CKAD bundle2\. CKA+ CKS bundle3\. LFCA+LFCS bundleUse code ****CW25BUNSC** at checkout to redeem this bundle discount. | | [Course & Certification Bundle](https://training.linuxfoundation.org/cyber-monday-2023/?ref=scriptcrunch.com#bundles) | \[**65% Discount**\] When you opt for a course and certification, you can get a flat 65% discount. | Kubernetes courses + Certification Bundles (**CKA, CKAD, and CKS, KCNA, LFCA** etc)Use code ****CW25BUNSC** at checkout. | | [IT Professional Programs](https://training.linuxfoundation.org/cyber-monday-2023/?ref=scriptcrunch.com#itprofessionalprograms) | **65% discount** on all three boot camps. | Use code ****CYBER24BUNDLECT** at checkout. | | [Skillcreds](https://training.linuxfoundation.org/cyber-monday-2023/?ref=scriptcrunch.com#skillcreds) | **50% savings** on all Skillcred certifications. | Use code **CYBER23SKILLCRED** at checkout | | Instructor-Led Courses | **50% saving** on Instructor-Led Courses | Use code **CYBER24CCTECHIES** at checkout. | > **Note**: The Cyber Monday sale will be valid through December 9, 2025. ### \[UpTo 47% OFF\] Linux Foundation Halloween Sale \[Expired\] As part of the Linux Foundation Halloween Sale, you can get upto **47% off** the Linux Foundation certifications, e-learning, and all programs. [Redeem 47% Discount](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **SPOOKY40CT** at checkout **Hurry Up**: This coupon is valid till October 29, 2025 ⏳ **Get up to 47% discount** on the certification bundles using code **SPOOKY40CT**. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \- Kubestronaut bundle (47% Discount) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) ($370 Savings) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) (47% Discount) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) ($255 savings) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) ($209 Savings) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ($203 Savings) ### \[UpTo 47% OFF\] Linux Foundation Cyber Security Sale \[Expired\] In this Linux Foundation Cyber Security sale, you will get upto **47% discount** for individual certifications and bundles. Save upto **40% off** on Kubernetes certifications based on Security. - KCSA - [Claim Offer Now](https://kube.promo/kcsa?ref=scriptcrunch.com) - KCNA - [Claim Offer Now](https://kube.promo/cks?ref=scriptcrunch.com) **Coupon**: Use Code **OCT25CYBERCT** at checkout Also, save upto 47% discount for the following bundle using the code **OCT25CYBERCT**. 1. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) ($370 Savings) 2. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) ($209 Savings) **Note:** You have the validity of one year after registration for the certification exam. ### \[$400 Discount\] Linux Foundation Sysadmin Sale \[Expired\] Get **up to a $400 discount** on the Linux Foundation using the Sysadmin Day sale. This offer is valid for a limited time. [GET UPTO $400 DISCOUNT](https://scriptcrunch.com/recommends/lf-sysadmin-sale/) Following are the key sysadmin day bundle offers to save maximum on certification purchases. | **Certification/Course/Bootcamp** | **Offer Details** | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------- | | 1\. [Certified Kubernetes Administrator (**CKA**) Exam + Certified Kubernetes Security Specialist (**CKS**) Exam Bundle](https://scriptcrunch.com/recommends/lf-sysadmin-sale/)2\. [Linux Foundation Certified IT Associate (**LFCA**) Exam + Kubernetes and Cloud Native Associate (**KCNA**) Exam Bundle](https://scriptcrunch.com/recommends/lf-sysadmin-sale/)3\. [CKA + CKAD Bundle](https://scriptcrunch.com/recommends/lf-sysadmin-sale/) | $400 discount using code **JULY23400** | | 1\. [Cloud Engineer Bootcamp](https://scriptcrunch.com/recommends/cloud-engineer-bootcamp/)2\. [DevOps Bootcamp](https://scriptcrunch.com/recommends/lf-devops-bootcamp/) | $400 discount using code **JULY23400** | | 1\. [CKA](https://scriptcrunch.com/recommends/cka-certification/)2\. [CKAD](https://scriptcrunch.com/recommends/ckad/)3\. [CKS](https://scriptcrunch.com/recommends/cks-exam/)4\. [KCNA](https://scriptcrunch.com/recommends/kcna/)5\. [LFCS](https://scriptcrunch.com/recommends/lfcs-promo/) | $100 discount using code **JULY23100** | ## Linux Foundation Coupon FAQs ### What the current Linux Foundation coupon code? **JPRIME26CCSC** is the current site-wide Linux Foundation coupon code to **save flat 40%** on all certifications, skillcreds and courses. ### How long the exam voucher codes are valid? If you use the voucher code and purchase a certification exam like KCNA, KCSA CKA, CKAD, or CKS, it will be valid for one year. ### What is the maximum discount you can get from the Linux foundation? During Black Friday and holiday promotions, you could **get up to a 65%** discount. For special days, you can get up to 35% off. You can always redeem 30% using coupon **DCUBE30** ### Is there a CKA 50% discount for 2025? CKA 50% discount is very rare. It is normally available as part of a Black Friday or Cyber Monday discount. ### What is the Latest Change in Linux Foundation Exams? For hands-on Linux foundation exams, the browser-based terminal has been replaced with the remote desktop PSI bridge. You can try out the new exam terminal from [killer.sh](https://killer.sh/?ref=scriptcrunch.com) practice exams. ### What is the Latest Linux Foundation Coupon? The latest Linux foundation coupon is **SCRIPT30**. You can save 20% on all certifications and courses. Also, you can save up to 35% on certification bundles. ## Conclusion [Linux Foundation](https://www.linuxfoundation.org/?ref=scriptcrunch.com) certifications are considered industry-standard open-source certifications. It offers certification and training programs on technologies like Linux, Kubernetes, GitOps, OpenStack, kernel [development](https://scriptcrunch.com/tag/development/), DevOps, SRE, [Jenkins](https://scriptcrunch.com/jenkins-installtion-guide/), etc. In this [guide](https://scriptcrunch.com/tag/guides/), we have listed all the latest Linux Foundation coupons that you can use for CKA, CKAD, CKS and other certification programs offered by the Linux Foundation. You can follow official Linux Foundation updates through the following channels. 1. [Linux Foundation official blog](https://www.linuxfoundation.org/blog?ref=scriptcrunch.com) 2. [Linux Foundation Twitter](https://x.com/linuxfoundation?ref=scriptcrunch.com) 3. [Linux Foundation Linkedin](https://www.linkedin.com/company/the-linux-foundation?ref=scriptcrunch.com) 4. [Linux Foundation Events](https://events.linuxfoundation.org/?ref=scriptcrunch.com) ### [50% OFF] Kubernetes Certification Coupons (CKA, CKAD, CKS, KCNA and KCSA) URL: https://scriptcrunch.com/kubernetes-certification-coupon/ Last updated: 2026-09-01T07:11:12.000Z Looking for a CKA coupon and other [kubernetes](https://scriptcrunch.com/tag/%3Ca%20href=)\-certifications/">Kubernetes certification coupon codes? You have come to the right place. The following is the list of [Kubernetes certifications](https://scriptcrunch.com/tag/kubernetes-certifications/). 1. [Certified Kubernetes Administrator (CKA)](https://scriptcrunch.com/kubernetes-exam-guide/), 2. Certified Kubernetes Application Developer (CKAD), 3. Certified Kubernetes Security Specialist (CKS), 4. Kubernetes and Cloud Native Associate (KCNA), and 5. Kubernetes Certified Service Associate (KCSA), These kubernetes certifications are essential for professionals looking to advance their careers in cloud-native and [DevOps](https://scriptcrunch.com/tag/devops/) roles. However, the costs of these certifications can be a hurdle. Thankfully, there are **coupon codes and bundle discounts** that can significantly reduce your expenses. In this article, we’ll explore the latest Kubernetes certification deals and expert strategies to maximize your savings using certification bundles and Tux rewards. ## Kubernetes certification Coupons September 2026 Here are the latest deals and coupon codes for Kubernetes certifications, including KCNA and KCSA, updated for September 2026. ## \[UpTo 38% OFF\] Linux Foundation Exclusive Sale [Linux](https://scriptcrunch.com/tag/linux/) Foundation is offering **30% discount** on all its individual certifications, IT professional programs, and skill crews regarding its sitewide skillmix sale. [REDEEM 30% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **DCUBE30** at checkout Also, you will get **38% discount** on the following bundles using the coupon code **DCUBE30.** 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) \- Kubestronaut bundle 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ## \[38% OFF\] CKA, CKAD, CKS, KCNA and KCSA Get flat 38% discount on all the Kubernetes certifications using this exclusive coupon code. [REDEEM 38% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **DCUBE30** at checkout > **Note:** The CKA exam syllabus has been changed on February 10th, 2025\. If you are preparing with the old syllabus, try to learn with new syllabus. ## \[UP TO 50% OFF\] Kubestronaut Bundle Discount Get an exclusive discount of up to 50% on the Kubestronaut Bundle, which includes CKA, CKAD, CKS, KCNA, and KCSA certifications. [REDEEM 50% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **R2KUBESC** at checkout ## \[Up to 40% OFF\] Linux Foundation Flash Sale \[Expired\] You can save up to **30% OFF** on all Linux Foundations individual certifications, IT professional programs, and skill crews during its flash sale. [REDEEM 30% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **AUG26F35** at checkout You can also use **AUG26F35** to get upto **40% discount** on the following bundles. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 2. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 3. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 4. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 5. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ## \[UpTo 35% OFF\] Linux Foundation 35th Anniversary Sale \[Expired\] The Linux Foundation released an anniversary Sale offer. You will get **35% discount** on all its individual certifications, IT professional programs, and skill crews regarding its sitewide skillmix sale. [REDEEM 35% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **TUX35SC** at checkout Get **35% discount** on the following bundles using the coupon code **TUX35SC** at checkout. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ## \[UpTo 45% OFF\] Linux Foundation Tech Talent Sale \[Expired\] Get upto **40% discount** on all its individual certifications, IT professional programs, and skill crews regarding its Tech Talent sale 2026. [REDEEM 40% DISCOUNT](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use Code **TECHTALENT26CT** at checkout Get **45% discount** on the following bundles using the coupon code **TECHTALENT26CT** at checkout. 1. [KCNA + KCSA + CKA + CKAD + CKS](https://training.linuxfoundation.org/certification/kubestronaut-bundle/?ref=scriptcrunch.com) 2. [CKA + CKS bundle](https://scriptcrunch.com/recommends/cka-cks-bundle/) 3. [CKA + CKAD + CKS Bundle](https://scriptcrunch.com/recommends/cka-ckad-cks/) 4. [KCNA + CKA Bundle](https://training.linuxfoundation.org/training/kcna-cka-exam-bundle/?ref=scriptcrunch.com) 5. [KCSA + CKS Exam Bundle](https://scriptcrunch.com/recommends/kcsa-cks/) 6. [KCNA + KCSA Exam Bundle](https://scriptcrunch.com/recommends/kcna-kcsa/) ## How to Apply Kubernetes Coupons Follow these steps to save money on your Kubernetes certifications: 1. **Visit the Linux Foundation Website:** [Go](https://scriptcrunch.com/tag/go/) to training.linuxfoundation.org. 2. **Choose Your Certification or Bundle:** Select the certification (KCNA, KCSA, CKA, CKAD, CKS) or a bundle that fits your career path. 3. **Enter the Coupon Code:** During checkout, input the relevant code (e.g., `DCUBE30`) in the “Apply Coupon” field. 4. **Verify Your Discount:** Check that the discount has been applied before finalizing the purchase. 5. **Complete the Payment:** Proceed to pay the discounted price and schedule your exam. ## Exclusive Tips to Save More 1. **Start with Foundational Certifications:** Begin your Kubernetes journey with **KCNA or KCSA**, which are more affordable and provide a solid base for advanced certifications. 2. **Opt for Bundles:** Bundles such as **KCNA + CKA + CKAD + CKS** offer maximum value, combining foundational and advanced certifications at discounted rates. 3. **Plan for Future Growth:** If you’re considering multiple certifications, purchase all at once during sales events to take advantage of bundle deals. 4. **Use Free Resources:** CNCF provides free study [guides](https://scriptcrunch.com/tag/guides/), while platforms like Katacoda and Play with Kubernetes offer free labs to build your skills. 5. **Act Before Price Increases:** Register early to avoid paying higher fees in 2025. ## Why Kubernetes Certifications Are Worth It - **Career Growth:** Kubernetes expertise is highly sought after, and certifications validate your skills, making you a strong candidate for top jobs. - **Global Recognition:** These certifications, offered by the CNCF, are respected worldwide and signal your expertise in Kubernetes and cloud-native technologies. - **Structured Learning Path:** Certifications such as KCNA and KCSA provide foundational knowledge, while CKA, CKAD, and CKS focus on advanced, role-specific skills. - **Practical Value:** All these certifications are hands-on, ensuring you gain real-world, job-ready skills. ## FAQs About Kubernetes Certification Coupons ### **Q: Are these coupons valid for KCNA and KCSA?** Yes, most Linux Foundation coupons are valid for all certifications, including KCNA and KCSA. ### **Q: Are there free resources to prepare for KCNA and KCSA?** Absolutely! CNCF offers free resources for KCNA, while KCSA candidates can benefit from Kubernetes documentation, online [tutorials](https://scriptcrunch.com/tag/tutorials/), and labs. ### **Q: Can I get additional discounts as a student?** Yes, the Linux Foundation often provides student discounts. Verify eligibility on their website. ### **Q: What happens if my coupon doesn’t work?** Ensure the code is valid and hasn’t expired. If issues persist, contact Linux Foundation support for assistance. ## Conclusion Whether you’re a beginner exploring Kubernetes through **KCNA** or **KCSA**, or an experienced professional pursuing advanced certifications like **CKA, CKAD, and CKS**, there are plenty of ways to save money. By using the latest coupon codes, you can achieve your goals without straining your budget. > **Pro Tip:** Bookmark this page for regularly updated Kubernetes coupon codes and exclusive deals. We’ll ensure you stay informed about the best discounts available. If you are looking for other certification coupons, please check the [Linux Foundation Coupon ](https://scriptcrunch.com/linux-foundation-coupon/)page. ### Kubestronaut Bundle (KCNA+KCSA+CKA+CKAD+CKS) Discount For 2026 URL: https://scriptcrunch.com/kubestronaut-bundle-discount/ Last updated: 2026-08-31T04:28:02.000Z Looking for the current Kubestronaut bundle coupon? You are in the right place. **DCUBE30** is the current working coupon for the Kubestronaut bundle. The Kubestronaut Bundle is a special package offered by The [Linux](https://scriptcrunch.com/tag/linux/) Foundation that includes five key [kubernetes](https://scriptcrunch.com/tag/%3Ca%20href=)\-certifications/">Kubernetes certification exams: - Kubernetes and Cloud Native Associate (KCNA) - Kubernetes and Cloud Security Associate (KCSA) - Certified Kubernetes Administrator (CKA) - Certified Kubernetes Application Developer (CKAD) - Certified Kubernetes Security Specialist (CKS) Purchasing this bundle allows individuals to save on the total cost compared to buying each exam separately. ## \[40%\] Kubestronaut Bundle Discount August ($714 Savings) Currently, You can save flat **40%** on the Kubestronaut Bundle using our exclusive coupon code. [Get Kubestronaut Bundle Discount ](https://tidd.ly/3F1Alof?ref=scriptcrunch.com) **Coupon**: Use code **DCUBE30** at checkout Based on the bundle cost of **$1495**, the discount compared to buying the certifications individually (which costs approximately **$1685**) would be around **$190**. This translates to about an **11% discount**. If you apply a 50% discount coupon on the bundle cost of $1495, the total discount compared to purchasing the certifications individually would be **$714**. That is 42.33% discount in total. ## \[50% OFF\] Exclusive Kubestronaut Bundle Sale (Expired) Get flat 50% discount on Kubestronaut Bundle using this exlcusive limite time coupon. [Get Kubestronaut Bundle Discount ](https://tidd.ly/3F1Alof?ref=scriptcrunch.com) **Coupon**: Use Code **MM26K8BUNSC** at checkout **Hurry Up**: This coupon is valid only for limited time ⏳ ## \[35% OFF\] Kubestronaut Exclusive 35th Anniversary Sale \[Expired\] Get flat a **35% discount** on the Kubestronaut Bundle using this exclusive, limited-time coupon. [Get Kubestronaut Bundle Discount ](https://tidd.ly/3F1Alof?ref=scriptcrunch.com) **Coupon**: Use Code **TUX35SC** at checkout **Hurry Up**: This coupon is valid only for a limited time ⏳ ## Kubestronaut Bundle Benefits By successfully completing all five certifications, individuals earn the title of "Kubestronaut," recognizing their comprehensive expertise in Kubernetes and cloud-native technologies. Benefits of becoming a Kubestronaut include: - An exclusive Kubestronaut jacket - A digital badge to showcase expertise - Access to a private Kubestronaut Slack channel and mailing list - Coupons for 50% off five certifications each year - 20% off three CNCF events annually To maintain Kubestronaut status, all five certifications must remain active and not expired. Also check [Kubernetes Certification coupon](https://scriptcrunch.com/kubernetes-certification-coupon/) page for individual certification discounts. For all other Certifications, check the [Linux Foundation Coupon](https://scriptcrunch.com/linux-foundation-coupon/) page. ### CKA Certification Study Guide (Certified Kubernetes Administrator) URL: https://scriptcrunch.com/kubernetes-exam-guide/ Last updated: 2026-06-23T08:55:47.000Z This **comprehensive CKA certification exam study** [**guide**](https://scriptcrunch.com/tag/guides/) covers all the important aspects of the Certified [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) Administrator exam and useful resources. Passing the cloud-native Certified Kubernetes Administrator (CKA) exam is not a cakewalk. To **pass the CKA exam**, you should have enough hands-on knowledge about Kubernetes cluster components and their associated resources. Also, It is one of the best [DevOps](https://scriptcrunch.com/tag/devops/) certifications which has a practical exam environment where you have to deal with six Kubernetes clusters. Your practice plays a key role in this exam. Not to worry, we have covered an awesome list of cka study materials, productive tips, and resources that you could use to ace the CKA exam. You can use this **CKA guide** as a learning roadmap for the certified Kubernetes administrator exam. ## Certified Kubernetes Administrator(CKA) Exam Study Guide We have structured the resources in the following categories. 1. CKA Certification Coupon 2. CKA Exam Overview & Syllabus 3. CKA Free Practice Labs 4. CKA Exam Tips 5. CKA Detailed Resource List 6. Passing the CKA Exam the Easy Way 7. Passing the CKA Exam the Hard Way 8. Other Useful CKA Resources 9. Best CKA Online Training Resources > **Note:** Dont miss the bonus materials given towards the end. ## \[38% Off\] CKA Certification Voucher Code Your first step toward CKA is to register for the exam. You can appear for the exam **anytime in 12 months with a free retake.** Register today and use the exclusive DevOps engineer sale for the CKA exam to **get a 30% discount on CKA, KCNA, CKAD, and CKS certifications.** This code expires soon. [Redeem 30% CKA Discount Now](https://scriptcrunch.com/recommends/cka-certification/) Use Coupon: **SCRIPT30** at checkout If you are planning for CKA & CKS certifications, it is better to buy the CKA+CKS bundle. You will be able to **save 38%.** [Redeem CKA + CKS Bundle Discount](https://scriptcrunch.com/recommends/cka-cks-bundle/) Use Coupon: **SCRIPT30** at checkout > **Note:** FOR *Certified Kubernetes Security Specialist (CKS) certification* you need to have CKA certification. If you are planning for both certifications, you can purchase them as a bundle from the [CKS certification page](https://scriptcrunch.com/recommends/cks-exam/). You could almost save $237 with the bundle. With **CKA exam registration**, you will get free access to [killer.sh](https://killer.sh/cka?ref=scriptcrunch.com) platform CKA practice exam simulator. Before appearing for the CKA exam, you can practice for the exam in the simulator. You can access the simulator from the exam portal. You can directly log in with the [Linux](https://scriptcrunch.com/tag/linux/) foundation credentials. You will have access to two exam sessions. In fact, the simulator exam is harder than the actual exam. So, if you try to get a passing mark on the simulator, you will definitely learn the actual CKA exam. ## CKA Certification Exam Details | Exam duration | 2 Hrs | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Exam Type | Hands-on Practical Lab | | CKA exam cost | $445 | | Kubernetes Cluster Version | v1.36 | | Pass Score | 66% | | Certification Validity | 2 years | | Important Notes | With the new syllabus, the focus is more towards Custer [troubleshooting](https://scriptcrunch.com/tag/troubleshooting/) and kubernetes operations and less focus onconfig maps and secrets. | ## CKA Exam Syllabus \[Latest\] | **Topic** | **Weightage** | | ------------------------------------------------------------------------------------------------------------------------------------ | ------------- | | [Cluster Architecture](https://devopscube.com/kubernetes-architecture-explained/?ref=scriptcrunch.com), Installation & Configuration | 25% | | Services & Networking | 20% | | Troubleshooting | 30% | | Workloads & Scheduling | 15% | | Storage | 10% | > **Note:** If you are preparing for the Certified Kubernetes Security Specialist exam see the [CKS exam guide](https://devopscube.com/cks-exam-guide-tips/?ref=scriptcrunch.com) ## CKA Exam Syllabus Changes The following are the key exam changes for the new CKA syllabus as compared to the old syllabus. Here is the [official announcement](https://training.linuxfoundation.org/certification/certified-kubernetes-administrator-cka/?ref=scriptcrunch.com). 1. The cluster version will be kubernetes v1.34 2. **Cluster Architecture, Installation & Configuration**: - [Helm](https://scriptcrunch.com/a-kubernetes-helm-guide-for-the-cka-exam/) and Kustomize for managing deployments - Kubernetes extension interfaces (CNI, CSI, CRI) - CRDs and Operators 3. **9%** weightage increased for **Service & Networking** 4. **10 to 30%** increase in weightage for **troubleshooting** 5. There is no **security** section. It is part of [CKS certification.](https://scriptcrunch.com/recommends/cks-exam/) > **Note**: If you are registering for the CKA/CKAD/KCNA certification, make use of [kubernetes Certification coupon](https://devopscube.com/linux-foundation-coupon/?ref=scriptcrunch.com) to get up to 40% discount ## CKA Hands-on Practice Labs & Tasks The following are the best places to get started for practice labs. | [Killercoda CKA Course](https://killercoda.com/killer-shell-cka?ref=scriptcrunch.com) \[Free\] | A browser-based Kubernetes practice tasks from cluster setup to Kubernetes resources deployment. | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Kubernetes Official Tasks](https://kubernetes.io/docs/tasks/?ref=scriptcrunch.com) \[Free\] | Complete all the tasks listed in the kubernetes official documentation. It will help you a lot in the examination and is a great way to be hands-on with several important topics. | | [killer.sh](https://killer.sh/?ref=scriptcrunch.com) \[Free Access With CKA registration\] | A very good exam simulator for CKA/CKAD and CKS exams mimics the real exam environment. You get two free access. | ## Free Kubernetes Practice Clusters for the CKA Exam To practice for the CKA exam, you can use the following free managed services to spin up a Kubernetes cluster. 1. **Kubernetes on** [**Vagrant**](https://scriptcrunch.com/tag/vagrant/)**:** This [CKA Github repo ](https://github.com/techiescamp/cka-certification-guide/tree/main/lab-setup?ref=scriptcrunch.com)contains the Vagrantfile and instructions for Mac, Windows and Linux systems to run a multinode local Kubernetes cluster. 2. **Google Cloud GKE:** Use[ google cloud free credits ($300) ](https://cloud.google.com/free/?ref=scriptcrunch.com)to spin up a Kubernetes cluster with one click using GKE 3. **Azure AKS:** Use [Azure free credits](https://azure.microsoft.com/en-in/services/kubernetes-service/?ref=scriptcrunch.com) ($200) to spin up a managed AKS Kubernetes cluster. 4. [**AWS**](https://scriptcrunch.com/tag/aws/) **EKS:** One-year free tier program. Also, apply for $[300 free AWS POC credits.](https://pages.awscloud.com/adoptf90d%5FGLOBAL%5FPOC-credits.html?ref=scriptcrunch.com) 5. **Digital Ocean Kubernetes Service**: [($200) Free credits](https://scriptcrunch.com/recommends/digital-ocean-free-credit/) valid for two months. 6. [Minukube Setup](https://devopscube.com/kubernetes-minikube-tutorial/?ref=scriptcrunch.com) ## CKA Exam Tips & Shortcuts To Save Time CKA exam is all about solving the questions on time. Follow the tips given below to save time during the exam. [kubectl:](https://kubernetes.io/docs/tasks/tools/install-kubectl/?ref=scriptcrunch.com) It is the key utility for the whole exam. Make sure you get really comfortable with kubectl CLI commands for managing Kubernetes resources. ### **Tip 1:** Kubectl Autocompletion Use the following commands for kubectl autocomplete. Either you can use it in the current shell or add it to` ~/.bashrc` ``` source <(kubectl completion bash) echo "source <(kubectl completion bash)" >> ~/.bashrc ``` ### **Tip 2:** Set Kubectl Alias You need to use `kubectl` command a lot. So it is best to set up a short form alias in `~/.bashrc` rather than typing the whole command. In the exam environment, you will have the **PSI environment** already setup with the following alias. ``` echo "alias k=kubectl">>~/.bashrc ``` You can set up the following aliases as well. But these are not necessary. ``` alias kp='kubectl get pods' alias ka='kubectl get all' alias kd='kubectl describe' alias kl='kubectl logs' ``` ### **Tip 3**: Kubectl Dry Run \[Saves Time\] Practice kubectl dry run commands to create YAML manifests. This saves a lot of time during the exam. For example, ``` kubectl run myapp-pod --image=nginx:latest \ --labels type=app \ --dry-run=client -o yaml > myapp-pod.yaml ``` You can also set up an alias for dry run as follows. ``` echo "alias kdr='kubectl --dry-run=client -o yaml'">>~/.bashrc ``` So you can easily create a pod YAML as shown below. ``` kdr run my-pod --image=nginx:latest > my-pod.yaml ``` ### **Tip 4:** Use Shortnames of Resources Along with the kubectl alias, use kubernetes resource short names to save time. Following are a few examples. ``` k get ns k get deploy k get svc k get pv ``` Not all resources have short names. You can check all the available short name names using the following command. ``` kubectl api-resources ``` ### **Tip 5:** Run Kubectl Context for Every Question During the CKA exam, you will be given more than one cluster to solve the questions. Therefore, it is very important to run the kubectl context every time you start solving a question. It ensures that the answers are saved in the right cluster. ## CKA Topic Wide Study Guide With Hands On Resources All you need to do is, follow the kubernetes exam curriculum and official kubernetes documentation. As it is an **open-book exam**, you can refer to kubernetes.io documentation during the exam. The following official Kubernetes documentation can be used during the exam. 1. [https://kubernetes.io/doc](https://kubernetes.io/docs?ref=scriptcrunch.com) 2. [https://github.com/kubernetes](https://github.com/kubernetes?ref=scriptcrunch.com) 3. [https://kubernetes.io/blog](https://kubernetes.io/blog?ref=scriptcrunch.com) This resource list is based on the latest CKA syllabus. ### Kubernetes Cluster Architecture, Installation & Configuration | **Manage role based access control (RBAC)** | [Kubernetes RBAC Documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/?ref=scriptcrunch.com) | | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Prepare underlying infrastructure for installing a Kubernetes cluster** | [Kubernetes the Hard Way](https://github.com/kelseyhightower/kubernetes-the-hard-way?ref=scriptcrunch.com) | | **Create and manage Kubernetes clusters using kubeadm** | [Cluster Creation with Kubeadm](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/?ref=scriptcrunch.com) | | **Manage the lifecycle of Kubernetes clusters** | [Cluster Administration Tasks](https://kubernetes.io/docs/tasks/administer-cluster/?ref=scriptcrunch.com) | | **Implement and configure a highly-available control plane** | [Highly Available Control Plane Setup](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/ha-topology/?ref=scriptcrunch.com) | | **Use Helm and Kustomize to install cluster components** | 1\. [Helm Documentation](https://helm.sh/docs/?ref=scriptcrunch.com)2\. [Kustomize Guide](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/?ref=scriptcrunch.com) | | **Understand extension interfaces (CNI, CSI, CRI, etc.)** | [Kubernetes Extension Interfaces](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/?ref=scriptcrunch.com) | | **Understand CRDs, install and configure operators** | 1\. [CRDs Documentation](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/?ref=scriptcrunch.com)2\. [Operator Pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/?ref=scriptcrunch.com) | ### Kubernetes Services & Networking | **Understand connectivity between Pods** | [Cluster Networking Concepts ](https://kubernetes.io/docs/concepts/cluster-administration/networking/?ref=scriptcrunch.com) | | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Define and enforce Network Policies** | [Network Policies Guide ](https://kubernetes.io/docs/concepts/services-networking/network-policies/?ref=scriptcrunch.com) | | **Use ClusterIP, NodePort, LoadBalancer service types and endpoints** | [Kubernetes Services Guide ](https://kubernetes.io/docs/concepts/services-networking/service/?ref=scriptcrunch.com) | | **Use the Gateway API to manage Ingress traffic** | [Kubernetes Gateway API ](https://gateway-api.sigs.k8s.io/?ref=scriptcrunch.com) | | **Know how to use Ingress controllers and Ingress resources** | 1\. [Ingress Resource Guide](https://kubernetes.io/docs/concepts/services-networking/ingress/?ref=scriptcrunch.com)2\. [Ingress Controller Guide](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/?ref=scriptcrunch.com)3\. [Kubernetes Ingress Tutorial](https://devopscube.com/kubernetes-ingress-tutorial/?ref=scriptcrunch.com) | | **Understand and use CoreDNS** | [Kubernetes CoreDNS Configuration ](https://kubernetes.io/docs/tasks/administer-cluster/coredns/?ref=scriptcrunch.com) | ### Kubernetes Troubleshooting | **Troubleshoot clusters and nodes** | [Cluster and Node Troubleshooting Guide ](https://kubernetes.io/docs/tasks/debug/debug-cluster/?ref=scriptcrunch.com)1\. Check node status and conditions2\. Inspect control plane components3\. Review kubelet and system logs | | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Troubleshoot cluster components** | [Debugging Pods and Cluster Components ](https://kubernetes.io/docs/tasks/debug/debug-cluster/?ref=scriptcrunch.com#troubleshooting-pods)1\. Inspect API server, Controller Manager, Scheduler logs2\. Verify etcd health3\. Check etcd snapshots and backups | | **Monitor cluster and application resource usage** | [Resource Usage Monitoring ](https://kubernetes.io/docs/tasks/debug-application-cluster/resource-usage-monitoring/?ref=scriptcrunch.com)1\. CPU and memory metrics for nodes and pods2\. Using kubectl top3\. Metrics server setup | | **Manage and evaluate container output streams** | [Container Logs and Output Streams ](https://kubernetes.io/docs/tasks/debug/debug-application/debug-pod-replication-controller/?ref=scriptcrunch.com)1\. Use kubectl logs2\. Streaming logs with --follow3\. Inspecting multi-container pods | | **Troubleshoot services and networking** | [Service and Networking Troubleshooting ](https://kubernetes.io/docs/tasks/debug/debug-service/?ref=scriptcrunch.com)1\. Verify ClusterIP, NodePort, LoadBalancer connectivity2\. Inspect Network Policies3\. Debug ingress and DNS issues | ### Kubernetes Workloads & Scheduling | **Understand application deployments and how to perform rolling update and rollbacks** | [Deployments Guide ](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/?ref=scriptcrunch.com)1\. Create and manage Deployments2\. Perform rolling updates3\. Rollback to previous revisions | | ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Use ConfigMaps and Secrets to configure applications** | [ConfigMaps Documentation ](https://kubernetes.io/docs/concepts/configuration/configmap/?ref=scriptcrunch.com) [Secrets Documentation ](https://kubernetes.io/docs/concepts/configuration/secret/?ref=scriptcrunch.com)1\. Inject configuration into Pods2\. Environment variables, volumes, and command-line arguments | | **Configure workload autoscaling** | [Horizontal Pod Autoscaler (HPA) ](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/?ref=scriptcrunch.com)1\. Configure CPU/memory-based scaling2\. Monitor scaling behavior3\. Adjust min/max replicas | | **Understand the primitives used to create robust, self-healing, application deployments** | 1\. ReplicaSets2\. Deployments3\. StatefulSets4\. DaemonSets5\. Pod health checks (readiness & liveness probes) | | **Configure Pod admission and scheduling (limits, node affinity, etc.)** | [Pod Scheduling & Node Affinity ](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/?ref=scriptcrunch.com) [Resource Requests and Limits ](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/?ref=scriptcrunch.com)1\. Taints and tolerations2\. NodeSelector and NodeAffinity3\. PodPriority and Preemption | ### Kubernetes Storage | **Implement storage classes and dynamic volume provisioning** | [Storage Classes Documentation ](https://kubernetes.io/docs/concepts/storage/storage-classes/?ref=scriptcrunch.com)1\. Define different storage types2\. Enable dynamic provisioning of Persistent Volumes (PVs)3\. Configure provisioner parameters | | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Configure volume types, access modes and reclaim policies** | [Persistent Volume Types & Access Modes ](https://kubernetes.io/docs/concepts/storage/persistent-volumes/?ref=scriptcrunch.com)1\. ReadWriteOnce, ReadOnlyMany, ReadWriteMany2\. Retain, Recycle, Delete reclaim policies3\. Supported volume types (hostPath, NFS, cloud provider volumes) | | **Manage persistent volumes and persistent volume claims** | [Persistent Volumes and Claims ](https://kubernetes.io/docs/concepts/storage/persistent-volumes/?ref=scriptcrunch.com#expanding-persistent-volumes-claims)1\. Create and bind PVCs to PVs2\. Monitor PV and PVC status3\. Understand volume lifecycle management | ## Passing the CKA Exam the Easy Way If you want to **pass the CKA exam** in an easy way, here is what you have to do. > **Note:** I don't recommend the easy way. However, choose this way only if you are in a hurry or need to have the CKA certification. 1. Take the Udemy CKA course with the interactive practice test. 2. Learn all the core concepts from the course 3. [Go](https://scriptcrunch.com/tag/go/) through all the interactive practice test sections. If you are a beginner, go through the practice test multiple times. 4. If you do the above three, it means you are ready to take the exam. Register and appear for the CKA exam. You should be able to pass the CKA exam. For some reason, if you are not able to get the passing mark, don't worry. You will have a free retake, and for the next attempt, you will know what to do as you go through the exam. ## Passing the CKA Exam the Hard Way Here is what you need to do if you want to learn all kubernetes concepts in the right way and pass the CKA exam without any shortcuts. 1. Learn all Kubernetes concepts from scratch. Here is what you can do to learn the kubernetes basics. - Read a kubernetes book. - Subscribe for a kubernetes course - Read the official kubernetes.io documentation. - Create a list of all kubernetes concepts and read useful blogs on how it is implemented in real-time projects. You will find so many blogs. 2. Go through [Kubernetes the hard way task](https://github.com/kelseyhightower/kubernetes-the-hard-way?ref=scriptcrunch.com). It will teach you all the essential components that are part of a kubernetes cluster. 3. Go through all the [official kubernetes tasks](https://kubernetes.io/docs/tasks/?ref=scriptcrunch.com) which are part of the kubernetes documentation. 4. \[Optional\] You go through the official [Linux Foundation CKA training](https://scriptcrunch.com/recommends/kubernets-fundamentals-course/) material. > **Note:** There is an [Advanced Cloud Engineer Bootcamp](https://scriptcrunch.com/recommends/advanced-cloud-bootcamp/) offered by the Linux Foundation which covers topics from Linux, containers, kubernetes to service mesh. You can also get certified on both Linux and Kubernetes (CKA) ## CKA Exam Updates In the latest Linux foundation announcement, the CKA exam terminal has been changed to PSI bridge. This means you cannot use your personal bookmarks anymore. Also, you can use only one monitor during the exam. ## Few Other Useful Links The following are a few useful links that would help in your Certified Kubernetes Administrator exam preparation. 1. [How Kubernetes certificate authorities work](https://jvns.ca/blog/2017/08/05/how-kubernetes-certificates-work/?ref=scriptcrunch.com): A very good blog by Julia that explains about [k8s](https://scriptcrunch.com/tag/kubernetes/) certificates 2. [All You Need to Know About Certificates in Kubernetes:](https://www.youtube.com/watch?v=gXz4cq3PKdg&ref=scriptcrunch.com) A video that talks about how certificates work in the k8s cluster. 3. [Kubecon Videos:](https://www.youtube.com/channel/UCvqbFHwN-nwalWPjPUKpvTA?ref=scriptcrunch.com) A collection of talks from Kubecon on kubernetes Hope this resource list helps :). Please let us know in the comments section if you have found interesting resources that would help our readers with certification preparation. ### Kubernetes Books If you are a total beginner or you want a structured way to get started and understand kubernetes, you should start with the following two books. 1. \[Free Ebook\] [Kubernetes Up and Running 2](https://azure.microsoft.com/en-us/resources/kubernetes-up-and-running/?ref=scriptcrunch.com): A book by Kelsey, Brenden, and Joe. It is a perfect book to learn all the Kubernetes basics. 2. [Kubernetes in Action](https://scriptcrunch.com/recommends/kubernetes-in-action/): Once you got your basics in Kubernetes, this is the second book you should read. ## Best CKA Exam Preparation Courses If you don't want to read the book, the better option is to get started with online training resources. Here are the recommended online training resources for the CKA exam. | KodeKloud | [Certified Kubernetes Administrator (CKA) with Practice Tests](https://scriptcrunch.com/recommends/kk-cka/): This is one of the top-rated CKA preparation courses that comes with a browser-based practice test environment. \[Updated for latest exam syllabus\] | | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Linux Foundation | [Kubernetes Fundamentals (LFS258)](https://scriptcrunch.com/recommends/kubernetes-course/): A course by Linux Foundation. This course is specifically designed for [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/) preparation. You can save $100 if you buy this as a bundle during CKA exam registration. | | KillerCoda (2 Free Session With Exam Registration) | [CKA Interactive Practice Scenarios](https://killercoda.com/killer-shell-cka?ref=scriptcrunch.com) | | CKA Mock Exams | [Ultimate Certified Kubernetes Administrator (CKA) Mock Exam](https://scriptcrunch.com/recommends/kk-cka-mock-exam/) | ## CKA FAQ's ### 1\. How to pass the CKA exam easily? The easy way to pass the CKA is by following a CKA-focused online course with practice exams. ### 2.Is Kubernetes CKA certification worth it? Yes. Currently, CKA is the sought-after certification in the DevOps domain as it is a certification based on practical exams. #### 3.How much does a certified Kubernetes administrator exam cost? The Certified Kubernetes Administrator exam registration fee is $445. ### 4.How hard is the Certified Kubernetes Administrator (CKA) exam? The CKA exam is a hands-on practical exam. So practice plays a crucial role in this exam. With enough practice, you can easily pass this exam. #### 5.Which is easier? CKA or CKAD? The CKAD exam is comparatively easier than CKA as deals with cluster administration and troubleshooting. At the same time, CKAD is more focused on application deployments and troubleshooting. #### 6.Is there a CKA Voucher available for Black Friday? Yes. The Linux Foundation Black Friday deal includes the CKA certification voucher code. You could save up to $150 with this deal. #### 7.How to renew your CKA certification? If you want to renew the CKA certification, you need to retake the CKA exam before the expiry of the current certification. If you pass the exam, your CKA certification will be valid for another two years. #### 8.Is there a Voucher code available for the CKA exam? Yes. You can get the voucher code for the CKA exam from the [Linux Foundation coupon](https://scriptcrunch.com/linux-foundation-coupon/) page. You could save 25% on CKA exam registration using the coupon code **30COMTECHIES**. #### 9.Can I use an extended monitor during CKA exam? No. You must use a single monitor only. Multiple monitors are not permitted. If you want to use the extened monitor, you should close the other monitors and only one monitor should be active at a time with a camera enabled. ## Practice! Practice! Practice We have covered possibly all the best resources, cka study materials, and [guides](https://scriptcrunch.com/tag/guides/) you could use to pass the Certified Kubernetes Administrator (CKA) exam. However, CKA is a practical exam, and practicing the tasks is very important. I would highly recommend you create your list of related tasks under each category and practice it multiple times. You may start with an online course. Or with the kubernetes documentation. Either way, drop a comment below and let me know your thoughts on this guide. Also, check out the list of [best kubernetes tutorials](https://scriptcrunch.com/kubernetes-tutorial-guides/) to learn all the Kubernetes concepts. ## CKA Exam Experiences Let's look at some of the experiences shared by the people who aced the CKA Exam. [Suraj says](https://medium.com/illumination/my-cka-exam-experience-certified-kubernetes-administrator-9cdef19a2bb1?ref=scriptcrunch.com) you should release run through the mock exams 2-3 times. Also, look at the documentation extensively to help you during the exam. ![CKA exam experience](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-3-2.png) Manoj Reddy, give two key tips. 1. As we discussed, setting up the aliases helps to save time. 2. Setting up VIM shortcut to mitigate indentation issues. ![CKA VIM shortcuts](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-4-2.png) Here is an experience shared by a user who has got 93% in the CKA Exam. ![Passing CKA Exam with 93% score.](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-7.png) We have given all the detailed inforamation and resources for preparing for CKA exam. If you have any doubts, do let us know in the comment section. ### Horizontal Pod Autoscaler (HPA) - A Beginner's Guide URL: https://scriptcrunch.com/horizontal-pod-autoscaler/ Last updated: 2026-06-23T08:55:48.000Z [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) offers one of the most efficient autoscaling mechanisms through the **Horizontal Pod Autoscaler (HPA)**. HPA is also included in the [CKA](https://scriptcrunch.com/kubernetes-exam-guide/) exam. In this [guide](https://scriptcrunch.com/tag/guides/), we will explore how HPA works, how it calculates the desired number of replicas, and how to set it up step by step with a practical example using an [NGINX](https://scriptcrunch.com/deploy-nginx-kubernetes-ecr/) Deployment. ## What is Horizontal Pod Autoscaler? The **Horizontal Pod Autoscaler (HPA)** automatically scales the number of [Pods](https://scriptcrunch.com/managing-pods-in-kubernetes-using-labels-and-selectors/) in a Kubernetes workload (such as [Deployments](https://scriptcrunch.com/kubernetes-object-deployment/), StatefulSets, or [ReplicaSets](https://scriptcrunch.com/replicaset/)) based on observed metrics like CPU or memory usage. For example, if the target CPU utilization is set to **50%**, the HPA will add more Pods when usage goes above 50% and reduce Pods when it drops below that target. ## How Does HPA Work? The diagram below shows the workflow of the HPA. ![HPA WORKFLOW](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/12/image-2.png) To explain how this works, first we create an HPA object that targets a Deployment and specify the name of that Deployment. For example, we will use an `nginx-deployment`. We also define how many replicas the HPA can scale up to and how far it can scale down on CPU usage. The HPA controller monitors the metrics (via the **metrics-server**) for the targeted resource, such as a deployment. It compares the current resource usage with the target utilization and automatically adjusts the replica count. This check happens every **15 seconds**, and the controller waits around **5 minutes** before scaling down to avoid frequent scaling events. ## How Does HPA Calculate the Required Number of Replicas? The scaling decision is based on the following formula: ``` desiredReplicas = ceil(currentReplicas × currentMetricValue / desiredMetricValue) ``` **Example:** If there are 3 Pods with 80% CPU usage and the target is 50%,: ``` desiredReplicas = ceil(3 × 80 / 50) = ceil(4.8) = 5 pods ``` Here, **`ceil`** means “round up to the nearest whole number.” So, HPA will scale up the Pods until it reaches the `maxReplicas` value defined in the HPA configuration. ## Hands-on Example Let us understand this with a practical example. ### Step 1: Verify the metrics server First, verify that the metrics server is running in the cluster, because the HPA controller gets its metrics from there. Run the following command: ```bash kubectl top nodes ``` Output: ``` # kubectl top nodes NAME CPU(cores) CPU(%) MEMORY(bytes) MEMORY(%) controlplane 135m 6% 1406Mi 37% node01 44m 4% 720Mi 38% node02 72m 7% 915Mi 49% ``` Output of top command From this output, we can see the CPU and memory usage of our nodes. ### Step 2: Deploy NGINX Now, we will deploy the NGINX web server. Copy the following manifest and apply it to the cluster ```yaml cat < nginx-deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment spec: selector: matchLabels: app: nginx replicas: 2 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:latest ports: - containerPort: 80 resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "250m" memory: "256Mi" --- apiVersion: v1 kind: Service metadata: name: nginx-service spec: selector: app: nginx type: NodePort ports: - port: 80 targetPort: 80 nodePort: 32000 EOF ``` Run the following command: ``` kubectl apply -f nginx-deployment.yaml ``` Once it is deployed, verify that it is running Output: ``` # kubectl get po NAME READY STATUS RESTARTS AGE nginx-deployment-7554bc5d7b-d7xt9 1/1 Running 0 84s nginx-deployment-7554bc5d7b-m7qtj 1/1 Running 0 84s ``` This output shows that the NGINX web server is running successfully ### Step 3: Create an HPA for the NGINX web server Now,2 we will create a HorizontalPodAutoscaler that targets the NGINX Deployment. We want the Deployment to scale between **1 and 3 replicas** and maintain an average CPU utilization of **60%**. ```bash cat < **Note:** Cyber Monday deal is **through December 9th**. ## 2\. KodeKloud Black Friday Deal (50% Off) Get flat 50% discount on Kodekloud subscriptions. [GET 50% KodeKloud Discount](https://scriptcrunch.com/recommends/pluralsight-black-friday/) **Note:** Offer ends on December 5th. ## 3\. Pluralsight Black Friday Deal (50% Off) Pluralsight has all developer and sysadmins courses and certification training. It covers many categories in the IT domain. As far as the DevOps domain is concerned, it offers courses and certifications training on the cloud, [CI/CD](https://scriptcrunch.com/tag/ci-cd/), Automation, Containers, Kubernetes, etc. [Redeem 50% Pluralsight Black Friday Discount](https://scriptcrunch.com/recommends/pluralsight-black-friday/) **Note:** This is the biggest pluralsight discount ever. ## 4\. Udemy Black Friday Deal (Up To 96% Off) Udemy is a great place where you have many instructors teaching multiple technologies. You can choose a course based on the user reviews and the number of subscriptions. There are many DevOps courses to choose from well-known industry specialists on a variety of topics. > Normally Udemy courses are priced between $50 - $200\. With Black Friday offer, you can [get all the Udemy courses for 97% Off](https://scriptcrunch.com/recommends/udemy-offer/https://scriptcrunch.com/recommends/udemy-online-course/). This is a limited time offer. [Get 95%. Udemy Black Friday Discount](https://scriptcrunch.com/recommends/udemy-offer/) ## 5\. Datacamp Black Friday Deal (50% Off) Datacamp is one of the best portals to learn data science, data engineering, and machine learning-related technologies. For Black Friday, Datacamp is offering a 65% flat discount on its premium and team subscription plans. You could save more than $150 with this offer. [Get 65% Datacamp Black Friday Discount](https://scriptcrunch.com/recommends/datacamp-black-friday/) ## 6\. Udacity Black Friday & Cyber Monday Deal (50% Off) Udacity is an online platform that offers courses and nano degree programs in [development](https://scriptcrunch.com/tag/development/), project management, IT operations, data engineering, machine learning, IoT, and much more. Udacity is offering a huge 50% discount on all its programs as part of Black Friday. [Get 50% Udacity Black Friday Discount](https://devopscube.com/recommends/udacity-plans/?ref=scriptcrunch.com) **Coupon:** Use code **BLACKFRIDAY** at checkout for upfront payments ## 7\. Educative.io Black Friday Deal (50% Off) Educative has hands-on courses focussed on career development and interview preparation. The course contents are excellent and created with quality. You can give it a try for free, and if you wish to get the premium membership, you can make use of the Black Friday offer. Educative is offering 50% discount for this Black Friday [Redeem 40% Educative Black Friday Discount](https://devopscube.com/recommends/educative/?ref=scriptcrunch.com) ## 8\. Coursera Plus Cyber Monday Sale Get a 25% discount on a Coursera Plus subscription as part of the Coursera Cyber Monday Deal. You could save $100 using this deal. With a Plus subscription, you can get access to the best online degrees and certifications. [Redeem Coursera Cyber Monday Discount](https://scriptcrunch.com/recommends/coursera-cyber-monday/) ## 9\. The Blockchain Council Black Friday Deal (30% Discount) If you are a blockchain enthusiast and want to learn, develop, or pursue a blockchain career, the Blockchain Council is the right place to start. Blockchain Council offers a 25% discount on all its blockchain training courses and certifications for this Black Friday. [Get Blockchain Council Black Friday Deal](https://scriptcrunch.com/recommends/blockchain-council-offer/) **Coupon**: Use code **CAREER20** to save 20% sitewide or **WISDOM30** to save 30% on two or more certifications ## 10\. A Cloud Guru Black Friday Deal (50% Off) A Cloud Guru is a great place to learn about cloud and open-source technologies. It has many courses on cloud platforms, certifications, Configuration Management Tools, DevOps tools, containers, and Kubernetes. [Get a Cloud Guru Black Friday Deal](https://scriptcrunch.com/recommends/a-cloud-guru/) ## 11\. Skillshare Black Friday Deal With the skillshare black Friday deal, you can get a one-month Skillshare subscription totally free. You will be able to access all the courses from Skillshare for a month completely free. [Get Skillshare Black Friday Discount](https://scriptcrunch.com/recommends/skillshare-free/) Coupon: Use code **AFF50** at checkout. ## 12\. Whizlabs Black Friday Deal Get a 50% discount on Whizlabs standard, Premium, and premium plus subscriptions. Whizlabs, offers cloud certifications practice questions, courses, online labs, and 4500+ training videos on different latest technologies. [Get Whizlabs Black Friday Discount](undefined) ## 13\. DesignGurus Black Friday Deal DesignGurus platform for system designs and interview coding practice. This platform is best for tackling the system design, coding, and Behavioural round of interviews. The courses and mock interviews were crafted by FAANG Engineers, so they will really helpful for the aspirants. [Get DesignGurus Black Friday Discount](https://www.designgurus.io/?ref=scriptcrunch.com) ## 14\. AlgoMonster Black Friday Deal AlgoMaster is a platform for practicing coding to prepare for the coding interview round. They will help you master the patterns to solve coding interview problems. You will learn the top LeetCode patterns, binary search, backtracking template, and everything about dynamic programming. [Get AlgoMonster Black Friday Discount](https://algo.monster/?ref=scriptcrunch.com) ## 15\. Exponent Black Friday Deal (70% OFF) TryExponent is a tech online learning platform for those who are preparing for tech interviews. You will get access to courses, mock interviews, and the community. Exponent black friday deal is the best time to get a massive discount on its annual premium subscription. [Get Exponent 70% Black Friday Discount](https://fas.st/t/MJNP862x?ref=scriptcrunch.com) ## 16\. ByteByteGo Black Friday Deal (50% OFF) ByteByteGo is an online learning platform for cracking the system design interview. You will get access to coding interview patterns, system design interview, behavioral interview, object-oriented interview, machine learning design interview, mobile system design interview, and generative AI system design interview. [Get ByteByteGo 50% Black Friday Discount](https://bytebytego.com/?fpr=devopscube&ref=scriptcrunch.com) You will see two payment options: a one-time payment and a one-year access plan. Pick the one that matches your learning needs and how long you plan to use the course. ## Conclusion The best time for software engineers to purchase online subscriptions and software tools is during black Friday and Cyber Monday deals. You could save up to 65% on online platforms and tools. Make use of these deals and save as much as possible. ### How to Create Single-Container Pod and Multi-Container Pod on Kubernetes URL: https://scriptcrunch.com/single-container-pod-and-multi-container-pod/ Last updated: 2026-06-23T08:55:50.000Z Creating Pods is one of the most fundamental tasks in [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) and a core skill required for the Certified Kubernetes Administrator (CKA) exam. In this blog, we will discuss creating single-container Pods and multi-container Pods on Kubernetes. In the below example, we will see about creating pods and how to troubleshoot if any error occurs. ## Create Single-Container Pod First, we will see about creating a single-container pod, as the name suggests, we are going to deploy a single container on the pod. Run the following command to deploy a single container on the pod. ```bash kubectl run single-container --image nginx:latest ``` This command will deploy a single container of the latest nginx on the default namespace. You can check if the pod is deployed and running successfully using the command ```bash kubectl get pods ``` Output: ``` # kubectl get pods NAME READY STATUS RESTARTS AGE single-container 1/1 Running 0 6m45s ``` Pod is running status ## Create Multi-Container Pod A multi-container Pod runs multiple containers that share resources such as network and storage. This is commonly used for sidecar patterns (log collector, proxy, helper container). Next, we will see about creating a multi-container pod, as the name suggests, we are going to deploy multiple containers on the pod. For this we have to use a manifest file, we cannot create multiple containers using the command line. ### Step 1: Create a base manifest Run the following command to create a manifest file, which will have nginx image configurations in which we are going to add a log reader for nginx as a sidecar container. ```bash kubectl run multi-container --image nginx --dry-run=client -o yaml > manifest.yaml ``` ### Step 2: Edit the manifest to add a sidecar Open the manifest file and add the log reader as another container as given below ```yaml apiVersion: v1 kind: Pod metadata: name: multi-container spec: containers: - name: nginx image: nginx volumeMounts: - name: logs mountPath: /var/log/nginx - name: log-reader image: busybox command: ["sh", "-c", "while true; do sleep 30; done"] volumeMounts: - name: logs mountPath: /var/log/nginx volumes: - name: logs emptyDir: {} ``` ### Step 3: Apply the manifest Once you have modified the manifest file, use the below command to deploy both containers. ```bash kubectl apply -f manifest.yaml ``` This command will deploy the multiple container species on the manifest file on the default namespace as shown below ### Step 4: Check the Pod is running ```bash kubectl get pods ``` If everything is correct, the Pod should be in Running status. Output: ``` # kubectl get pods NAME READY STATUS RESTARTS AGE multi-container 2/2 Running 0 40s ``` This pod now runs both the main Nginx container and a sidecar log-reader container. ## TroubleShooting Pod When a Pod is not running correctly, or repeatedly restarts, Kubernetes provides two key describe and logs By using the describe command and logs command we can identify the issue and troubleshoot it easily. As an example, I am going to use the describe command on the single-container pod and the logs command on the multi-container pod. Run the following command to describe the single-container pod ```bash kubectl describe po single-container ``` You will get the following output: ``` # kubectl describe pod single-container Name: single-container Namespace: default Priority: 0 Service Account: default Node: node01/192.168.201.11 Start Time: Sun, 23 Nov 2025 17:56:50 +0000 Labels: run=single-container Annotations: cni.projectcalico.org/containerID: 6510ceeda05598cce119d64e541afd73a51148e57a76f1efc1694377d6d63a09 cni.projectcalico.org/podIP: 10.244.196.129/32 cni.projectcalico.org/podIPs: 10.244.196.129/32 Status: Running IP: 10.244.196.129 IPs: IP: 10.244.196.129 Containers: single-container: Container ID: cri-o://2c1ef0c3c28916150fcf1ff8d92866207e59155ba19b9b96c8ffa45d70dcbac3 Image: nginx:latest Image ID: docker.io/library/nginx@sha256:553f64aecdc31b5bf944521731cd70e35da4faed96b2b7548a3d8e2598c52a42 Port: Host Port: State: Running Started: Sun, 23 Nov 2025 17:56:55 +0000 Ready: True Restart Count: 0 Environment: Mounts: /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-g6655 (ro) Conditions: Type Status PodReadyToStartContainers True Initialized True Ready True ContainersReady True PodScheduled True Volumes: kube-api-access-g6655: Type: Projected (a volume that contains injected data from multiple sources) TokenExpirationSeconds: 3607 ConfigMapName: kube-root-ca.crt Optional: false DownwardAPI: true QoS Class: BestEffort Node-Selectors: Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s node.kubernetes.io/unreachable:NoExecute op=Exists for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 25s default-scheduler Successfully assigned default/single-container to node01 Normal Pulling 25s kubelet Pulling image "nginx:latest" Normal Pulled 20s kubelet Successfully pulled image "nginx:latest" in 4.484s (4.484s including waiting). Image size: 155491845 bytes. Normal Created 20s kubelet Created container: single-container Normal Started 20s kubelet Started container single-container ``` Single-container pod's describe If the pod has any errors, you can find them in the Events section at the bottom. Check the Events section for: - Image pull errors - Probe failures - CrashLoopBackOff - OOMKilled events - Volume mount issues **Check containers logs with `kubectl logs`** Now, let's use the **logs** command on the kubectl logs single-container multi-container pod, run the following command to get the logs ```bash kubectl logs single-container ``` Output: ``` root@controlplane:/home/vagrant# kubectl logs single-container /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2025/11/23 17:56:55 [notice] 1#1: using the "epoll" event method 2025/11/23 17:56:55 [notice] 1#1: nginx/1.29.3 2025/11/23 17:56:55 [notice] 1#1: built by gcc 14.2.0 (Debian 14.2.0-19) 2025/11/23 17:56:55 [notice] 1#1: OS: Linux 6.8.0-53-generic 2025/11/23 17:56:55 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2025/11/23 17:56:55 [notice] 1#1: start worker processes 2025/11/23 17:56:55 [notice] 1#1: start worker process 24 ``` Single-container pod's logs You can find the logs of the pod with timestamps, and logs provide valuable insight into application-level errors. Logs for a specific container in a multi-container Pod: ```bash kubectl logs multi-container -c log-reader ``` ### Enhance Troubleshooting Section Add these everyday things to help you troubleshoot more efficiently ```bash # Check previous container logs (for crashlooping pods) kubectl logs multi-container -c nginx --previous # Follow logs in real-time kubectl logs -f single-container # Get last N lines kubectl logs single-container --tail=50 # Check pod status in detail kubectl get pod single-container -o yaml # Interactive troubleshooting kubectl exec -it multi-container -c nginx -- bash ``` ## Conclusion In this [guide](https://scriptcrunch.com/tag/guides/), you explored how to deploy both single-container and multi-container Pods, use YAML manifests to define sidecar containers, and troubleshoot Pods using `kubectl describe` and `kubectl logs`. These capabilities are fundamental to Kubernetes administration and are highly relevant for the CKA exam. ### Kubernetes Authentication and Authorization URL: https://scriptcrunch.com/kubernetes-authentication-and-authorization/ Last updated: 2026-06-23T08:55:50.000Z Understanding authentication and authorization is essential for [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster security and is a core part of the Certified Kubernetes Administrator (CKA) exam. In this blog, we will discuss Kubernetes authentication and authorization. ## What Is Kubernetes Authentication? In Kubernetes, authentication is the process of verifying whether the user has permission to access the Kubernetes with API calls. Kubernetes does not keep user accounts itself. Instead, it depends on external identity providers and credentials. ### Supported Authentication Methods Common authentication mechanisms include: - Client certificates (X.509 certificates signed by the cluster CA) - Bearer tokens (bootstrap tokens, service account tokens) - OIDC (OpenID Connect) — widely used in production clusters - Webhook token authentication - Authentication proxies ### How Authentication Works - A user sends a request to the Kubernetes API server. - The API server verifies the request credentials using one or more configured auth modules. - If the credentials are valid, the API server identifies the user (username and groups). Authentication does not decide what the user can do; that is, authorization. ### The kubeconfig File Authentication commonly uses the `~/.kube/config` file, which stores: - Clusters (API server endpoints and certificate authority) - Users (client certificates, keys, tokens, or auth provider configs) - Contexts (cluster, user and namespace) An example **config** file is given below: ``` apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJQ2hsc0tvL2pkN1V3RFFZSktvWk server: https://192.168.201.10:6443 name: kubernetes contexts: - context: cluster: kubernetes user: kubernetes-admin name: kubernetes-admin@kubernetes current-context: kubernetes-admin@kubernetes kind: Config preferences: {} users: - name: kubernetes-admin user: client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLVENDQWhHZ0F3SUJBZ0lJR2FXWUV3eVhET293RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTU client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBcjAxSFUxcy9STU1UZzRtSHc4MlREdlBEa29jRWttV ``` kubeconfig File ## What Is Kubernetes Authorization? In Kubernetes, authorization is the process of verifying the actions that can performed by the user in the clsuter. ### Available Authorization Modes - RBAC (Role-Based Access Control) — default and recommended - Node authorization — for kubelet access - Webhook authorization — external policy engines (OPA Gatekeeper, Kyverno) By default, the user will not have permission to do any action on the cluster the cluster admin has to create a role and cluster role with required permissions and bind it to the user to perform every task. The user is only authorized to perform the actions specified in the role or cluster role. RBAC is the most common authorization mechanism in Kubernetes and is heavily tested in the CKA exam. If you want to understand it more clearly, [click the link.](https://scriptcrunch.com/clusterrole-and-rolebinding/) ### CKA Exam Tips Practice these scenarios: - Creating Roles and RoleBindings imperatively command using `kubectl create` - Using the `kubectl auth can-i` command to verify permissions. - Switching contexts using the command `kubectl config use-context`. - Understanding namespace scoped and cluster scoped resources. ## Conclusion In Kubernetes, Authentication and Authorization help you control the level of access granted to a user within the cluster. I hope this quick [guide](https://scriptcrunch.com/tag/guides/) helps you understand Authentication and Authorization . ### How to Create a ClusterRole and RoleBinding in Kubernetes URL: https://scriptcrunch.com/clusterrole-and-rolebinding/ Last updated: 2026-06-23T08:55:50.000Z Managing permissions in [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) is an essential step when preparing for the CKA exam. In this blog post, we will cover how to create a ServiceAccount, a ClusterRole, and bind them together using a RoleBinding. ## What Is RBAC in Kubernetes? Kubernetes uses Role-Based Access Control (RBAC) to define who can do what within the cluster. You typically work with four main RBAC objects: - Role – namespaced permissions - ClusterRole – cluster-wide permissions - RoleBinding – binds a Role/ClusterRole to a subject within one namespace - ClusterRoleBinding – binds a ClusterRole cluster-wide In this example, we will: - Create a ServiceAccount - Create a ClusterRole - Bind the ClusterRole to the ServiceAccount using a RoleBinding ## Step 1:Create ServiceAccount First, we are going to create a ServiceAccount on the default namespace, create a YAML file **sa.yaml**, and copy the below content to it ```yaml apiVersion: v1 kind: ServiceAccount metadata: name: cluster-service-account namespace: default ``` Run the following command to create the ServiceAccount. ```bash kubectl apply -f sa.yaml ``` This file creates a ServiceAccount **cluster-service-account** in the **default** namespace. ## Step 2:Create ClusterRole Define reusable permissions that can be applied cluster-wide or within specific namespaces, **clusterrole.yaml**, and copy the content ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-reader-role rules: - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["services"] verbs: ["get", "list"] ``` Run the following command to create a role ``` kubectl apply -f clusterrole.yaml ``` This ClusterRole grants read-only access to pods and services. Since these are namespaced resources, the RoleBinding will correctly restrict access to a specific namespace. ## Step 3: Bind the ClusterRole Using a RoleBinding A RoleBinding links a ClusterRole to a subject (ServiceAccount, User, or Group), but limits the permissions to the namespace where the RoleBinding exists. Create a YAML file **rolebinding.yaml** and copy the content below ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: read-pods-services namespace: default subjects: - kind: ServiceAccount name: cluster-service-account namespace: default roleRef: kind: ClusterRole name: pod-reader-role apiGroup: rbac.authorization.k8s.io ``` Run the following to bind the clusterrole to the serviceaccount ```bash kubectl apply -f rolebinding.yaml ``` The cluster service account can now access pods and services only within the default namespace. ## Step 4:Verify the Permissions Verify if the ServiceAccount has the proper permissions: ```bash kubectl auth can-i list pods \ --as=system:serviceaccount:default:cluster-service-account \ -n default ``` Output: ``` root@controlplane# kubectl auth can-i list pods \ --as=system:serviceaccount:default:cluster-service-account \ -n default yes ``` Check the different namespace: ```bash kubectl auth can-i list pods \ --as=system:serviceaccount:default:cluster-service-account \ -n kube-system ``` Output: ``` root@controlplane# kubectl auth can-i list pods \ --as=system:serviceaccount:default:cluster-service-account \ -n kube-system no ``` ## Conclusion In Kubernetes, with the help of ClusterRole, you can control the access given to a user on the cluster. I hope this quick [guide](https://scriptcrunch.com/tag/guides/) helps you to set up ClusterRole and bind the role to a serviceaccount. ### How to Create Jobs and CronJobs in Kubernetes? URL: https://scriptcrunch.com/create-jobs-and-cronjobs-on-kubernetes/ Last updated: 2026-06-23T08:55:51.000Z In this blog, we will see how to create Jobs and CronJobs on [Kubernetes](https://scriptcrunch.com/install-kubernetes/). Do you know what is Jobs and CronJobs on [Kubernetes](https://scriptcrunch.com/tag/kubernetes/)? If you don't know don't worry I will give you a quick review of Jobs and CronJobs in Kubernetes. ## What Are Kubernetes Jobs? Jobs are objects in [Kubernetes](https://scriptcrunch.com/kubernetes-authentication-and-authorization/) that deploy a pod, run tasks to completion, and then stop. They do not run continuously like other Kubernetes objects. **Use cases:** - One-time tasks - Batch data processing - [Database](https://scriptcrunch.com/tag/databases/) migrations - Cleanup operations First, here's a simple example of how to create Jobs on Kubernetes. ### Create Jobs To create a Job, first, create a manifest file **job.yaml** and copy the below content into it ```yaml apiVersion: batch/v1 kind: Job metadata: name: job spec: template: spec: containers: - name: container image: busybox command: ["echo", "Hello, Kubernetes!"] restartPolicy: Never ``` Run the following command to create a Job: ```bash kubectl apply -f job.yaml ``` This will create a Job in the default namespace that runs the echo command on the busybox [container](https://scriptcrunch.com/kubernetes-init-containers/) and then gets terminated. Check the Job: ```bash kubectl get jobs ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-14.png) Check the logs: ```bash kubectl get pods kubectl logs ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-15.png) ## What Are Kubernetes CronJobs? CronJobs are also a Kubernetes object that schedules tasks to run at specified times. The job will automatically start according to the schedule specified in the job. **Use cases:** - Backups - Log rotation - Cleanup jobs - Scheduled reports ### Create CronJobs Now, let's see how to create CronJobs on Kubernetes. To create a Job, first, create a manifest file **cronjob.yaml** and copy the below content into it ```yaml apiVersion: batch/v1 kind: CronJob metadata: name: cronjob spec: schedule: "*/1 * * * *" jobTemplate: spec: template: spec: containers: - name: container image: busybox command: ["echo", "Hello, Kubernetes!"] restartPolicy: Never ``` Run the following command to create a Job: ```bash kubectl apply -f cronjob.yaml ``` This will create a CronJob on the default namespace which schedules the command to run every 1 minute and print “Hello, Kubernetes!” Check CronJob activity: ```bash kubectl get cronjobs ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-16.png) ```bash kubectl get jobs ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-17.png) Check the logs: ```bash kubectl get pods kubectl logs ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-18.png) ### Important Fields for CKA These fields often appear in exam scenarios. **Jobs:** - `completions`: how many times the Job must run successfully - `parallelism`: how many Pods run at the same time - `backoffLimit`: retry count before marking the Job as failed **CronJobs:** - `suspend: true` to pause CronJobs - `concurrencyPolicy`: - `Allow` (default) - `Forbid` (do not run new Job if previous is still running) - `Replace` (kill old Job and run a new one) ## Conclusion In this blog, you have learned about how to create Jobs and CronJobs and how they run tasks on Kubernetes. I hope this blog gives a basic understanding of Kubernetes Jobs and CronJobs. ### How to Create a ReplicaSet in Kubernetes? URL: https://scriptcrunch.com/replicaset/ Last updated: 2025-11-19T10:54:31.000Z In this blog, we will walk through what a ReplicaSet is, why it is used, and how to create one using a YAML configuration. ## What is ReplicaSet? A ReplicaSet is an object on [Kubernetes](https://scriptcrunch.com/kubernetes-authentication-and-authorization/), which runs identical pods in the desired number. ReplicaSet is managed and controlled by the ReplicaSet controller, which maintains the desired number of replicas you specify. A ReplicaSet provides: - **High availability** — failed Pods are replaced automatically - **Scalability** — you can scale replicas up or down easily - **Self-healing** — Pods that crash are recreated Now, let's see about how to create ReplicaSet. ## How to create ReplicaSet? In this example, we are going to deploy three replicas of the [Nginx](https://scriptcrunch.com/deploy-nginx-kubernetes-ecr/), webserver using ReplicaSet, to do that, create a YAML file replicas.yaml and copy the content below into it ```YAML apiVersion: apps/v1 kind: ReplicaSet metadata: name: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:latest ``` This YAML file will deploy a ReplicaSet, and the ReplicaSet creates three replicas of the latest [Nginx](https://scriptcrunch.com/change-nginx-index-configmap/) web server on the default namespace. - **`replicas`**: It defines the desired number of pods. - `**selector**`: It is used to identify which pods the ReplicaSet should manage. `matchLabels` the `selector` field should be the same as the pod labels. - **`template`**: It has the pod template. The pod template defines the underlying Pod configuration. It acts as a blueprint for creating new Pods managed by the ReplicaSet. ### **Important Points (CKA Exam Relevant)** - The `selector.matchLabels` **must match** the labels inside the Pod template. - If labels do not match, the ReplicaSet will create Pods but never manage them correctly. ### **Apply the ReplicaSet** ```bash kubectl apply -f replicas.yaml ``` You can check the status of your ReplicaSet and replica pods using the following command To verify the ReplicaSet: ```bash kubectl get rs ``` To check the Pods created by the ReplicaSet: ```bash kubectl get pods -l app=nginx ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-11.png) To see more details: ```bash kubectl describe rs nginx ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-12.png) ### Scaling the ReplicaSet You can scale the number of replicas: ```bash kubectl scale rs nginx --replicas=5 ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-13.png) You can update the YAML file and reapply it. I used the command there. ## Conclusion I believe this blog gives you a decent understanding of ReplicaSet and how to deploy it. ### Managing Pods in Kubernetes Using Labels and Selectors URL: https://scriptcrunch.com/managing-pods-in-kubernetes-using-labels-and-selectors/ Last updated: 2026-06-23T08:55:51.000Z In this blog, we will explore [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) Labels and Selectors, how they are used to manage pods in Kubernetes, and practical examples using Labels and Selectors. ## What are Labels on Kubernetes? As the name says, Labels are identifiers that are attached to objects in [Kubernetes](https://scriptcrunch.com/kubernetes-authentication-and-authorization/) such as pods, services, etc. Labels are key/value pairs, we assign each object with multiple labels. Unlike a unique name given to an object, multiple objects can have the same labels which will be useful in grouping them. For example: ```yaml labels: : app: webserver environment: production tier: frontend ``` Labels are not set by [Kubernetes](https://scriptcrunch.com/kubernetes-configuration/) as default, the user who creates the object will be assigning Labels to each object. ## What are Selectors on Kubernetes? As the name says, Selectors are used to select objects based on their Labels. Since multiple objects can have the same label we can select all the objects with the same Label by the Selectors. There are two types of Selectors **Equality-based** and **Set-based**. ### Equality-Based Selectors Selectors select objects with the same label you specified in key-value pair. For example, if you specify the key-value pair as **app=webserver**, equality-based selectors only select objects with webserver labels. ```bash kubectl get pods -l app=webserver ``` ### Set-Based Selectors Selectors select objects if they have any one of the labels you specified in the set. For example, assume you have specified the set as **environment in (production, staging)**, if the objects have either one of the labels' production or storage it will be selected. ```bash kubectl get pods -l 'environment in (production, staging)' ``` > **Note:** Set-based selectors are commonly used in advanced setups such as NetworkPolicies, ResourceQuotas, and affinity rules. ### Creating pods with Labels First, let's see about creating Pods with Labels. In this example, we are going to create two pods with Labels using the following commands ```bash k run frontend \ --image=nginx \ -l name=nginx,env=prod,tier=frontend,component=webserver k run backend \ --image=nginx \ -l name=java,env=prod,tier=backend,component=appserver ``` Once you created the Pods using the command, run the following command to check the Labels ```bash k get po --show-labels ``` You will get the following output ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-7.png) Now, let's how we can use Selectors to query using Labels. ### Querying Pods with Selectors To show how a Selector query uses Labels, I am going to get the Pod with the Label **component=appserver**. To find the Pod with the Labels **component=appserver**, run the following command ```bash k get po -l 'component in (appserver)' -L tier ``` You will get the following output ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-6.png) Next, let's see how to add Labels to a Pod. ### Adding, Modifying, and Deleting Labels **Add a New Label** Run the following command to add a new Label to the Pod ```bash k label po frontend version=1.0.1 ``` Now, check the Labels of the Pod you can see a new Label has been added to the Pod frontend as shown below ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-8.png) **Modify an Existing Label** If you want to modify the Labels, run the above command you used to add a Label with an **\--overwrite** flag as given below ```bash k label po frontend version=1.0.2 --overwrite ``` If you list the Pods now you can see the label has been altered as shown below ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-9.png) **Delete a Label** You can delete any Label by specifying the Label name with a hyphen at the end, if you want to delete a Label run the following command ```bash k label po frontend version- ``` If you check the labels the version Labels have been deleted from the Pod frontend ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-10.png) ### Why Labels and Selectors Matter for CKA Labels and Selectors are essential to nearly every [Kubernetes resource](https://scriptcrunch.com/kubernetes-tutorial-guides/) and are commonly tested on the Certified Kubernetes Administrator (CKA) exam. You will see them in: - Pod management and [troubleshooting](https://scriptcrunch.com/tag/troubleshooting/) - Service discovery and traffic routing - Deployments and ReplicaSets - Node selection (affinity/anti-affinity rules) ## Conclusion In this blog, you learned about Kubernetes Labels, Selectors, and how to use them. I believe this blog gives you a basic understanding of Kubernetes Labels and Selectors and how it works. This is very important for [CKA Certification exam](https://scriptcrunch.com/kubernetes-exam-guide/). If you are preparing for CKA certification, make use of [CKA coupon](https://scriptcrunch.com/linux-foundation-coupon/) to save up to 47% on certification registration. ### Kubernetes DaemonSets: A Complete Guide (CKA Focus) URL: https://scriptcrunch.com/kubernetes-deamonsets/ Last updated: 2026-06-23T08:55:52.000Z DaemonSet is a very important topic in [CKA certification](https://scriptcrunch.com/kubernetes-exam-guide/). In this blog, we will learn about a basic understanding of [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) DaemonSets and how to create DaemonSets on Kubernetes. ## What is DaemonSets? DaemonSet is an object of Kubernetes, which is deployed in every cluster node. When a pod is deployed as a DaemonSet, the pod deploys a copy of it in every available node in the cluster. Also, you cannot increase the number of DaemonSet Pods on a single node since only one can run there. However, if a DaemonSet Pod is removed from a node, the DaemonSet controller will detect the change and create a new Pod to replace it. ### Common Use Cases Some typical examples of DaemonSets include: - **kube-proxy:** manages network rules on each node. - **Cluster Monitoring:** tracks node metrics similar to [Prometheus](https://scriptcrunch.com/tag/prometheus/) Node Exporter. - **logging agents:** like Fluentd, Filebeat, or Logstash. - **CNI plugins:** such as Calico etc. You can list the available DaemonSets in your cluster using the following command ```bash kubectl get daemonset -A ``` This command will list the available DaemonSets on all namespaces as shown below ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-2.png) And if you want to list the nodes the DaemonSet pod is running on, run the following command ```bash kubectl get pods -l k8s-app=kube-proxy -o wide -n kube-system ``` This command will list the nodes in which the DaemonSet pod kube-proxy is running as shown below ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-3.png) ## How to Create DaemonSet Let’s create a simple DaemonSet that deploys an NGINX container on every node ### Step 1: Create a manifest file First, create a manifest file named daemonset.yaml and copy the content provided below: ```yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: nginx-daemonset labels: app: nginx spec: selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx-container image: nginx:latest ``` This file will deploy a DaemonSet of Nginx on the default namespace on all available nodes. ### Step 2: Apply the DaemonSet Run the following command to deploy the DaemonSet: ``` kubectl apply -f daemonset.yaml ``` ### Step 3: Verify the Deployment Once it is deployed you can verify if it's deployed as DaemonSet using the command: ```bash kubectl get daemonsets kubectl get po -o wide ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-4.png) ### Cleaning Up To delete the DaemonSet and all its Pods: ```bash kubectl delete daemonset nginx-daemonset ``` > **Important Notes for the CKA Exam** > DaemonSets run **one Pod per node** by default. When a node joins, the DaemonSet automatically deploys the Pod there. When a node leaves, its DaemonSet Pod is automatically removed. ## Conclusion In summary, we have learned about DaemonSets and how to create one. I believe this blog gives you a basic understanding of DaemonSets. ### Kubernetes Init Containers (Explained) URL: https://scriptcrunch.com/kubernetes-init-containers/ Last updated: 2026-06-23T08:55:52.000Z In this blog, we will gain a basic understanding of [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) Init Containers and learn how to create one on [Kubernetes](https://scriptcrunch.com/replicaset/). ## What is Init Containers? Init containers are containers that start and run before the main container of the pod starts running. Init containers run tasks that are required for the main container to run. For example, if you have a Java application running in a pod, the purpose of the init containers is to set up the pod for the application to run like configuring the required dependencies for the Java application. For more clarification, imagine you bought an unfurnished apartment before moving into the apartment. Your initial task is to clean the apartment and set up furniture. Just like how you won't move into your apartment without cleaning or installing the furniture, the main container wouldn't be able to run the application without the proper environment set by init containers. ## How to Create Init Containers First, create a manifest file init.yaml and copy the content given below ```bash apiVersion: v1 kind: Pod metadata: name: nginx labels: app: nginx spec: initContainers: - name: init-container image: busybox command: ['sh', '-c', 'echo "Simple Init Container Example" > /nginx-init/index.html'] volumeMounts: - name: nginx-config mountPath: /nginx-init containers: - name: main-container image: nginx:latest ports: - containerPort: 80 volumeMounts: - name: nginx-config mountPath: /usr/share/nginx/html volumes: - name: nginx-config emptyDir: {} --- apiVersion: v1 kind: Service metadata: name: nginx-service spec: type: NodePort selector: app: nginx ports: - port: 80 targetPort: 80 nodePort: 30080 ``` This file creates a pod [nginx](https://scriptcrunch.com/deploy-nginx-kubernetes-ecr/) in the default namespace. Once the pod has been created the init container echos the command to the **index.html** file. When the init container completes its task, the main container which has the [nginx](https://scriptcrunch.com/change-nginx-index-configmap/) web server image runs the **Nginx web server** with the file **index.html** and shows the content on its web page. Run the following command to deploy the pod ```bash kubectl apply -f init.yaml ``` Once you run the command, you can see the pod runs the init container first and then runs the Nginx container as shown below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image.png) Now the nginx pod is running. Verify that the pod uses the customized index.html file by using Node’s IP address. Open a web browser and navigate to: ```bash http://:30080 ``` Replace with the IP address of your Kubernetes node (or control plane) where the service is exposed. You will get the following output on :30080> ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-1.png) ## Conclusion In summary, we have learned about init containers and how to create one. I believe this blog gives you a basic understanding of init containers. ### How to Upgrade the Kubernetes Kubeadm Cluster? URL: https://scriptcrunch.com/upgrade-kubernetes-kubeadm-cluster/ Last updated: 2026-06-23T08:55:52.000Z In this blog, we are going to see how to upgrade the [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) [Kubeadm Cluster](https://scriptcrunch.com/create-static-pod-on-the-kubeadm-cluster/) to version 1.33.1. The first control plane is upgraded to kubeadm and its control plane components (kubelet, kubectl). Then. worker nodes are upgraded to kubeadm and kubelet. ## Step to upgrade the Control Plane Switch to the root user and run the commands in the steps below to upgrade the control plane. ### Step 1: Check the Kubeadm new version To check a new version, you need to verify the package for the version. Use the command below to package. ```bash apt-get update -y apt-mark unhold kubeadm apt-cache madison kubeadm | tac ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-8.png) You can view the new kubeadm version. ### Step 2: Install the new version Run the below command to install the new version of [kubeadm](https://scriptcrunch.com/solved-vagrant-kubeadm-cluster-crashes-on-reboot/), ```bash sudo apt-get install -y kubeadm=1.33.5-1.1 ``` Verify if the new version of Kubeadm is installed using the command ```bash kubeadm version -o json ``` You will get the kubeadm version details in the following output, and you can see that version **1.33.5 has been** installed. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-9.png) ### Step 3: Upgrade Components of Control-Plane Once the new version of kubeadm is installed, run the command below to view the control-plane component upgrade plan ```bash kubeadm upgrade plan ``` It will show the current version of the components and the version it going to upgrade, to upgrade the components of the control node to the new version ```bash kubeadm upgrade apply v1.33.5 ``` Now we will hold the kubeadm package to prevent upgrades. ```bash apt-mark hold kubeadm ``` ### Step 4: Upgrade Kubelet and Kubeclt Now, all the components of the control plane have been upgraded to the new version. Drain the control plane using the command provided below to ```bash kubectl drain controlplane --ignore-daemonsets ``` Then, use the below command to upgrade kubelet and kubeclt to the new version ```bash apt-mark unhold kubelet kubectl apt-get update -y apt-get install kubelet=1.33.5-1.1 kubectl=1.33.5-1.1 apt-mark hold kubelet kubectl ``` Restart the service to make the changes ```bash systemctl daemon-reload systemctl restart kubelet ``` Now, everything has been upgraded, uncordon the master node and check the nodes ```bash kubectl uncordon controlplane ``` To verify the node, use the command ```bash kubectl get nodes ``` You can see the control plane is upgraded to version **1.33.5**. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-10.png) ## Steps to upgrade Worker Node Upgrading the worker node is similar to upgrading the control plane, switch to the root user and run the commands in the steps below to upgrade the control plane. ### Step 1:Check the Kubeadm new version To check the new version, you need to verify the package's version. Use the command below to package. same as controlplane ```bash apt-get update -y apt-mark unhold kubeadm apt-cache madison kubeadm | tac ``` Use the command below to update the apt ```bash apt update ``` ### Step 2: Install the new version Run the below command to install the new version of kubeadm ```bash apt-get install -y kubeadm=1.33.5-1.1 apt-mark hold kubeadm ``` Now, run the command below to upgrade the kubelet configurations of the worker node ```bash kubeadm upgrade node ``` ### Step 3: Drain the worker Drain the worker plane node using the node name and make it unschedulable. This command is used on the control plane: ```bash kubectl drain node01 --ignore-daemonsets ``` ### Step 4: Upgrade Kubelet Use the command below to upgrade kubelet to the new version ```bash apt-mark unhold kubelet apt-get install kubelet=1.33.5-1.1 apt-mark hold kubelet ``` Restart the service to make the changes ```bash systemctl daemon-reload systemctl restart kubelet ``` Uncordon the node so that `node01` can be scheduled. ```bash kubectl uncordon node01 ``` After upgrading the worker node run the following command from the master node to verify if the nodes are upgraded to the new version ```bash kubectl get nodes ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-12.png) You can see in the above image that the control-plane and worker have been upgraded to the new version **1.33.5** ## Conclusion In this blog, we learned about upgrading the [Kubernetes cluster](https://scriptcrunch.com/check-kubernetes-cluster-health-status/). I hope every step is easy to understand. ### How to Backup and Restore ETCD on the Kubeadm Cluster? URL: https://scriptcrunch.com/backup-and-restore-etcd-on-the-kubeadm-cluster/ Last updated: 2026-06-23T08:55:53.000Z In this blog, we will see how to backup and restore etcd on the kubeadm cluster. ## Backup ETCD on the Kubeadm Cluster First, let's see how to take backup of etcd, follow the below steps to backup etcd. To take a backup of etcd, you need etcdctl installed in your controller node. To install etcdct, run the command below ```bash sudo apt install etcd-client ``` Once you have installed etcdctl, run the command below to take a backup of etcd. ```bash ETCDCTL_API=3 etcdctl \ --endpoints= \ --cacert= \ --cert= \ --key= \ snapshot save ``` To get the locations of files specified in the above command, check the etcd manifest file, to view the etcd manifest file, use the command given below ```bash cat /etc/kubernetes/manifests/etcd.yaml ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-3.png) By using the file location from the above file, my command will be ```bash ETCDCTL_API=3 etcdctl \ --endpoints=https://192.168.201.10:2379 \ --cacert=/etc/kubernetes/pki/etcd/ca.crt \ --cert=/etc/kubernetes/pki/etcd/server.crt \ --key=/etc/kubernetes/pki/etcd/server.key snapshot save /opt/backup/etcd.db ``` **/optbackup/etcd.db** is the location where I specify to store the snapshot. By running the backup command, you will get the following output ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-6.png) Verify the snapshot using the command ```bsah ETCDCTL_API=3 etcdctl --write-out=table snapshot status /opt/backup/etcd.db ``` You will get the following output ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-7.png) ## How to Restore ETCD Backup on the Kubeadm Cluster? To restore the backup etcd snapshot run the following command ```bash ETCDCTL_API=3 etcdctl \ --data-dir /opt/etcd \ --endpoints=https://192.168.201.10:2379 \ --cacert=/etc/kubernetes/pki/etcd/ca.crt \ --cert=/etc/kubernetes/pki/etcd/server.crt \ --key=/etc/kubernetes/pki/etcd/server.key \ snapshot restore /opt/backupetcd.db ``` By running the restore command, you will get the following output ```bash {"level":"info","ts":1761794802.4402878,"caller":"snapshot/v3_snapshot.go:306","msg":"restoring snapshot","path":"/opt/backup/etcd.db","wal-dir":"/opt/etcd/member/wal","data-dir":"/opt/etcd","snap-dir":"/opt/etcd/member/snap"} {"level":"info","ts":1761794802.5332155,"caller":"mvcc/kvstore.go:388","msg":"restored last compact revision","meta-bucket-name":"meta","meta-bucket-name-key":"finishedCompactRev","restored-compact-revision":51334} {"level":"info","ts":1761794802.5497634,"caller":"membership/cluster.go:392","msg":"added member","cluster-id":"cdf818194e3a8c32","local-member-id":"0","added-peer-id":"8e9e05c52164694d","added-peer-peer-urls":["http://localhost:2380"]} {"level":"info","ts":1761794802.558573,"caller":"snapshot/v3_snapshot.go:326","msg":"restored snapshot","path":"/opt/backup/etcd.db","wal-dir":"/opt/etcd/member/wal","data-dir":"/opt/etcd","snap-dir":"/opt/etcd/member/snap"} root@controlplane:/home/vagrant# ``` You can also specify the data directory for restoring etcd using the `--data-dir` flag. **/opt/etcd** is the data directory where I am restoring etcd. To use the data restored from etcd correctly, we need to change the default path of its `volumeMounts` and `Volumes` ​​in the etcd.yaml file to the path of the backup. Modify `/etc/kubernetes/manifests/etcd.yaml` accordingly. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/10/image-2.png) Once you update the etcd configuration file, the [Kubernetes](https://scriptcrunch.com/managing-pods-in-kubernetes-using-labels-and-selectors/) static pod mechanism will detect the change and restart the etcd pod with the new configuration settings. ## Conclusion In summary, we have learned about how to take backup and restore on [Kubernetes](https://scriptcrunch.com/tag/kubernetes/). I believe this blog has given a decent understanding of taking backups and restoring on Kubernetes. ### How to Create Static Pod on the Kubeadm Cluster URL: https://scriptcrunch.com/create-static-pod-on-the-kubeadm-cluster/ Last updated: 2026-06-23T08:55:53.000Z In this example, I am going to show you how to create a static pod on the [Kubeadm cluster](https://scriptcrunch.com/upgrade-kubernetes-kubeadm-cluster/) for the [**nginx**](https://scriptcrunch.com/deploy-nginx-kubernetes-ecr/) web server. ## Step 1: Create a Manifest file First, we need to create a YAML manifest file for the [nginx](https://scriptcrunch.com/change-nginx-index-configmap/), static pod, to create the manifest file run the following command ```bash bashkubectl run nginx --image=nginx --dry-run=client -o yaml > nginx.yaml ``` This command will create a manifest file for nginx to run as a static pod. If you need to make any changes to the manifest file, use the command below ```bash vi nginx.yaml ``` A small portion of the nginx.yaml file is shown below. ![Create Static Pod on the Kubeadm Cluster: static pod yaml file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-9-2.png) ## Step 2: Validate the Manifest file The next step is to validate the manifest file, to validate we can use the Kubeval utility. That checks whether your [Kubernetes YAML](https://scriptcrunch.com/convert-helm-chart-kubernetes-yaml/) file is properly structured, formatted, and syntax correct, and conforms to the official[ API](https://scriptcrunch.com/make-api-call-with-python/) schema for a specific [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) version. If you don't have Kubeval installed in your system, run the following command to install it. ```bash wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz tar xf kubeval-linux-amd64.tar.gz sudo cp kubeval /usr/local/bin ``` To verify if Kubeval is installed properly, run the command below. ```bash kubeval --version ``` You will get the following output. ![Create Static Pod on the Kubeadm Cluster: verifying kubeval verison](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-10-1.png) Now, run the following command to validate the manifest file. ```bash kubeval nginx.yaml ``` You will get the following output if the manifest file is created according to the Kubernetes requirements. ![Create Static Pod on the Kubeadm Cluster: Validating manifest file using Kubeval](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-11-1.png) ## Step 3: Deploy the Nginx Static pod To deploy the static pod, you have to copy the **nginx.yam**l manifest to the static pod manifest location. **/etc/kubernetes/manifests/** is the location where every static pod manifest file is present. The manifest files in this directory are deployed by **Kubelet,** kubelet deploysthe static pod during the booting time and keeps it running without the involvement of **Controlplane**. Now, run the following command to move the nginx manifest file to the **/etc/kubernetes/manifests/** directory. ```bash sudo mv nginx.yaml /etc/kubernetes/manifests/ ``` ## Step 4: Verifying Static Pod Verify if your nginx pod has been deployed automatically without giving the apply command. Use the command below to check if the pod is up and running ```bash kubectl get po ``` Static pods cannot be deleted until the manifest file is removed from the **/etc/kubernetes/manifests/** directory. Even if you delete the static pod using the **delete pod** command, a new pod will be created within a minute. The only way to delete a static pod is to remove the static pod manifest file from the **/etc/kubernetes/manifests/** directory. ![Create Static Pod on the Kubeadm Cluster: Static pod testing commands](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-8-3.png) You can see in the above image, that the static pod cannot be deleted until the static pod manifest file is removed from the **/etc/kubernetes/manifests/** directory. ## Conclusion In summary, we learned about Kubernetes static pod, their manifest file location, and how it is created. I believe this blog gives you simple knowledge about Kubernetes Static Pods. ### How to Expose an Application in NodePort in a Kind Cluster URL: https://scriptcrunch.com/expose-nodeport-kind-cluster/ Last updated: 2026-06-23T08:55:54.000Z In this blog, we will explain how to expose an application using a **NodePort** service in a [Kind](https://kind.sigs.k8s.io/?ref=scriptcrunch.com) cluster. We will keep everything simple and easy to understand. ## What is NodePort? - A **NodePort** is a way to make your application reachable outside the [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster. - With NodePort, Kubernetes will open a port on every node in your cluster. - You can connect to your application by using the IP of your node and the **NodePort** port number. ## Why You Cannot Directly Access NodePort in Kind When running a regular Kubernetes cluster on VMs or physical machines, NodePorts are exposed directly on the node's network interface. But when you create a Kubernetes cluster using Kind, each Kubernetes node is actually **running inside a [Docker](https://scriptcrunch.com/tag/docker/) container**. By default, Docker containers have their own network, which is separate from your computer’s network. Even if you create a NodePort service, the port is only open inside the container’s network. Because of this separation, you cannot just open `localhost:` on your computer to reach the service. It will not work unless you do extra port mappings from the container to your host machine. **In short:** The NodePort is open in the Docker container’s internal network, not on your actual machine’s network. You need to map the container port to your machine’s port if you want to access it through `localhost`. ## Creating a Multi-Node Cluster with Port Mapping To fix the problem, you can explicitly tell Kind to map ports from the Docker containers to your computer’s network. This way, if Kubernetes picks a NodePort like `30000`, it will be tied to `localhost:30000` on your machine. You can map Node ports to 80 or 8080 as well. When you do this, you just need to make sure those ports are not already in use on your machine ### 1\. Create a Cluster Configuration File Create a file named `multi-node-cluster.yaml` (or any name you like) with the following content: ```yml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 name: kind-dev-cluster nodes: - role: control-plane extraPortMappings: - containerPort: 30000 hostPort: 30000 protocol: TCP - containerPort: 31000 hostPort: 31000 - containerPort: 80 hostPort: 80 protocol: TCP - containerPort: 8080 hostPort: 8080 protocol: TCP - role: worker - role: worker ``` - **name**: This is the name of your Kind cluster. - **extraPortMappings**: This tells Docker to map the container’s ports (NodePorts) to matching ports on your computer. In this example, ports `30000`, `31000`, and `80` inside the cluster will be accessible on `localhost:30000`, `localhost:31000`, and `localhost:80` respectively. ### 2\. Create the Kind Cluster Use this command to create your cluster: ```bash kind create cluster --config=multi-node-cluster.yaml ``` Kind will start multiple nodes (one control-plane node and four worker nodes) inside Docker containers, using the port mappings you specified. ### 3\. Verify the Cluster Check if your cluster is running: ```bash kubectl cluster-info --context kind-multi-node-cluster ``` You should see information about your new multi-node cluster. ## Deploying and Exposing a Sample Application Now that you have a cluster with port mappings, you can deploy any application and expose it using a NodePort. ### 1\. Deploy an Application (Nginx) ```bash kubectl create deployment my-nginx --image=nginx ``` ### 2\. Expose the Deployment as a NodePort ```bash kubectl expose deployment my-nginx --type=NodePort --port=80 ``` Run the following command to find out which NodePort was assigned: ```bash kubectl get services ``` Look at the **PORT(S)** column for `my-nginx`. It should look like `80:30000/TCP` (or maybe `31000` or `32000`, depending on which port was chosen). ### 3\. Access the Application If the service is using port `30000`, for example, open: ```bash http://localhost:30000 ``` You should see the Nginx welcome page. --- ## Summary 1. **Kind Runs in Containers** Each Kubernetes node in Kind is a Docker container, so you cannot directly access NodePorts from your computer’s network without extra port mappings. 2. **Use a Custom Kind Configuration** By adding `extraPortMappings` in your Kind configuration file, you map Docker container ports to your actual machine’s ports. 3. **Access via Localhost** After creating the Kind cluster with port mappings, you can reach NodePort services at `localhost:`. This setup makes it easy to create a local multi-node Kubernetes cluster for testing, [development](https://scriptcrunch.com/tag/development/), or learning—without needing extra hardware or a dedicated environment. You can use this setup as a lab to prepare for the [CKA certification](https://scriptcrunch.com/kubernetes-exam-guide/). Also, check out the [CKA coupon](https://scriptcrunch.com/linux-foundation-coupon/) for big discounts on certification registration. ### Understanding Docker ONBUILD Instructions: A Simple Guide with Real-World Examples URL: https://scriptcrunch.com/docker-onbuild-instruction/ Last updated: 2026-06-23T08:55:54.000Z If you have ever used [Docker](https://scriptcrunch.com/tag/docker/) to package your applications, you might already know about Dockerfiles. A Dockerfile is like a recipe that tells Docker how to build your container image. However, there is a special instruction called **ONBUILD** that can sometimes be confusing if you have never tried it before. In this blog, we will explain what **ONBUILD** is, how it works, and when you might want to use it in a real-world enterprise setting. ## What Is Docker ONBUILD? In simple terms, **ONBUILD** is an instruction you can put in a Dockerfile that tells Docker, “When another Dockerfile uses **this** image as its base, please run these extra steps.” It means you can create a Docker image that has certain triggers that only run in the *child* image’s build process. These triggers do **not** run when you build the parent image itself. They only run later, when someone else uses your image as a base for another Docker image. ## Why Is This Useful? 1. **Encapsulation**: You can package certain build steps so that everyone who uses your base image will get those steps automatically. 2. **Simplicity**: It makes your child Dockerfile simpler, since you do not have to repeat the same instructions again. 3. **Consistency**: If many teams in your company rely on a standard base image, you can use **ONBUILD** to make sure all of them run certain steps (like installing packages, adding default configurations, or setting environment variables) without manually writing those steps over and over. ## A Real-World Example Let’s say you are part of a large enterprise that has many teams building microservices. Your company’s security policy requires that each microservice must have certain security patches and environment variables configured. Instead of having each team remember to add these steps in their Dockerfiles, you can create a **base image** that uses **ONBUILD** to handle these tasks. Below is an example base Dockerfile named `Dockerfile.base`. It has steps to install some packages and set up default environment variables. We will also add **ONBUILD** instructions that copy and install application code **when** another Dockerfile builds on top of it. ```bash # Dockerfile.base FROM ubuntu:latest # Install necessary packages in the base image RUN apt-get update && apt-get install -y curl wget # Set up a default environment variable ENV APP_ENV=production # Prepare a build step that will copy source code from child projects # (This will happen only when the child Dockerfile uses this image as a base) ONBUILD COPY . /usr/src/app # Prepare a build step that will run an installation script ONBUILD RUN cd /usr/src/app && ./install.sh ``` In the snippet above, notice these key points: - We install packages **before** any ONBUILD steps. That means the base image is ready to [go](https://scriptcrunch.com/tag/go/), but it will not copy any application code or run `install.sh` right now. - The `ONBUILD COPY` and `ONBUILD RUN` instructions will only take effect later, when a child Dockerfile uses this base image. Now, let’s see what it looks like when your teams use this base image. ## The Child Dockerfile A developer in your company wants to build a microservice and decides to use the `myorg/base:latest` image (which was built from the `Dockerfile.base` above). Their Dockerfile might look like this: ```bash # Dockerfile FROM myorg/base:latest # Now, thanks to ONBUILD, the base image automatically runs the COPY and RUN steps # that were defined with ONBUILD in the base Dockerfile. # Additional steps for your microservice RUN echo "Extra steps for my microservice" && \ apt-get update && apt-get install -y nano ``` When the developer builds this Dockerfile, Docker will first pull the `myorg/base:latest` image. Then it will detect that there are **ONBUILD** instructions in that base image. This triggers the extra steps: 1. `COPY . /usr/src/app` 2. `RUN cd /usr/src/app && ./install.sh` Only after those steps have finished, Docker will run the child Dockerfile’s `RUN echo "Extra steps..."` step. This ensures your company’s default patches, environment variables, and scripts are always applied, without each developer having to remember them. ## Where It Can Be Used in Enterprises 1. **Standardizing Security**: If your company needs each Docker container to have security checks or scanning tools installed, you can put those steps in an ONBUILD base image. Everyone who uses that image will automatically inherit these security requirements. 2. **Internal Tooling**: Maybe your organization has a special CLI tool or library that must be included in all services. Instead of asking everyone to install it, you can just include it in the base image or trigger its installation using **ONBUILD** steps. 3. **Environment Setup**: You might have environment variables or config files required by all applications. By using **ONBUILD**, your teams can skip some repetitive steps. --- ## Things to Watch Out For While **ONBUILD** can be helpful, it is not always the best solution: - **Hard to Override**: Once you define an **ONBUILD** instruction, child images might not easily override it. Make sure this does not cause problems for teams with special requirements. - **Hidden Complexity**: If new developers are not familiar with **ONBUILD**, they might be surprised when extra steps run. Good documentation helps. - **Version Control**: If you change the **ONBUILD** steps in the base image, it affects all future builds that use that base image. Make sure you handle versioning carefully. --- ## Conclusion **ONBUILD** can be a powerful way to simplify Docker builds in an enterprise environment. It makes sure that crucial steps happen automatically whenever a child image builds on top of your base image. This can save time, reduce mistakes, and ensure consistency across multiple teams. However, use it wisely—if you are not careful, it can also introduce hidden steps that some developers might overlook. By understanding how **ONBUILD** works and planning your Docker build process carefully, you can keep your microservices secure, standardized, and easy to maintain across all teams in your organization. ### [65% OFF] Linux Foundation LFCA, LFCS & LFCT Exam Voucher Codes URL: https://scriptcrunch.com/lfca-lfcs-lfce-voucher-codes/ Last updated: 2026-06-23T08:55:54.000Z [Linux Foundation](https://scriptcrunch.com/linux-foundation-coupon/) has announced up to a **$284 discount on its** [**Linux**](https://scriptcrunch.com/tag/linux/) **certification programs** Linux Foundation Certified IT Associate (LFCA) and Linux Foundation Certified Administrator (LFCS) Exam. The deal doesn't stop with just the certifications. There are certification exams and course bundles you can use to save big on Linux certifications and training programs. Let's have a look at the offers. ## \[40% Discount\] LFCA, LFCS, LFCT Coupon (Learning Sale) Get a 40% discount on all the Linux certifications using the tech talent sale [Get LFCA,LFCS & LFCT Discount](https://scriptcrunch.com/recommends/linux-certifications/) **Coupon:** Use code **SCRIPT30** at checkout If you want the Essentials course, you could save 40% with the bundle. [GET LFCS BUNDLE](https://scriptcrunch.com/recommends/lf-promo/) **Coupon**: Use code **SCRIPT30** at checkout. **Note**: This offer expires soon, ## \[$348 OFF\] LFCA + KCNA Bundle Discount Get $284 off on the Linux Foundation Certified Administrator (LFCS) + KCAN exam bundle using our exclusive coupon code. [Get $348 Bundle Discount](https://scriptcrunch.com/recommends/lfca-kcna/) Coupon: Use **SCRIPT30** at checkout ## \[20% Discount\] Linux Festival Sale Get a 15% discount on all the Linux certification and training programs as part of an exclusive Linux [DevOps](https://scriptcrunch.com/tag/devops/) sale. [Get 20% on LFCA,LFCS & LFCE](https://scriptcrunch.com/recommends/linux-certifications/) **Coupon:** Use code **DCUBE30** at checkout This offer is applicable for LFCA, LFCS & LFCE exams as well as LFS201 & LFS211 training programs. ## \[$95 Discount\] For Linux Users \[Expired\] Get a 30% discount on all the Linux certification and training programs to celebrate 30 years of Linux. The offer is valid throughout 2021. [Get 30% on LFCA,LFCS & LFCE](https://scriptcrunch.com/recommends/linux-certifications/) **Coupon:** Use code **LINUX30** at checkout This offer is applicable for LFCA, LFCS & LFCE exams as well as LFS201 & LFS211 training programs. ## \[35% Discount\] For Linux Users \[Expired\] Get a 35% discount on all the Linux certification and training programs to celebrate 30 years of Linux. [Get 35% on LFCA,LFCS & LFCE](https://scriptcrunch.com/recommends/linux-certifications/) **Coupon:** Use code **NEWYEAR23** at checkout This offer is applicable for LFCA, LFCS & LFCE exams as well as LFS201 & LFS211 training programs. ## \[80% OFF\] IT Career Bundle The IT career bundle has a combination of two Linux certifications and a training program. 1. Linux Foundation Certified IT Associate (LFCA) Exam 2. Essentials of Linux System Administration Course 3. Linux Foundation Certified Administrator (LFCS) Exam You can save $550 on this IT career bundle. [Get 80% Off on IT Career Bundle](https://scriptcrunch.com/recommends/lfcs-promo/) Use Coupon: **ITCAREER** ## \[80% OFF\] IT Power Bundle - (Expired) IT power bundle is a combination of certifications and courses related to [DevOps](https://scriptcrunch.com/devops-tutorial-series/) and SRE. This bundle contains the following. 1. Linux Foundation Certified IT Associate (LFCA) 2. ExamEssentials of Linux System Administration Course 3. Linux Foundation Certified Administrator (LFCS) Exam 4. Linux Networking and Administration Course 5. Linux Foundation Certified Engineer (LFCE) Exam 6. Introduction to Open Source [Development](https://scriptcrunch.com/tag/development/), Git, and Linux Course 7. DevOps and SRE Fundamentals Course [Get 80% Off on IT Power Bundle](https://scriptcrunch.com/recommends/lfcs-promo/) Use Coupon: **ITPOWER** ## \[40% Discount\] LFCA, LFCS & LFCT \[Expired\] Get a 40% discount on all the Linux certification and training programs for a limited time. [Get 25% LFCA, LFCS & LFCT](https://scriptcrunch.com/recommends/linux-certifications/) Coupon: Use code **PRIME23** at checkout ## \[35% OFF \] LFCA & LFCS Coupon \[Expired\] Get a **35% or $110 discount** on the Linux Foundation Certified IT Associate (LFCA) & Linux Foundation Certified System Administrator (LFCS) exams using the exclusive Linux sale. [Get 35% LFCS & LFCA Discount](https://scriptcrunch.com/recommends/lfcs/) ## \[40% Discount\] Prime Day Sale \[Expired\] Get a 40% discount on all the Linux certification and training programs to celebrate 30 years of Linux. [Get 40% on LFCA,LFCS & LFCE](https://scriptcrunch.com/recommends/linux-certifications/) ## \[65% OFF\] LFCA & LFCS Cyber Monday Power Sale \[Expired\] **Get 65% off on the LFCA and LFCS bundle** using the Cyber Monday deal. The deal ends on 6th December. This is the biggest discount of the year. [Get 65% on LFCA & LFCS](https://scriptcrunch.com/recommends/lf-promo/) **Coupon:** Use code **CYBER24CCTECHIES** at checkout **Note**: This offer expires very soon. These c**yber Monday voucher codes** are valid for a limited time. To check the latest and other Linux foundation exclusive offers, check out our [Linux foundation coupons](https://scriptcrunch.com/linux-foundation-coupon/) page. ## List of LFCA, LFCS Exam Voucher Codes If you are looking for just the LFCA, LFCS & LFCS Exam Voucher Codes, you can use the following code to get the maximum discounts. | **Certification** | **Voucher Codes With Discount Percentage** | | ----------------- | ------------------------------------------ | | LFCA | ****SCRIPT20** | | LFCS | ****SCRIPT20** | | LFCT | **DCUBE20** | If you looking for [Kubernetes](https://scriptcrunch.com/tag/kubernetes/)\-based certification, check out this Linux foundation detailed [CKA exam guide](https://scriptcrunch.com/kubernetes-exam-guide/) If you are registering for the CKA exam, check out the [CKA coupon ](https://scriptcrunch.com/linux-foundation-coupon/)to save up to 65%. ### Python for DevOps: A Beginner's Guide URL: https://scriptcrunch.com/python-devops-tutorial-beginners/ Last updated: 2026-06-23T08:55:55.000Z One of the common questions aspiring [DevOps](https://scriptcrunch.com/tag/devops/) engineers ask is, do we need [**Python**](https://scriptcrunch.com/tag/python/) **for DevOps?** In this blog, we will explain to you why Python is essential in the DevOps world. Information Technology is not like it used to be before. Most sysadmin tasks are **automated** using tools and scripting languages, including configuration management tools like **Chef, Puppet,** [**Ansible**](https://scriptcrunch.com/tag/ansible/), etc., and scripting languages like shell scripting, python, Ruby, etc. Also, how people and teams work has changed drastically in recent years with philosophies such as [DevOps](https://devopscube.com/what-is-devops-what-does-it-really-mean/?ref=scriptcrunch.com) and methodologies like Agile. Unlike before, different teams have started working together, and there is more and more automation from application [development](https://scriptcrunch.com/tag/development/) to deployment. Tools like [**Vagrant**](https://scriptcrunch.com/tag/vagrant/)**,** [**Docker**](https://scriptcrunch.com/tag/docker/)**, and** [**Kubernetes**](https://scriptcrunch.com/tag/kubernetes/) made developers' lives easy by reducing the time to set up and test development environments. Cloud computing has drastically changed the way servers are provisioned. You don't need to wait days to get a server provisioned for your application deployment. With a few clicks, you will have your server ready for deployment. The process gets easier by writing automation scripts for server provisioning and configuration. One such example is the [AWS python boto library](https://aws.amazon.com/sdk-for-python/?ref=scriptcrunch.com). Using Boto SDK, you can automate [AWS](https://scriptcrunch.com/tag/aws/) server provisioning. ## What does Python have to do with DevOps? Gone are the days when DevOps engineers had to work with only [CI/CD](https://scriptcrunch.com/tag/ci-cd/) tools. Nowadays, companies want customized tooling and utilities to fit their CI/CD requirements. A simple example is a Python script to parse JSON to test a functionality in the CI/CD process. It has led to a shift where people are involved in infrastructure operations, and CI/CD is asked to write custom utilities and modules to improve automation, release, and monitoring. No company wants to babysit releases and pipelines. However, to develop custom utilities, you should know some level of programming, and the common language preferred in DevOps for such use cases is Python. Arguably [go](https://scriptcrunch.com/tag/%3Ca%20href=)/">Golang is also getting there because most of the modern DevOps tooling is built in Golang. Also, with more and more MLOPS projects, DevOps engineers have to work with ML engineers, data engineers, and data scientists. Python is a common language among all these teams. As a DevOps engineer, you will be responsible for writing small utility and ML pipeline scripts. So programming has become necessary for DevOps engineers, and Python is a great language. Also, the need for programming is well explained in this [comprehensive DevOps engineers guide](https://devopscube.com/become-devops-engineer/?ref=scriptcrunch.com). According to the latest [StackOverflow Developer Survey](https://survey.stackoverflow.co/2023/?ref=scriptcrunch.com), 49.28% of developers prefer Python for scripting. ![stackoverflow survey on Python](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-8.png) ## Why Python For DevOps is Important? Following are some of the main reasons why Python of DevOps is important 1. Python is one of the **best scripting languages**. The vast availability of Python libraries allows you to write scripts that can communicate with system internals, manipulate files and strings, manage networks, and so on. 2. Once you learn Python, you can write automation scripts in a well-structured way. Moreover, every [Linux](https://scriptcrunch.com/tag/linux/) system today comes bundled with Python. 3. Many DevOps teams use Python for building custom utilities, web apps for custom data visualization, and more. The main reason is that it's easy to learn, and you can develop utilities in days rather than months. 4. Besides, tools like **Ansible are purely written in Python**. You can develop custom Ansible modules for your automation tasks. Also, it is not limited to just Ansible; many tools written in Python let you create custom scripts to work with them better. 5. Most importantly, **during DevOps interviews**, you would be asked to solve programming or scripting challenges as part of the first round. Python is the best choice to clear those interview rounds. So, there are enough reasons why you should learn Python to automate manual tasks. ## Python Courses To Skill up in DevOps If you are completely new to Python, we suggest you go through a guided online course or a book to understand Python fundamentals. Following are the suggested courses to get started with Python for absolute beginners. These are guided courses with extensive coverage of Python concepts. 1. [Learn Python 3 from Scratch](https://scriptcrunch.com/recommends/educative-python-course/) 2. [Introduction to Python](https://scriptcrunch.com/recommends/datacamp-python/) 3. [Python Basics](https://scriptcrunch.com/recommends/python/) ## Python Scripting Tutorial for Beginners The first step to getting started with Python is to learn the basics that are needed for scripting. Here we are not going to cover Python for application development but for automation. In this knowledge base, we will cover a set of articles that will have necessary beginner [tutorials](https://scriptcrunch.com/tag/tutorials/) to get you started with Python scripting. Following is the list. Subscribe to our mailing list for updates on the following tutorials. 1. [How to run a Python Script](https://scriptcrunch.com/python-scripting-devops-automation/) 2. Python Basics and Flow Control 3. Python Functions 4. Lists, Dictionaries, and Structuring Data 5. String manipulation and Regular expressions 6. Working with Files 7. [Python Exception handling](https://skillslane.com/python-exception-handling-beginner-tutorial/?ref=scriptcrunch.com) 8. Debugging python scripts 9. Working with Linux system configuration. 10. Monitoring alerts using python 11. System health checks using python 12. Managing cron using Python. 13. Using Python Modules (Very Important concept to learn) ## Python Libraries for DevOps When it comes to automation using Python, there are many Python libraries that you can make use of. Following are the important Python devops libraries you should look at. 1. OS Module 2. Subprocess 3. JSON 4. urlib3 5. HTTP 6. Kubernetes Python Client 7. StatsD 8. GitPython 9. Requests 10. Scapy 11. pytest 12. Testinfra 13. Jinja2 14. PyYAML 15. Graypy 16. Paramiko 17. Fabric Following are the modules related to the three popular cloud providers. 1. **Boto3** \- For AWS services. 2. **google-cloud-python** \- For Google Cloud services. 3. **azure-sdk-for-python** \- For Microsoft Azure services. ## Python Scripts for Automation - DevOps Tasks To learn Python for DevOps automation, you need to do real-world Python automation tasks. Following is a list of real-world Python scripting use cases. Here are 50 Python real world DevOps tasks to make your learning better. 1. **Parse a JSON file**: Use `json` module to load and parse JSON data. 2. **Make an HTTP API call with a bearer token**: Use `requests` library to send authenticated API requests. 3. **Execute SQL statements on PostgreSQL**: Use `psycopg2` to connect to PostgreSQL and run queries. 4. **Create an** [**EC2**](https://scriptcrunch.com/tag/ec2/) **instance using Python boto3**: Use `boto3` to interact with AWS and launch EC2 instances. 5. **Parse an IP address**: Use `ipaddress` module to validate and manipulate IP addresses. 6. **Segregate IP addresses from a CIDR range**: Use `ipaddress` to manage IP ranges and extract addresses. 7. **Retrieve Linux system details**: Use `psutil` to get CPU, memory, disk space, and process information. 8. **Execute a shell script from Python**: Use `subprocess` to run shell commands and scripts. 9. **Install Nginx in Linux using Python**: Automate Nginx installation with `subprocess` or `os` module. 10. **Replace a string in a configuration file**: Use `fileinput` and `re` to search and replace text. 11. **Retrieve AWS EMR master IP address**: Use `boto3` to get details of EMR clusters and extract the master node IP. 12. **List all Kubernetes pods in a namespace**: Use `kubernetes` library to interact with the cluster and list pods. 13. **Automate Docker container management**: Use `docker` library to create, start, and stop containers. 14. **Monitor system logs**: Read and analyze log files using `logging` module or external libraries. 15. **Manage AWS S3 buckets and objects**: Use `boto3` for creating, listing, and deleting S3 buckets and objects. 16. **Automate software installation and updates**: Use scripts to automate package installation and updates. 17. **Schedule cron jobs using Python**: Use `croniter` and `os` to create and manage cron jobs. 18. **Integrate with CI/CD pipelines**: Use libraries to interact with CI/CD tools like [Jenkins](https://scriptcrunch.com/tag/jenkins/) or GitLab. 19. **Generate and send email notifications**: Use `smtplib` to send emails based on specific events. 20. **Implement basic network monitoring**: Use `psutil` or external libraries to monitor network interfaces and traffic. 21. **Manage** [**SSH**](https://scriptcrunch.com/ssh-concept/) **connections and execute remote commands**: Use `paramiko` to manage SSH sessions. 22. **Create and manage virtual machines**: Use libraries to interact with virtualization platforms like VMware or VirtualBox. 23. **Automate backup and restore processes**: Write scripts to back up data to secure locations and restore it when needed. 24. **Monitor application performance metrics**: Use libraries to collect and analyze application performance data. 25. **Implement configuration management**: Use tools like Ansible and integrate them with Python scripts. 26. **Automate cloud resource provisioning**: Use cloud SDKs to automate the setup of cloud resources. 27. **Deploy applications to Kubernetes**: Use the Kubernetes API to automate application deployments. 28. **Manage** [**DNS records**](https://scriptcrunch.com/dns-records-explained-for-beginners/): Use libraries to interact with DNS providers and manage records. 29. **Automate firewall configurations**: Write scripts to configure firewalls on servers or cloud providers. 30. **Create custom monitoring dashboards**: Use libraries like `matplotlib` or `plotly` to visualize data. 31. **Automate TLS/SSL certificate renewal**: Use `certbot` to manage and renew certificates from Let's Encrypt. 32. **Perform automated** [**database**](https://scriptcrunch.com/tag/databases/) **backups**: Write scripts to regularly back up [databases](https://scriptcrunch.com/tag/databases/) and store them securely. 33. **Implement log rotation**: Use tools like `logrotate` and automate it with scripts. 34. **Monitor and scale cloud infrastructure**: Write scripts to monitor resource usage and scale cloud resources as needed. 35. **Manage Kubernetes secrets**: Use the Kubernetes API to securely manage sensitive data. 36. **Automate infrastructure testing**: Use testing libraries to validate infrastructure configurations and deployments. 37. **Parse and analyze logs for error patterns**: Write scripts to read log files and identify common error patterns. 38. **Monitor website uptime and response times**: Use libraries to periodically check website status and notify on issues. 39. **Implement blue-green deployment strategies**: Automate the deployment process to ensure zero downtime. 40. **Set up a Python-based alerting system**: Use libraries to monitor systems and send alerts based on specific conditions. 41. **Automate code linting and formatting**: Integrate tools like `flake8` or `black` to maintain code quality. 42. **Manage IAM roles and policies in AWS**: Use `boto3` to handle AWS IAM roles and permissions. 43. **Implement security scanning for containers**: Use tools to scan container images for vulnerabilities. 44. **Automate incident response**: Write scripts to automate response actions based on monitoring alerts. 45. **Generate and manage SSH key pairs**: Use libraries to create and distribute SSH keys securely. 46. **Create custom AWS CloudFormation stacks**: Use `boto3` to automate the creation and management of CloudFormation stacks. 47. **Manage Redis or Memcached instances**: Use libraries to connect to and manage these caching systems. 48. **Implement a webhook listener for GitHub events**: Use frameworks to create webhooks and handle GitHub events. 49. **Automate health checks for services**: Write scripts to perform periodic health checks on services and applications. 50. **Create a self-healing infrastructure setup**: Use monitoring and automation tools to detect and fix infrastructure issues automatically. The list will grow with more examples. ## Learn Python By Building Web Apps The best way for **DevOps engineers to learn Python** is by building applications. So how to get started? You can start with a simple **Python micro-framework like Flask** to understand how web applications work. While building an application, you will learn about the front end ( UI ), backend ( middleware/ database connectivity, etc.), and some aspects of development that are helpful for devops engineers in their journey towards becoming one! It might seem overwhelming initially, but once you finish the [tutorial](https://scriptcrunch.com/tag/tutorials/), you will gain some confidence in developing apps. Following are some of the resources to get started. 1. [Python Flask tutorial: Build your first Flask application](https://scriptcrunch.com/recommends/python-flask-blog/). 2. [Flask: Develop Web Applications in Python](https://scriptcrunch.com/recommends/flask-development/) 3. [Learn the Flask Python Web Development Framework by Building an Ecommerce Platform](https://www.freecodecamp.org/news/learn-the-flask-python-web-framework-by-building-a-market-platform/?ref=scriptcrunch.com) ## Python Alternative for DevOps One of the best alternatives for Python in DevOps is [Golang](https://go.dev/?ref=scriptcrunch.com). Most of the DevOps tools today are built using Golang. For example, Kubernetes, Terraform, and Docker are built using Golang. Companies that build internal developer portals choose Golang for most of the tooling. Because the existing DevOps tools written in Golang can be easily extended for customization. ## Conclusion This [guide](https://scriptcrunch.com/tag/guides/) covered why using Python for DevOps is essential for a DevOps engineer. The best way to start your DevOps journey is by learning to develop applications. If you know Python basics, you can start with a framework like a Python flask to understand the application workflow. Also, If you are a DevOps engineer and interested in [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/), check out our comprehensive [certified Kubernetes administrator exam guide.](https://scriptcrunch.com/kubernetes-exam-guide/) ### How to Create Kubernetes Deployment URL: https://scriptcrunch.com/kubernetes-object-deployment/ Last updated: 2026-06-23T08:55:55.000Z In this blog, we will explore [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) object Deployment and how to deploy applications using both imperative and declarative methods. ## What is Deployment in Kubernetes? Deployment is an object of Kubernetes that manages rollout and lifecyle of applications pod with the help of replicasets, it helps you to configure and deploy applications as you desire. ### We can create the deployment in two ways You can create a Kubernetes deployment in two main ways: 1. **Imperative method -** Using direct `kubectl` commands 2. **Declarative method-** Using a `YAML` manifest file ## Imperative Method This method uses the **kubectl** commands directly to create a deployment. For example, lets create a deployment **nginx** using the **latest** **nginx** image with two replicas, the command from the deployment is given below ```bash kubectl create deploy nginx --image=nginx:latest --replicas=2 ``` If you don't specify the `--replicas` flag, it will create a single pod as default. You can check the status of deployment using the following command ```bash kubectl get deploy ``` ![Kubernetes Object Deployment: Checking the status of deployment](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-23.png) And, you can see the number of pods running using the following command ```bash kubectl get po ``` ![Kubernetes Object Deployment: checking number of pods on deployment](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-18.png) ## Declarative Method This method uses a YAML file to create a deployment. This method is important for the CKA exam. The basic required file that should be in the YAML file is given below 1. **apiVerison** \- Here you have to specify the API version 2. **kind** \- Here you specify the object type, in our case it's deployment. 3. **metadata** \- Here we specify the name of the deployment and the namespace in which it needs to be deployed, if we don't specify the namespace it will deploy the application on the default namespace. 4. **spec** \- Here you have to specify the field in which you desire your application to deploy, such as replicas, selectors, and templates. 5. **replicas** \- Here you have to specify the number of pods you need, if not specified it will deploy one pod as default. 6. **selector** \- Here you have to give a label for the pod for identification. 7. **template** \- Here you have to specify the container image, volumes for the pod, etc. First, create a YAML file using the following dry run command ```bash kubectl create deploy nginx --image=nginx --replicas=3 --dry-run=client -o yaml > nginx.yaml ``` This command created a YAML file for deployment **nginx** using the **latest** **nginx** image with three replica as shown below ![Kubernetes Object Deployment: deployment YAML file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-21.png) Run the following command to deploy it ```bash kubectl apply -f nginx.yaml ``` List the pods using the following command ```bash Kubectl get po ``` You can see three nginx pods running as given below ![Kubernetes Object Deployment: Checking pods of deployment](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-22.png) ## Conclusion These are the two methods to create a deployment in kubenetes, I belive this blog give you a decent understanding about Kubernetes Deployment. ### How to Create ServiceAccount, Role, and RoleBinding in Kubernetes URL: https://scriptcrunch.com/serviceaccount-role-and-rolebinding/ Last updated: 2026-06-23T08:55:56.000Z In this blog, we are going to see how to create a serviceaccount, role, and rolebinding in [Kubernetes](https://scriptcrunch.com/tag/kubernetes/). ## Create ServiceAccount First, we are going to create a ServiceAccount on the default namespace, create a YAML file **serviceaccount.yaml**, and copy the below content to it ``` apiVersion: v1 kind: ServiceAccount metadata: name: kube-service-account namespace: default ``` Run the following command to create the ServiceAccount ``` kubectl apply -f serviceaccount.yaml ``` This file will create a ServiceAccount **kube-service-account** on the **default** namespace. ## Create Role Now, create a Role to attach it to the ServiceAccount, create a YAML file **role.yaml**, and copy the below content ``` apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: kube-role namespace: default rules: - apiGroups: [""] resources: ["pods"] verbs: ["get", "list"] ``` Run the following command to create a role ``` kubectl apply -f role.yaml ``` This file will create a role **kube-role** on the **default** namespace ## Create RoleBinding Now, that the ServiceAccount and Role have been created, the next step is to bind the Role to the ServiceAccount. Create a YAML file **rolebinding.yaml** and copy the below content ``` apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: kube-role-binding subjects: - kind: ServiceAccount name: kube-service-account namespace: default roleRef: kind: Role name: kube-role apiGroup: rbac.authorization.k8s.io ``` Run the following to bind the role to the serviceaccount ``` kubectl apply -f rolebinding.yaml ``` This will bind the role **kube-role** to the serviceaccount **kube-service-account** Now, check the ServiceAccount by listing the pod and configmap using the serviceaccount. Run the following command to list pod ``` kubectl get po --as=system:serviceaccount:default:kube-service-account ``` The ServiceAccount only has permission to list pod, it cannot list configmap or any other resources, let's see what happens when we list pod and configmap. ![ServiceAccount, Role, and RoleBinding: Testing serviceaccount permissions](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-8-2.png) As you can see in the above image, I am able to list pods using ServiceAccount and when I try to list configmap it says the serviceaccount does not have permission to list configmaps. ### Kubernetes Configuration Files and their Locations URL: https://scriptcrunch.com/kubernetes-configuration/ Last updated: 2026-06-23T08:55:56.000Z In this blog, we will see about [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) configuration files and their location. ## API Server API Server is a component of Kubernetes that acts as a central hub to manage the communication between other Kubernetes components. API Server is responsible for the authentication and authorization of API calls, it has the location of the key and certificate of every component, thus it validates the API calls. API Server runs as a static pod and you can find its manifest file **kube-apiserver.yaml** under **/etc/kubernetes/manifests** directory. A small portion of the **API Servers** manifest file is given below. ![Kubernetes Configuration : api serve manifest file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-16.png) ## Controller Manager Controller Manager is a component of Kubernetes that controls and manages various controllers that control resources of Kubernetes such as statefulset, replicas, daemonset, etc. Controller Manager runs as a static pod and you can find its manifest file **kube-controller-manager.yaml** in the **/etc/kubernetes/manifests** directory. A small portion of the **Controller Manager** manifest file is given below. ![Kubernetes Configuration: controller manager manifest file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-1-4.png) You can find the configuration file of Controller Manager on the directory **/etc/kubernetes** as **controller-manager.conf**. A sample ****controller-manager.conf** file is given below ![Kubernetes Configuration: controller manager configuration file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-6-2.png) ## ETCD ETCD is a component of Kubernetes that is used as a disturbed key-value store in Kubernetes. ETCD has a crucial role in Kubernetes, it stores every key and certificate of every component of Kubernetes. You can find its manifest file **etcd.yaml** in the /etc/kubernetes/manifests directory. A small portion of the **ETCD** manifest file is given below. ![Kubernetes Configuration: etcd manifest file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-2-3.png) ## Scheduler The scheduler is a component of Kubernetes, as its name says its role is to schedule pods onto available nodes according to the pod's resource requirements. You can find its manifest file **kube-scheduler.yaml** in the **/etc/kubernetes/manifests** directory. A small portion of the **Scheduler** manifest file is given below. ![Kubernetes Configuration: scheduler manifest file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-3-3.png) You can find the configuration file of the Scheduler on the directory **/etc/kubernetes** as **scheduler.conf**. A sample ****scheduler.conf** file is given below ![Kubernetes Configuration: scheduler configuration file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-5-2.png) ## Admin kubeconfig As the name suggests, this is an admin configuration file that has the details to operate Kubernetes as an admin user. The admin.conf file contains the cluster endpoint, and credentials to operate Kubernetes as an admin. The file is named as **admin.conf** under the directory **/etc/kubernetes**. A sample **admin.conf** file is given below ![Kubernetes Configuration: admin configuration file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-4-4.png) ## Kubelet kubeconfig As the name suggests, this is the configuration file of Kubelet which is a component of Kubernetes. Kubelet runs on each node and its role is to manage the container running on the nodes. The file is named **kubelet.conf** under the directory **/etc/kubernetes**. A sample **kubelet.conf** file is given below ![Kubernetes Configuration: kubelet configuration file](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-7-2.png) You can find every key and certificate of every component of Kubernetes under the directory **/etc/kubernetes/pki**. Always know the location of these files that will help you troubleshoot when a configuration error occurs. ## Conclusion In summary, we learned about configuration files and their location on Kubernetes. I hope you find this blog useful. ### [Solved] couldn't get current server API group list: Get "http://localhost:8080/api?timeout connect: connection refused URL: https://scriptcrunch.com/couldnt-get-current-server-api/ Last updated: 2026-06-23T08:55:56.000Z **Issue**: When trying to access the [kubernetes cluster](https://scriptcrunch.com/install-kubernetes/) using kubectl you might get the couldn't get current server API - connection refuse error. Here is the full error. ``` E0202 10:40:56.460499 6352 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused ``` This error could be due to four issues. All the issues and its solutions are explained below. ## Issue 1: User doesnt have the Kubeconfig file This error primarily happens due to Kubeconfig file not present in the users **`$HOME/.kube/config`** location. Kubectl will try to access the config file for this location. For example, if the kubeconfig file is added to ubuntu user home and if you try to access kubectl from the root user, you will get the error. So ensure the kubeconfig file is present in the users home directory. ## Issue 2: Unavailable Cluster If you have the Kubeconfig file under users folder and still facing connection refused error, it could be due to unavailable cluster. Ensure you have the cluster up and running. Also, check if you have set the current context to the correct cluster. ## Issue 3: Unreachable API Server If you are trying to reach a [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster deployed in a private network, you will get the connection refused error. For example, you might have deployed a Kubernetes cluster with a private IP in cloud environment. If you try to access that cluster from your workstation, you cannot connect to it. ## Issue 4: Firewall Issue If you have a Kuberntes cluster running remotely, ensure the firewall rules accept connection on port 6443 from the machine you are trying to access the API server. If you have the cluster on cloud, check the firewall rules for control plane node for incomming connections on port 6443. ### CKA Series: Create a Pod Using Dry Run Flag URL: https://scriptcrunch.com/cka-create-pod-dry-run/ Last updated: 2026-06-23T08:55:57.000Z In this CKA Series blog, we will look at the steps to create a [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) pod using the dry run flag with an init container. This method is particularly useful when you appear for [Kubernetes certifications](https://scriptcrunch.com/tag/kubernetes-certifications/) like [CKA](https://scriptcrunch.com/kubernetes-exam-guide/). The --dry-run=client flag is used with kubectl to create the pod YAML. Here is an example. **`test-pod`** is the pod name. ``` kubectl run test-pod --image=nginx --dry-run=client -oyaml ``` You will get an output like the following. ```yaml root@controlplane:# kubectl run test-pod --image=nginx --dry-run=client -oyaml apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: run: test-pod name: test-pod spec: containers: - image: nginx name: test-pod resources: {} dnsPolicy: ClusterFirst restartPolicy: Always status: {} root@controlplane:/home/ubuntu# ``` During the CKA exam, you will be asked to deploy pods with custom values. First, you need to create the YAML using dry-run flag and then redirect it to a file. Let's look at a scenario. ### Example Scenario You are responsible for deploying a new web server in your Kubernetes cluster. The requirements are as follows: - Create a Pod named `webserver` in the `default` namespace. - The Pod should run a container using the `nginx` image. - Before the `nginx` container starts, an init container should run to completion. - The init container should be named `init-webserver` and use the `busybox` image. - The init container must execute a shell command to create a file named `welcome.txt` in the `/usr/share/nginx/html` directory. The file should contain the text "Welcome to our web server!" **Tasks:** 1. Write the YAML definition for the Pod, including both the main container and the init container. 2. Apply the YAML to create the Pod. 3. Verify that the init container ran successfully and that the `nginx` container is running. 4. Confirm that the `welcome.txt` file exists in the specified directory within the Pod. ### Solution Let's take a look at how to solve the above scenario. First, create a pod YAML using the dry run and write it to a file named `webserver-pod.yaml` ``` kubectl run webserver --image=nginx --dry-run=client -o yaml > webserver-pod.yaml ``` Next open `webserver-pod.yaml `file and add the init container spec as shown below. If you don't remember the spec, you can use the official [k8s](https://scriptcrunch.com/tag/kubernetes/) documentation. ``` apiVersion: v1 kind: Pod metadata: name: webserver namespace: default spec: initContainers: - name: init-webserver image: busybox command: ['sh', '-c', 'echo "Welcome to our web server!" > /usr/share/nginx/html/welcome.txt'] volumeMounts: - name: html mountPath: /usr/share/nginx/html containers: - name: webserver image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html volumes: - name: html emptyDir: {} ``` Now you can deploy the pod using the following command. ``` kubectl apply -f webserver-pod.yaml ``` The task is pretty easy but it's about time for the CKA exam. So practice the scenario well. Try to use aliases as much as possible. If you are registering for the CKA certification don't forget to use the coupon code from the [Linux Foundation Coupon](https://scriptcrunch.com/linux-foundation-coupon/) page to get up to 50% CKA discount. ### How to Install Kubernetes: A Step-by-Step Guide for Beginners URL: https://scriptcrunch.com/install-kubernetes/ Last updated: 2026-06-23T08:55:57.000Z Learn how to install [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) with our 7 step [guide](https://scriptcrunch.com/tag/guides/). Perfect for beginners, this [tutorial](https://scriptcrunch.com/tag/tutorials/) walks you through each step to get Kubernetes installed. We will setup the Kubernetes clusters using the official Kubeadm utility. It makes the cluster configurations very easily. ## Step 1: Create Two Servers You need a minimum of two Ubuntu servers to create a Kubernetes clusters. These servers can be on your local workstation, cloud it bare metal servers. All you need is internet connection in the servers. Servers should have a minimum of **2 vCPU and 2GB RAM**. 1. **Server 01:** Will act as Kubernetes Controller Plane 2. **Server 02:** Will act as Kubernetes Worker node. In both servers ensure the firewall is disabled and all the ports are allowed between the servers. Id you want restricted port access between the servers, enable all the recommended ports of control plane and worker nodes as given in the image below. ![kubeadm required ports for control plane and Worker Nodes](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-5-4.png) You can add more servers as workers nodes as per your requirements. The setup process will the same of all the worker nodes. > **Note**[follow this blog](https://kubernetes.io/blog/2023/10/12/bootstrap-an-air-gapped-cluster-with-kubeadm/?ref=scriptcrunch.com) ## Step 2: Install Essential Utilities on All Servers Next step is to install the following utilities on all the servers. 1. Container Runtime ([CRI-O](https://scriptcrunch.com/install-cri-o-ubuntu/)) 2. kubelet 3. Kubeadm 4. kubectl Also we will do some extra configurations required for Kubernetes. To make things simpler, we have added all the steps as a shell script. Save the following shell script as **`utilities.sh`** ``` #!/bin/bash # Exit on error, undefined variable, or error in any pipeline set -euxo pipefail # Variables KUBERNETES_VERSION="1.28.1-00" OS="xUbuntu_22.04" VERSION="1.28" # Disable swap and keep it off during reboot sudo swapoff -a (crontab -l 2>/dev/null; echo "@reboot /sbin/swapoff -a") | crontab - || true # Update package list sudo apt-get update -y # Install CRI-O Runtime # Load required modules and set sysctl params echo -e "overlay\nbr_netfilter" | sudo tee /etc/modules-load.d/crio.conf sudo modprobe overlay sudo modprobe br_netfilter echo -e "net.bridge.bridge-nf-call-iptables=1\nnet.ipv4.ip_forward=1\nnet.bridge.bridge-nf-call-ip6tables=1" | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf sudo sysctl --system # Add CRI-O to sources and install echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add - sudo apt-get update sudo apt-get install -y cri-o cri-o-runc sudo systemctl daemon-reload sudo systemctl enable crio --now echo "CRI runtime installed successfully" # Install Kubernetes components sudo apt-get update -y sudo apt-get install -y apt-transport-https ca-certificates curl curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list > /dev/null sudo apt-get update -y sudo apt-get install -y kubelet="$KUBERNETES_VERSION" kubectl="$KUBERNETES_VERSION" kubeadm="$KUBERNETES_VERSION" # Install jq and set Kubelet node IP sudo apt-get install -y jq local_ip=$(ip --json addr show eth0 | jq -r '.[0].addr_info[] | select(.family == "inet") | .local') echo "KUBELET_EXTRA_ARGS=--node-ip=$local_ip" | sudo tee /etc/default/kubelet > /dev/null ``` Copy the script to all the servers. Login as root. This script need root permissions to execute. ``` sudo su ``` Add executable permissions to the script using the following command. ``` chmod +x utilities.sh ``` Execute the script. ``` ./utilities.sh ``` The script will install and configure all the essentials for the Kubernetes cluster. On a successful execution you will get the output as shown below. ![kubernetes cluster utilities installation and validation.](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-6-4.png) ## Step 3: Create Kubeadm Configuration File Next step is to create a Kubeadm YAML configuration file with all the required configurations for control plane. Save the following YAML file as **`kubeadm.config`** in the control plane node. Replace **35.89.184.80** with the Public or Private IP of the control plane node. ``` apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration apiServer: certSANs: - 127.0.0.1 - 35.89.184.80 extraArgs: bind-address: "0.0.0.0" scheduler: extraArgs: bind-address: "0.0.0.0" controllerManager: extraArgs: bind-address: "0.0.0.0" networking: podSubnet: "10.244.0.0/16" serviceSubnet: "10.96.0.0/12" ``` ## Step 4: Initialize Control Plane with Configuration File Now, using kubeadm we will initial the control plane. Excute the following kubeadm command in the control plane node where you have saved the **`kubeadm.config`** file. ``` kubeadm init --config=kubeadm.config ``` On a successful execution, you will get the following output show in the image below. Copy the join command and keep it in a notepad. We need the join command to be run on the worker nodes to join the master node. ![Kuberntes kubeadm join command.](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-7-4.png) Execute the following to add the admin.conf file to the homefolder to use kubectl commands ``` mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config ``` Verify kubectl by executing the following command. ``` kubectl get pod -n kube-system ``` You should see the output like below. ``` root@controlplane# kubectl get pod -n kube-system NAME READY STATUS RESTARTS AGE coredns-5dd5756b68-6t77f 1/1 Running 0 5m23s coredns-5dd5756b68-gkbhp 1/1 Running 0 5m23s etcd-controlplane 1/1 Running 1 5m36s kube-apiserver-controlplane 1/1 Running 0 5m39s kube-controller-manager-controlplane 1/1 Running 0 5m38s kube-proxy-2264s 1/1 Running 0 5m23s kube-scheduler-controlplane 1/1 Running 0 5m38s root@controlplane:/home/ubuntu# ``` ## Step 5: Join the Worker Nodes To Control Plane Now that the control plane is setup, we need to join the worker node to the control plan. Execute the join command you noted down in the last step **on the Worker nodes**. It should look like the following. ``` kubeadm join 172.31.41.192:6443 --token e5919f.htqtr9b1zlf0pc26 \ --discovery-token-ca-cert-hash sha256:1b034aba240d892c3c05d7dd551623df51759164ed3072b368a7c0415a522266 ``` A successful output should look like the following ``` 4oot@node01# kubeadm join 172.31.41.192:6443 --token e5919f.htqtr9b1zlf0pc26 \ --discovery-token-ca-cert-hash sha256:1b034aba240d892c3c05d7dd551623df51759164ed3072b368a7c0415a522266 [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml" [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. Run 'kubectl get nodes' on the control-plane to see this node join the cluster. ``` Execute the following command on the control plane node to verify if the node has joined the cluster. ``` kubectl get nodes ``` You should see the following output. ``` oot@controlplane:/home/ubuntu# kubectl get nodes NAME STATUS ROLES AGE VERSION controlplane Ready control-plane 14m v1.28.1 node01 Ready 6m22s v1.28.1 ``` ## Step 6: Validate the cluster Lets do a smoke test and validate the cluster. We have added all the commands you can use to validate the different aspects of the clusters. | Command | Description | | --------------------------------- | -------------------------------------------------------------------------- | | kubectl get nodes | Check the status of nodes in the cluster. | | kubectl get pods --all-namespaces | Check if all pods are running or have successfully terminated. | | kubectl cluster-info | Get basic info about the cluster. | | kubectl get svc | Check services running in the default namespace. | | kubectl get componentstatuses | Check the status of cluster components like etcd, controller-manager, etc. | | kubectl api-resources | See all available API resources. | | kubectl config view | View kubeconfig settings. | | kubectl get events | See events such as scaling operations or errors. | | kubectl version | Check the version of the client and the server. | ## Conclusion In this blog we have looked at installing a Kubernetes cluster using simple steps and configurations. Next you can try deploying applications on the cluster. Cluster setup is one of the important tasks in [CKA Certification exam](https://scriptcrunch.com/kubernetes-exam-guide/). If you are planning for CKA exam, don't forget to use voucher codes from [Linux Foudnation Coupon](https://scriptcrunch.com/linux-foundation-coupon/) page to save up to 35% on certification registration. ### How to Install Prometheus on Ubuntu URL: https://scriptcrunch.com/install-prometheus-on-ubuntu/ Last updated: 2026-06-23T08:55:57.000Z Learn how to install [Prometheus](https://scriptcrunch.com/tag/prometheus/) on Ubuntu with our easy-to-follow [guide](https://scriptcrunch.com/tag/guides/). Perfect for beginners to get your monitoring setup in no time. [Prometheus](https://prometheus.io/?ref=scriptcrunch.com) is an open-source monitoring and alerting system for collecting, storing, and querying metrics data from multiple systems and applications. Let's see how to install Promethus on Ubuntu, follow the below steps to install Promethus. **Step 1:** Update and upgrade your system using the command given below. ``` sudo apt update && sudo apt upgrade -y ``` **Step 2:** Download Prometheus and extract the files using the command. ``` wget https://github.com/prometheus/prometheus/releases/download/v2.37.6/prometheus-2.37.6.linux-amd64.tar.gz tar -xvf prometheus-2.37.6.linux-amd64.tar.gz mv prometheus-2.37.6.linux-amd64 prometheus ``` **Step 3:** Create a user Prometheus using the command given below. ``` sudo useradd --no-create-home --shell /bin/false prometheus ``` **Step 4:** Create a Prometheus folder in two locations and change their owner permissions to Prometheus user. ``` sudo mkdir /etc/prometheus sudo mkdir /var/lib/prometheus sudo chown prometheus:prometheus /etc/prometheus sudo chown prometheus:prometheus /var/lib/prometheus ``` **Step 5:** Copy prometheus and promtool files to the bin and change the ownership to prometheus user. ``` sudo cp prometheus/prometheus /usr/local/bin/ sudo cp prometheus/promtool /usr/local/bin/ sudo chown prometheus:prometheus /usr/local/bin/prometheus sudo chown prometheus:prometheus /usr/local/bin/promtool ``` **Step 6:** Then copy the consoles and console\_libraries folder to the prometheus folder and change the ownership to promethus. ``` sudo cp -r prometheus/consoles /etc/prometheus sudo cp -r prometheus/console_libraries /etc/prometheus sudo chown -R prometheus:prometheus /etc/prometheus/consoles sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries ``` **Step 7:** Now copy the prometheus.yml file inside the prometheus folder and change the ownership to promethus. ``` sudo cp prometheus/prometheus.yml /etc/prometheus ``` **Step 8:** Create a prometheus service file and copy the below content in it. sudo vi /etc/[linux](https://scriptcrunch.com/%3Ca%20href=)\-systemd/">systemd/system/prometheus.service ``` [Unit] Description=Prometheus Wants=network-online.target After=network-online.target [Service] User=prometheus Group=prometheus Type=simple ExecStart=/usr/local/bin/prometheus \ --config.file /etc/prometheus/prometheus.yml \ --storage.tsdb.path /var/lib/prometheus/ \ --web.console.templates=/etc/prometheus/consoles \ --web.console.libraries=/etc/prometheus/console_libraries [Install] WantedBy=multi-user.target ``` Now reload to make the changes and start Prometheus. ``` sudo systemctl daemon-reload sudo systemctl start prometheus ``` **Step 9:** Check the status of promethus if it's running or not. ``` sudo systemctl status prometheus ``` **Step 10:** Now access Prometheus UI in the browser by using the server IP along with the default port number 9090\. You can see your UI in the browser as shown below. ![Prometheus UI in the browser](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/screenshot-from-2023-03-06-11-41-07.png) You can use the search tab to search for available metrics as shown below. ![prometheus search tab](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/screenshot-from-2023-03-06-11-40-09.png) **Note:** Linux Foundation offers a Prometheus certification called [Prometheus Certified Associate](https://training.linuxfoundation.org/certification/prometheus-certified-associate/?ref=scriptcrunch.com) (PCA). You can check our [Linux Foundation Coupon](https://scriptcrunch.com/linux-foundation-coupon/) page to get up to 50% discount on the PCA certification. ### Deploy Nginx Custom Website on Kubernetes With AWS ECR URL: https://scriptcrunch.com/deploy-nginx-kubernetes-ecr/ Last updated: 2026-06-23T08:55:58.000Z In this [guide](https://scriptcrunch.com/tag/guides/), we will learn how to deploy an Nginx custom website on [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) With a container image for [AWS](https://scriptcrunch.com/tag/aws/) ECR. ECR stands for Elastic Container Registry, it is a container registry service fully managed by AWS which makes it easier to store, manage, and deploy container images. Integration with AWS services, high availability, security, and scalability are the main features of ECR. Before starting the [tutorial](https://scriptcrunch.com/tag/tutorials/) make sure you have the following requirements in your system: 1. Minikube 2. Virtualbox - We are going to start minikube with VirtualBox driver. 3. Nginx image. 4. AWS CLI is installed and configured. **Step 1:** Before pushing an image to a repository, you must create an ECR repository in AWS. [Go](https://scriptcrunch.com/tag/go/) to service and search for ECR it will direct you to the ECR repository. Press the Create Repository button and create a new repository, set the repository as private, give a name for the repository and press Create Repository button at the bottom. Now return to the ECR dashboard you can see a new repository created. **Step 2:** Log in to the ECR registry using the command: ``` aws ecr get-login-password --region | docker login --username AWS --password-stdin ``` Specify the region and ECR repository URL in the above command and run the command below to create a Kubernetes secret with the ECR registry authorization token. ``` kubectl create secret generic ecr-registry \ --from-file=.dockerconfigjson=${HOME}/.docker/config.json \ --type=kubernetes.io/dockerconfigjson ``` If the session logout or the token expires you need to change the authentication token in the ecr-registry file to run the below commands. ``` kubectl create secret generic ecr-registry \ --from-file=.dockerconfigjson=${HOME}/.docker/config.json \ --type=kubernetes.io/dockerconfigjson \ --dry-run=client -o yaml > ecr-registry.yaml ``` This command creates a new file ecr-registry.yaml with the new authentication token created in the \~/.[docker](https://scriptcrunch.com/tag/docker/)/configure.json directory. Now you have to run the ecr-registry.yaml file to update the token inside ecr-registry. Run the command below to update the token. ``` kubectl apply -f ecr-registry.yaml ``` **Step 3:** Tag the Docker image with the repository URL to identify which image we are going to push, to tag the image use the command: ``` docker tag : ``` **Step 4:** After tagging push the image to ECR and it will be available for deployment, to push the image use the command: ``` docker push : ``` Now, check inside the ECR repository you created if the image is uploaded, if uploaded follow the next step. **Step 5:** Now, start minikube with the VirtualBox driver using the command given below. ``` minikube start --driver=virtualbox ``` To verify if it's working properly run the command: ``` minikube status ``` If you get the following output you are good to follow the next step. ``` minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured ``` **Step 6:** If you don't have aws-iam-authenticator in your system install it using the command given below. ``` curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator chmod +x ./aws-iam-authenticator sudo mv ./aws-iam-authenticator /usr/local/bin/aws-iam-authenticator ``` AWS IAM Authenticator is a tool that allows you to authenticate to your AWS ECR using your IAM credentials. It allows you to use your user accounts and roles to authenticate access to your ECR repository. You also need to attach the policy given below to your user to get access to ECR. ``` AmazonEC2ContainerRegistryFullAccess ``` **Step 7:** Create a YAML file for deploying the Nginx image for ECR. ``` apiVersion: apps/v1 kind: Deployment metadata: name: ecr-deployment spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: my-container image: imagePullSecrets: - name: ecr-registry ``` In the above file provide your image-URL in the ECR repository and specify the secret name you created in step 2. **Step 8:** Now apply the YAML file to create the deployment, and run the command for deploy: ``` kubectl apply -f .yaml ``` By running this command your Kubernetes deployment should now be able to download the Nginx image from ECR and deploy it. You can get the deployment status using the command given below it will show if the image is deployed or not. ``` kubectl get deployments ``` If it's deployed you will get an output as given below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-17.png) You can check if nginx is running properly by searching it in the browser with minikube IP and port 32000\. To get the minikube IP run the following command: ``` minikube ip ``` To access the minikube dashboard, run the command given below its will display the dashboard in your browser as shown below. ``` minikube dashboard ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-1-6.png) > **Note:**[Kubernetes certifications](https://scriptcrunch.com/tag/kubernetes-certifications/)[Linux Foundation coupons](https://scriptcrunch.com/linux-foundation-coupon/) ### 30 Best Kubernetes Tutorials & Resources (Beginner to Advanced) URL: https://scriptcrunch.com/kubernetes-tutorial-guides/ Last updated: 2026-06-23T08:55:58.000Z This blog contains a list of the best [Kubernetes](https://kubernetes.io/?ref=scriptcrunch.com) [tutorials](https://scriptcrunch.com/tag/tutorials/) that cover basic to advanced [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) concepts. ## Best Kubernetes Tutorials For Beginners Following are the best tutorials that will help you get started with kubernetes. 1. [Learn Kubernetes Basics](https://kubernetes.io/docs/tutorials/kubernetes-basics/%5Fprint/?ref=scriptcrunch.com): It is the official kubernetes [tutorial](https://scriptcrunch.com/tag/tutorials/) blog 2. [Scalable Microservices with Kubernetes](https://scriptcrunch.com/recommends/free-kubernetes-course/) \- Course from Google 3. [Kubernetes Architecture Explained](https://devopscube.com/kubernetes-architecture-explained/?ref=scriptcrunch.com): Explains the kubernetes architecture and important concepts of kubernetes 4. [Kubernetes API Architecture](https://medium.com/@danielepolencic/the-kubernetes-api-architecture-81da0ede0e34?ref=scriptcrunch.com) 5. [Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s%5Fo8dwzRlu4&ref=scriptcrunch.com) 6. [Kube By Example](https://kubebyexample.com/?ref=scriptcrunch.com) 7. [AWS EKS Worksop](https://www.eksworkshop.com/?ref=scriptcrunch.com) 8. [Learn DevOps: The Complete Kubernetes Course](https://www.udemy.com/course/learn-devops-the-complete-kubernetes-course/?ref=scriptcrunch.com) 9. [Learn Kubernetes in Under 3 Hours: A Detailed Guide to Orchestrating Containers](https://www.freecodecamp.org/news/learn-kubernetes-in-under-3-hours-a-detailed-guide-to-orchestrating-containers-114ff420e882?ref=scriptcrunch.com): 10. [Official Kubernetes Blog](https://kubernetes.io/docs/home/?ref=scriptcrunch.com) 11. [Kubernetes The Hard Way](https://github.com/kelseyhightower/kubernetes-the-hard-way?ref=scriptcrunch.com) 12. [Google Cloud Platform - Kubernetes Community](https://medium.com/google-cloud/tagged/kubernetes?ref=scriptcrunch.com) 13. [Advanced Kubernetes Objects You Need to Know](https://engineering.opsgenie.com/advanced-kubernetes-objects-53f5e9bc0c28?ref=scriptcrunch.com) 14. [Awesome Kubernetes Resources](https://github.com/tomhuang12/awesome-k8s-resources?ref=scriptcrunch.com) 15. [How To Develop Kubernetes CLIs Like a Pro](https://iximiuz.com/en/posts/kubernetes-api-go-cli/?ref=scriptcrunch.com) 16. [Build a Kubernetes Operator in six steps](https://developers.redhat.com/articles/2021/09/07/build-kubernetes-operator-six-steps?ref=scriptcrunch.com) 17. [Dynamic Kubernetes Cluster Scaling at Airbnb](https://medium.com/airbnb-engineering/dynamic-kubernetes-cluster-scaling-at-airbnb-d79ae3afa132?ref=scriptcrunch.com) 18. [What happens when ... Kubernetes edition!](https://github.com/jamiehannaford/what-happens-when-k8s?ref=scriptcrunch.com) 19. [10 Kubernetes Security Risks & Best Practices](https://redkubes.com/10-kubernetes-security-risks-best-practices/?ref=scriptcrunch.com) 20. [Kubernetes Failure Stories](https://k8s.af/?ref=scriptcrunch.com) 21. [Setup Prometheus Monitoring On Kubernetes](https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/?ref=scriptcrunch.com) ## Kubernetes Tutorials For Advanced Users Following are curated and structured kubernetes tutorials for intermediate to advanced users. 1. [kubebuilder.io](https://kubebuilder.io/?ref=scriptcrunch.com) \- Core understanding of kubernetes APIs 2. [Ultimate Guide to Kubernetes Operators](https://komodor.com/learn/kubernetes-operator/?ref=scriptcrunch.com): Learn to build Kubernetes operators. ## Short Kubernetes Tips & Tutorials You might also like the following kubernetes blogs 1. [Install Kubernetes Cluster](https://scriptcrunch.com/install-kubernetes/) 2. [CKA Exam Study ](https://scriptcrunch.com/kubernetes-exam-guide/) 3. [Convert Helm Chart to Kubernetes YAML](https://scriptcrunch.com/convert-helm-chart-kubernetes-yaml/) 4. [Change Nginx index.html in Kubernetes With Configmap](https://scriptcrunch.com/change-nginx-index-configmap/) 5. [Install CRI-O on Ubuntu For Kubernetes](https://scriptcrunch.com/install-cri-o-ubuntu/) 6. [How to Check Kubernetes Cluster Health Status](https://scriptcrunch.com/check-kubernetes-cluster-health-status/) This list will keep growing with all the popular Kubernetes tutorials. ## Kubernetes Learning Paths Following are the the best kubernetes learning paths available. 1. [Kubernetes Learning Path](https://github.com/techiescamp/kubernetes-learning-path?ref=scriptcrunch.com) (Github Repo) 2. [KodeKloud Learning Path](https://scriptcrunch.com/recommends/k8s-learning-path/) ## Conclusion Kubernetes has become the de facto standard for container workloads. With is the vast community support and involvement of bigger organizations (Google, Redhat, etc) in this project led to its massive success in container adoption. Having Kubernetes Knowledge and getting certified in Kubernetes will boost your career in terms of technology and salary as it is a sought-after skillset. If you are learning for [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/), check out our comprehensive [CKA exam guide.](https://scriptcrunch.com/kubernetes-exam-guide/) Also, use the [CKA coupon](https://scriptcrunch.com/linux-foundation-coupon/) to get discounts on certification registration. ### How to Check Kubernetes Cluster Health Status URL: https://scriptcrunch.com/check-kubernetes-cluster-health-status/ Last updated: 2026-06-23T08:55:59.000Z In this blog, you will learn different ways to check [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster health status. To check the Kubernetes cluster health, you can do the following. 1. Check cluster API health 2. Check Node status 3. Check cluster pod status ## Kubernetes Cluster Health Check Command You can check the health of the API endpoints using the following command. ``` kubectl get --raw='/readyz?verbose' ``` ![Kubernetes Cluster Health Check Command](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-1-7.png) From within the cluster, you can use ``` curl -k https://localhost:6443/livez?verbose ``` There is also a component status command that is deprecated but works in the latest version. ``` kubectl get cs ``` ## Kubernetes Node Status Command The following kubectl command gives you the status of the node. ``` kubectl get nodes ``` ![Kubernetes Node Status](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-2-5.png) To get a detailed status and information of Kubernetes nodes, use the following kubectl command. ``` kubectl describe nodes ``` ## Check Cluster Pod Status List all the cluster pods from the `kube-system` namespace and check their status. ![Check Cluster Pod Status](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-3-5.png) ``` kubectl get po -n kube-system ``` ## Conclusion When it comes to day-to-day kubernetes operations, it is essential to check the cluster status using different ways to ensure the cluster is running without any issues. If you are preparing for [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/), check out the [CKA exam guide](https://scriptcrunch.com/kubernetes-exam-guide/) and use the [CKA coupon](https://scriptcrunch.com/linux-foundation-coupon/) to get discounts on certification registration. If you are learning Kubernetes, check out the [best Kubernetes tutorials.](https://scriptcrunch.com/kubernetes-tutorial-guides/) ### How to Install CRI-O on Ubuntu For Kubernetes? URL: https://scriptcrunch.com/install-cri-o-ubuntu/ Last updated: 2026-06-23T08:55:59.000Z A step-by-step [guide](https://scriptcrunch.com/tag/guides/) to installing [cri-o](https://cri-o.io/?ref=scriptcrunch.com) container runtime on Ubuntu for [kubeadm kubernetes setup.](https://scriptcrunch.com/install-kubernetes/) Here is what you should know about crio 1. cri-o is an open-source container runtime created by the open-source community to replace the [Docker](https://scriptcrunch.com/tag/docker/) engine on [Kubernetes](https://scriptcrunch.com/tag/kubernetes/). 2. cri-o is a stable container engine that runs OCI-compliant runtimes. 3. cri-o is very stable because it is developed along with Kubernetes. ## Install CRI-O on Ubuntu You can install cri-o runtime easily on Ubuntu using the following four steps. ### **Step 1:** Add the cri-o repository from OpenSUSE. First, we need to add the cri-o repository from the openSUSE repo. The version we are using is 1.28 ``` OS="xUbuntu_22.04" VERSION="1.28" echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list ``` ### **Step 2:** Add the cri-o gpg keys Add the cri-o gpg release key to verify the downloaded package. ``` curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add - ``` ### **Step 3:** Update and install cri-o Run an update and install. crio and crio-runc packages. ``` sudo apt-get update sudo apt-get install cri-o cri-o-runc cri-tools -y ``` ### **Step 4:** Reload and enable cri-o Reload the [linux](https://scriptcrunch.com/%3Ca%20href=)\-systemd/">systemd confirmations and enable crio utility to start on re-boots. ``` sudo systemctl daemon-reload sudo systemctl enable crio --now ``` #### **Step 5:** Verify cri-o installation using crictl. crictl utility is part of the cri-tools package. It is the CLI to interact with cri-o ``` sudo crictl info ``` You should see a JSON output as shown below. ``` { "status": { "conditions": [ { "type": "RuntimeReady", "status": true, "reason": "", "message": "" }, { "type": "NetworkReady", "status": false, "reason": "NetworkPluginNotReady", "message": "Network plugin returns error: No CNI configuration file in /etc/cni/net.d/. Has your network provider started?" } ] } } ``` ## Conclusion When it comes to kubeadm Kubernetes setup, you need a container runtime like cri-o. Also, it is an important concept in [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/) exams. In the CKS certification exam, you will have to use the `crictl` command line utility for [troubleshooting](https://scriptcrunch.com/tag/troubleshooting/). If you are preparing for Kubernetes certification, check out the [CKA exam guide](https://scriptcrunch.com/kubernetes-exam-guide/) and use the [CKA coupon](https://scriptcrunch.com/linux-foundation-coupon/) to get discounts on certification registration. If you are learning Kubernetes, check out the [best Kubernetes tutorials.](https://scriptcrunch.com/kubernetes-tutorial-guides/) ### How to Convert Helm Chart to Kubernetes YAML URL: https://scriptcrunch.com/convert-helm-chart-kubernetes-yaml/ Last updated: 2026-06-23T08:55:59.000Z In this blog, you will learn to convert existing [Helm](https://scriptcrunch.com/a-kubernetes-helm-guide-for-the-cka-exam/) chart templates to [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) YAML manifests. So, why would anyone want to convert a Helm template to a Kubernetes manifest? If you look at a community helm chart, sometimes it's confusing for beginners to understand all the components which the chart installs. So, if you want to understand a community helm chart or want to learn each and every component which is part of a Helm chart, you can convert the helm chart to a kubernetes manifest. Once you have the kubernetes YAML files, it is easy to comprehend and understand what the helm chart is all about. ## Convert Helm Chart to Kubernetes YAML Converting a Helm chart to kubernetes YAML is very easy. You can use the helm native commands to achieve this. In helm, there is a command called `helm template`. Using the template command you can convert any helm chart to a YAML manifest. The resultant manifest file will have all the default values set in the helm `values.yaml.` Ensure that you have [helm installed](https://devopscube.com/install-configure-helm-kubernetes/?ref=scriptcrunch.com) to execute the template command. We will use the [Vault](https://scriptcrunch.com/tag/vault/) community helm chart to demonstrate this. The following command converts the community vault helm chart to YAML. ``` helm template vault hashicorp/vault --output-dir vault-manifests/helm-manifests ``` In the above command, 1. `hashicorp/vault `is the chart name. 2. `vault-manifests/helm-manifests` is the output directory where the YAMLs get stored. Like this, you can convert any helm chart to Kubernetes YAML files. ## Helm template command To understand more about the helm template command, you can use the helm help command. Execute the following command to get the help output. ``` helm template --help ``` ![helm template to convert yaml](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-19.png) Also, you can refer to the official [helm template command documentation](https://helm.sh/docs/helm/helm%5Ftemplate/?ref=scriptcrunch.com). ## Conclusion When it comes to [Kubernetes certification](https://scriptcrunch.com/tag/kubernetes-certifications/) exams, you cannot use tools like Helm. You need to use plain Kubernetes YAML files to deploy applications. With easy helm to YAML conversion, you can understand the kubernetes manifests easily. Also, if you are preparing for Kubernetes certification, use the [latest CKA coupon code](https://scriptcrunch.com/linux-foundation-coupon/) to get discounts on certification registration. ### How To Change Nginx index.html in Kubernetes With Configmap URL: https://scriptcrunch.com/change-nginx-index-configmap/ Last updated: 2026-06-23T08:56:00.000Z In this [guide](https://scriptcrunch.com/tag/guides/), you will learn how to change the default index.html in [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) Nginx deployment with an `index.html` file from the configmap. Here is what we are going to do. 1. Create a config map with `index.html` file as data 2. Add the `index.html` configmap to the Nginx deployment as volume. ## Kubernetes Nginx index.html Configmap If you take a look at the following configmap, under the data section, we are creating are adding a file index.html with custom HTML content. Save the manifest as `index-html-configmap.yaml` ``` apiVersion: v1 kind: ConfigMap metadata: name: index-html-configmap namespace: default data: index.html: |

Welcome


Hi! This is a configmap Index file

**Note** ``` curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install ``` To validate the CLI installation, execute the CLI version command. ``` aws --version ``` To know the location of the binary, execute the following command. Usually it would be `/usr/local/bin/aws` ``` which aws ``` ## Install AWS CLI on MAC AWS MAC CLI installation is very easy. You just need to install it using `brew`. If you don't have homebrew, install it using the following command. ``` /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` Then install the aws cli. ``` brew install awscli ``` ## Install AWS CLI on Windows For windows download the aws cli MSI file and install it. You can download the MSI file from here [https://awscli.amazonaws.com/AWSCLIV2.msi](https://awscli.amazonaws.com/AWSCLIV2.msi?ref=scriptcrunch.com) ## Configure AWS CLI Before starting the configuration, you should have the AWS access key and secret key for your user. If you dont have these details, you can create one from the IAM console under your user name. [Go](https://scriptcrunch.com/tag/go/) to "**My Security Credentials**" Under your Account Name in AWS Console. Run the configure command. ``` aws configure ``` It will ask for the AWS access key, secret key, region, and default output format. provide the details you prefer. For example, ``` vagrant@lab:~$ aws configure AWS Access Key ID : [****************7PFK] AWS Secret Access Key : [****************tEuh] Default region name : us-west-2 Default output format : JSON ``` ## AWS CLI Config File Location When you run the `aws configure` command, a config file and credential file gets creates in the `$HOME/.aws` location The config file will have details except the access key and secret key. The credentials file will have the access key and secret key. When you execute an AWS CLI command, the CLI uses the config and credential file to authenticate against AWS API. You can change the values of these files with new values anytime you change the credentials or default region. ## Verify AWS CLI Authentication You can verify the AWS CLI authentication by executing any command that interacts with AWS API. For example, we will list instances using the AWS CLI command. ``` aws ec2 describe-instances ``` Now let's create an instance using the CLI. Replace the values with values that match your AWS account. ``` aws ec2 run-instances \ --image-id ami-0d70546e43a941d70 \ --count 1 \ --instance-type t2.micro \ --key-name bibin-server \ --security-group-ids sg-00cf38e1e1799e52a \ --subnet-id subnet-042384c724edd40c0 \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=cli-server}]' 'ResourceType=volume,Tags=[{Key=Name,Value=cli-server-disk}]' ``` ## AWS CLI FAQs ### What is AWS CLI used for?AWS CLI is used to manage AWS resources using the CLI utility. With AWS CLI you can authenticate to AWS services and manage them using the CLI commands. AWS CLI is written in python and it can be installed on Linux, MAC, and Windows systems. ### Where is AWS CLI installed?When you install AWS CLI, it gets installed as per the operating systems. In Linux & MAC systems, it gets installed in` /usr/local/bin/aws`. For windows based systems, it gets installed in `C:\Program Files\Amazon\AWSCLI (64-bit version)` or `C:\Program Files (x86)\Amazon\AWSCLI` location. ### What is the difference between AWS CLI and console?With AWS CLI, you can have terminal-only access to AWS services. Meaning you have to use commands to list and manage AWS services. With AWS console, you can manage AWS resources from a web UI. ## Conclusion In this blog, we learned the easy ways to install AWS CLI utility and configure it to authenticate to an AWS account. Next, we will see how to use the AWS CLI setup to create AWS resources. ### How To Run a Python Script - Beginners Guide URL: https://scriptcrunch.com/run-python-script/ Last updated: 2026-06-23T08:56:02.000Z In this post, we will walk through the basic concepts, different ways, and environment setup that is required to **run a [python](https://scriptcrunch.com/tag/python/) script**. ## Prerequisites Following are the prerequisites to run a python script. 1\. The first and foremost thing is the python environment to run and test your scripts. You can download and install the latest version of python in your system from [this link](https://www.python.org/downloads/?ref=scriptcrunch.com) 2\. Use Atom, Sublime or Visual studio code as a text editor. I would strongly suggest the open-source visual studio code, as it is packed with good features for coding with an integrated terminal. Also, it supports auto-completion, debugging, and much more. ## Creating Your First Python Script For most of the system administration tasks, you would create a bash script which runs in a shell. In the same way, you can create a python script that runs in a shell. The first thing you are going to do is create a project folder named python and create the following two files with `.sh `and .`py` extensions. first.sh first.py Copy the following contents on the two files using your editor. #!/usr/bin/env python3 # My first python Script print ("Hello Python User") ### Code Explanation 1\. In the above code, `#!/usr/bin/env python3` represents the run-time environment for the program. Normally in bash scripts, you would have `#! /bin/bash` we are using python 3 (latest python) for our program. I would suggest you to [go](https://scriptcrunch.com/tag/go/) with python 3 and not python 2. 2\. `# My first python Script` is just a comment. Every comment starts with `#` 3\. `print ("Hello Python User")` is just a python print function which outputs "hello python User". ## Execute Python Script To run the `.sh` script, first, change it to an executable format by executing the following commands in the terminal. chmod +x first.sh 2\. To execute the script, you can use any of the following commands. ./first.sh python first.sh ./first.py python first.py All the above executions will display the same output. So script file extension and execution is your choice. But our recommendation is to stick with .py extension and develop your scripts using a good editor like VS code that supports python linting, debugging and autocompletion. ## Conclusion In this [tutorial](https://scriptcrunch.com/tag/tutorials/), you created your first python script and executed it. In the next tutorial, we will look into more python-based concepts. Also, look at our comprehensive [guide](https://scriptcrunch.com/tag/guides/) on [Python for Devops](https://scriptcrunch.com/python-devops-tutorial-beginners/) where we explain why python is very important for automation tasks. ### [Solved] Vagrant Kubeadm Cluster Crashes on Reboot URL: https://scriptcrunch.com/solved-vagrant-kubeadm-cluster-crashes-on-reboot/ Last updated: 2026-06-23T08:56:02.000Z **Issue**: If you set up a [kubernetes](https://scriptcrunch.com/tag/kubernetes/) cluster in [Vagrant](https://scriptcrunch.com/tag/vagrant/) using kubeadm on a Ubuntu box, the cluster master node service may fail to start on a VM reboot. If you check the `kublet` logs, you will see connection refused errors for etcd service. This issue is primarily due to `swapoff` issue. Kubeadm needs the swap to be off to function properly. Sometimes, even if you make the `fstab` entry to disable the swap, it might not work as expected. When you set up the cluster you might have run the following command. It will disable swap only for the running session. If you restart the VM, it gets enabled again. ``` swapoff -a ``` ## Solution To solve the `swapoff` issue, here is what you can do. Create a crontab entry that disables swap on reboot. You can add the crontab entry using the following command. ``` (crontab -l 2>/dev/null; echo "@reboot /sbin/swapoff -a") | crontab - ``` If you restart the VM after setting the crontab, your kubernetes master services will come up automatically. If you want an automated kubeadm cluster on Vagrant, check out this [Kubeadm vagrant Github Repository.](https://github.com/scriptcamp/vagrant-kubeadm-kubernetes?ref=scriptcrunch.com) Also, check the [Vagrant networking issue.](https://scriptcrunch.com/solved-vboxmanage-error-component-machinewrap/) If you using Vagrant for [Kubernetes Certification](https://scriptcrunch.com/tag/kubernetes-certifications/) preparation, check out the [Linux Foundation Coupons](https://scriptcrunch.com/linux-foundation-coupon/) to save up to 50% on certifications. ### How to Check if gitignore is Working | Show Ignored Files URL: https://scriptcrunch.com/git-show-ignored-files/ Last updated: 2025-09-25T12:03:05.000Z .gitignore file is a great way to disallow files from being committed to git public or private repositories. In this blog, we will explain to you how to validate the .gitingnore file by listing the files using `git check-ignore` command. ## Git Show Ignored Files Git has an inbuilt command named check-ignore to check if a file is ignored or not. To validate the .gitignore file, first, we will look at an example .gitignore file. Also, you can take a look at the [gitignore templates](https://github.com/github/gitignore?ref=scriptcrunch.com) for reference. ``` *.log *.secret #ignore a specific file /app/access.log # Ignore the node_modules directory node_modules/ # Ignore the build directory /dist # The file containing environment variables .env ``` Now let's look at different scenarios using the above `.gitignore file as an` example. ### List all git ignored file in a Repository Execute the following command to check all the ignored files in a repository. ``` git check-ignore -v **/* ``` You will get an output with the rule and the file location as shown below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/image-20.png) ### List all git ignored file in a Directory To check all the ignored files by git in the directory, first `cd` into the directory. Then execute the following command. ``` git check-ignore * ``` To show the ignore rule, add a -v ``` git check-ignore -v * ``` ### Check if a single File is ignored by git Sometimes we might need to check if a single file is ignored by git. To do this, execute the check-ignore command with the file path. It will output the file name if it is ignored by git. For example, ``` git check-ignore app/access.log ``` Sample output, ``` ➜ gitignore git:(master) ✗ git check-ignore app/access.log/ app/access.log/ ``` ### Check git status Another option to verify ignored files is by checking the git status. If you make changes, the files in the `.gitignore` should not show up in the status. ### fatal: no path specified Error \[check-ignore\] When using the `check-ignore` command, if you don't specify a regular expression or a path with the command, it will throw no path specified Error Either execute the command with a regular expression or add the directory or file path. ### ERROR! The ec2 dynamic inventory plugin requires boto3 and botocore. URL: https://scriptcrunch.com/ec2-dynamic-inventory-requires-boto3/ Last updated: 2026-06-23T08:56:03.000Z Issue: When trying to set up [Ansible](https://scriptcrunch.com/tag/ansible/) Dynamic inventory, I am getting the following error. ``` ERROR! The ec2 dynamic inventory plugin requires boto3 and botocore. ``` I have installed python3 and boto3\. But still, ansible is throwing an error on boto3. ## \[Solution\] ec2 dynamic inventory plugin requires boto3 This issue normally happens when you install Ansible from Ansible ppa. To fix these issues you need to install boto3 using the following command. ``` sudo apt-get install python-boto3 ``` Once you executed the above command, you can try executing the dynamic inventory again, it will not throw this error. You might like, [checking application status using Ansible](https://scriptcrunch.com/check-application-status-using-ansible/) ### How to Setup Linux Welcome Message Using motd URL: https://scriptcrunch.com/setup-linux-welcome-message/ Last updated: 2026-06-23T08:56:03.000Z When you do [ssh](https://scriptcrunch.com/ssh-concept/) to a remote server, you might see a welcome message with the OS name, Team Name, or Company name. This can be configured to show our own welcome messages. ![linux motd welcome message](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/motd-welcome-message.jpg) ## Linux Welcome Message using motd The welcome message is called motd (message of the day). You can put custom messages on `motd` file for the [Linux](https://scriptcrunch.com/tag/linux/) users to view it when logged in. Messages like maintenance, backup, warning, etc. In this [guide](https://scriptcrunch.com/tag/guides/), we will teach you how to set up the Linux welcome message in simple steps. 1\. The welcome message is saved in `/etc/motd` file. 2\. You can view the current message using the following command. cat /etc/motd 3\. To add a new welcome message, edit the `motd` file and add your content. The next time a user logs in, he will see the new welcome message. 4\. You can use the following command to edit the motd file sudo vi /etc/motd To add a custom design as a welcome message. You can create the welcome design from [here](http://fsymbols.com/generators/tarty/?ref=scriptcrunch.com) ### Linux Shell Script To Automate Disk Usage Monitoring URL: https://scriptcrunch.com/linux-shell-script-to-automate-disk-usage-monitoring/ Last updated: 2026-06-23T08:56:04.000Z If you are running mission-critical applications on servers, it is important to monitor and notify the administrators about the [linux](https://scriptcrunch.com/disk-usage-in-%3Ca%20href=)/">disk usage. Many [open source monitoring tools](https://devopscube.com/best-opensource-monitoring-tools/?ref=scriptcrunch.com) do the monitoring and can be integrated with various notification services. But let's say you are running a single server and you don't have a monitoring solution in place. In this case, it is better to write a script that automates the monitoring and sends reports to mail if it reaches the threshold. ## Automate Disk Usage Monitoring In this post, we have explained a shell script that monitors the disk usage at a regular interval you specify in the crontab and emails the report if it reaches the threshold you specify. ### Let's Implement It First, you need to make sure that mail command is working on your server to get the notifications. You can do this test by executing the following command. echo "This message will [go](https://scriptcrunch.com/tag/go/) into the body of the mail." | mail -s "Testing from the server." (email id here) For example, echo "This message will go into the body of the mail." | mail -s "Testing from the server." admin@scriptcrunch.com While executing the above command, you might get the following error. \-bash: mail: command not found If you get the above error, install mail component using the following command and test the command again. Otherwise, proceed to next step. **RHEL/Centos** sudo yum install mailx **For Ubuntu/Debian** sudo apt-get install mailutils ## Script to Test Disk Usage Following is the script that tests the disk usage and sends a report over to the mail id you specify. The explanation for the script is given after the snippet. ``` #!/bin/bash MAILID="admin@scriptcrunch.com" VALUE=80 SERVERNAME=$(hostname) MAIL=/bin/mail for line in $(df -hP | egrep '^/dev/' | awk '{ print $1 "_:_" $5 }') do FILESYSTEM=$(echo "$line" | awk -F"_:_" '{ print $1 }') DISK_USAGE=$(echo "$line" | awk -F"_:_" '{ print $2 }' | cut -d'%' -f1 ) if [ $DISK_USAGE -ge $VALUE ]; then EMAIL="$SERVERNAME - $(date): $FILESYSTEM Exceeded the threshold VALUE\n" EMAIL="$EMAIL\n Usage Details\n Current Usage:($DISK_USAGE%) Threshold value: ($VALUE%)" echo -e "$EMAIL" | $MAIL -s ""$SERVERNAME" Disk Usage Alert: Needs Attention!" "$MAILID" elif [ $DISK_USAGE -lt $VALUE ]; then EMAIL="$EMAIL\n$FILESYSTEM ($DISK_USAGE%) is lessthan the threshold ($VALUE%)" EMAIL="$EMAIL\n" echo -e "$EMAIL" | $MAIL -s ""$SERVERNAME" Disk Usage Alert: Threshold Not Reached" "$MAILID" fi done ``` ### Monitoring Script explanation The above script gets the memory information using "`df hP`" command. The environment variable `MAILID` holds the email id in which the report has to be sent. `VALUE` holds the threshold you want to set. `SERVERNAME` holds the hostname of the server for server identification in the email notification. Using a for loop it will loop through all the filesystem which has "`/dev`" mount point. Then it gets the filesystem name and disk usage percentage to two variables `FILESYSTEM` and `DISK_USAGE`. Using the above variables the disk usage is equated with the threshold `VALUE` variable. Based on the result, an email will be sent to the specified id. ### Monitoring Script Execution To execute the script, copy the script content on to a file named disk-monitor.sh. Now, change the execution permission of the script using the following command. chmod +x disk-monitor.sh To run the script, using the following command. ./disk-monitor.sh ## Automating The Monitoring Process Running the script manually does not make any sense as we want to automate the process. The best way to automate the process is by adding the script to [crontab entry.](https://www.pantz.org/software/cron/croninfo.html?ref=scriptcrunch.com) You can open the crontab using the following command. crontab -e Add the following line to run the script every 5 minutes. Note: Change the script path accordingly. \*/5 \* \* \* \* sh /home/[ec2](https://scriptcrunch.com/tag/ec2/)\-user/disk-monitor.sh Now you can list the crontab entry using the following command. crontab -l ### Linux Commands To Check The Disk And Directory Information URL: https://scriptcrunch.com/linux-commands-to-check-the-disk-and-directory-information/ Last updated: 2026-06-23T08:56:04.000Z Even though you can check the disk, directory information, and usage using the graphical user interface, it is important to know the terminal commands to check the disk information and usage of a [Linux](https://scriptcrunch.com/tag/linux/) machine. In this [tutorial](https://scriptcrunch.com/tag/tutorials/), you will learn the important commands to check the disk and directory information in Linux systems. There are two basic commands for the disk and directory. **du** and **df**. du deals with directories and df deals with the disk. ## Check Linux Disk Usage With du Command `du` command is used to determine the size of a directory. Let's say you have a directory demo and you have five directories named 1,2,3,4 and 5 inside the demo. If your current directory is a demo and if you use du it will show the size of the folder inside it. du Lets look at different flags supported by `du` command. **#1:** Displaying memory of directory in human readable form du -h **#2:** Let's say you want to find out the total size of **`/Downloads`** folder, use the command below and the last two lines will show the total size of the` **/Downloads**` folder. du -c -h /Downloads If you just want to see the size use the tail command as follows to see the last two lines. du -c -h /Downloads | tail -2 ## Check Linux Disk Space using df Command Lets look at different examples of using `df` command to check the disk space in Linux **#1:** df command gives the information about the disk space, mount point, used space, unused space, and used space in percentage. df **#2:** Getting the [innode info](https://scriptcrunch.com/what-are-hardlinks-and-softlinks-symbolic-links-in-linux-and-how-to-create-them/). df -i **#3:** Getting disk info in human-readable form (Both Kb and Mb)# df -h df -k **#4:** Getting all the info about file system and its type df -adf -T **#5:** Getting information about a specific file system type like ext3 or ext4 df - t ext3 **#6:** Getting information about the total memory of the disk. df -h --total ### Groovy Script To Retrieve Jenkins Credentials URL: https://scriptcrunch.com/groovy-script-retrieve-jenkins-credentials/ Last updated: 2026-06-23T08:56:05.000Z [Jenkins](https://scriptcrunch.com/tag/jenkins/) supports many credential types based on your needs. It could be a password, secret file, [SSH](https://scriptcrunch.com/ssh-concept/) private key, or a token. There could be many use cases to use a groovy script to deal with credentials. A few use cases are 1. You might want to create credentials in the run time. 2. You might want to use a custom Groovy code with Active choice parameters. 3. You might want to extend your [Jenkins shared library](https://devopscube.com/jenkins-shared-library-tutorial/?ref=scriptcrunch.com) for a credential to create functionality. This [tutorial](https://scriptcrunch.com/tag/tutorials/) explains how to get the stored credentials in Jenkins using a custom Groovy script and declarative pipeline script. ## Script To Retrieve Jenkins Credentials To retrieve Jenkins credentials, you should import cloudbees credentials-specific libraries. And use the `lookupCredentials` function to get all the credentials stored in Jenkins. Here is the full Groovy script to list all the Jenkins credentials. ``` import jenkins.* import jenkins.model.* import hudson.* import hudson.model.* def jenkinsCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( com.cloudbees.plugins.credentials.Credentials.class, Jenkins.instance, null, null ); for (creds in jenkinsCredentials) { println(jenkinsCredentials.id) } ``` You can test this script using the Jenkins script console. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-script-console.png) ## Get a Specific Stored Credential In the above example, we have seen how to list all the Jenkins credentials. Let's say you have a credential of type username and password and you want to retrieve those values using the script. For this, you need to know the ID of the credential. For example, if you have a credential with an ID named user-pass. Here is how the for loop will look like to extract the username and password. ``` for (creds in jenkinsCredentials) { if(creds.id == "user-pass"){ println(creds.username) println(creds.password) } } ``` If you run the whole script you should get the following output. ![jenkins groovy script credential output.](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-credential-output.png) ## How To Find Credentials Type Variables To retrieve the secrets, each credentials type has its own variables. It should be used in small letters. For example, for username and password, you can use the following variables to retrieve the value. ``` username password ``` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-credentials-variable.png) As you can see in the above image, the variables that are present during credentials creation are what we use in the code in all small letters. Let's say in the same way you have a private key variable as shown below. In this case, the variable name will be `privateKey` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-ssh-private-key.png) Here is the code to retrieve the SSH key from the id. ``` for (creds in jenkinsCredentials) { if(creds.id == "script-ssh-creds"){ println(creds.privateKey) } } ``` ## Retrieve Credentials Using withcredentials jenkins If you want to retrieve credentials using a declarative pipeline script, you can use `withCredentials` function. Here is an example of retrieving the username and password of a credential named `jenkins-docker-ssh` ``` pipeline { agent any stages { stage('Hello') { steps { withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'jenkins-docker-ssh', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { sh """ echo uname=$USERNAME pwd=$PASSWORD """ } } } } } ``` ## Conclusion In this blog, you have learned to retrieve passwords from the Jenkins credential store. It is not recommended to store credentials in Jenkins. Try to use secret management tools like Hashicorp [vault](https://scriptcrunch.com/tag/vault/) and retrieve secrets in run time for production use cases. Let us know in the comment section if you face any issues. ### What Are Hardlinks and Softlinks (symbolic links) In Linux And How To Create Them URL: https://scriptcrunch.com/what-are-hardlinks-and-softlinks-symbolic-links-in-linux-and-how-to-create-them/ Last updated: 2026-06-23T08:56:05.000Z Before understanding what hard links and soft links are, you must have an idea about innodes in [Linux](https://scriptcrunch.com/tag/linux/) Innode is related to hardlinks and softlinks. ## What is an Innode in Linux? Innode is a Unix data structure that stores information about a file or a folder. But innode does not hold the name of the file or a folder but it has a unique id for the file or a folder. Two or more files can possess the same innode id. Thats how hardlinks and softlinks work. Every hard disk has an innode table that stores the information about the files in it. By default, there will be enough innodes specific to the disk size to make sure that you won't run out of innodes. However, if you happen to run out of innodes, even if you have storage space, you won't be able to create new files on that hard disk. You can manually increase the innode numbers using some programs, which is out of the scope of this [tutorial](https://scriptcrunch.com/tag/tutorials/). So when a user tries to access a file, the innode table retrieves the file using its unique id. So whenever a file is created, it is associated with an innode id. **You Might Like:** [How to Add Sudo users in Linux](https://scriptcrunch.com/add-sudo-user-permissions-linux/) You can see the innode number of a file using the following command. sudo ls -i /etc/passwd You can find the number of innodes available in your file system using the following command. sudo df -i ## What is a Softlink in Linux? Softlink is like a pointer to a file. Softlink does not create a copy of a file, but instead, it creates a link with the original file in a different name with the same innode entry. So the original file and the linked file have the same innode entry. If you delete the original file, the link will be lost, and you won't be able to view the files using the softlink or symbolic link, or symlink. Also, if you move the original file to some other location, you won't be able to read the file using softlink. ## Creating A Softlink in Linux Let's say you have a file named `file1` , and you want to access the contents of the file name using some other name called "`file2`" from a different location; you create a softlink with the file name `file2` for `file1`. You can have `file2` in any other folder. You actually create a link for an original file in a different location. You can create a softlink using the following command. sudo ln -s \~/demo.text \~/var/www/demo-soft.txt In the above command, I created a softlink demo-soft.txt in /var/www folder for `demo.text` present in a root folder. demo.txt is the original file and demo-soft.txt is just a link file that is logically linked to `demo.text.` ## What is a HardLink in Linux? Hard links create an exact copy of a file with the same innode entry. Both original and hard-linked files will have the same innode id. Unlike softlinks, even if you delete or move the original file, you can access the contents from the linked file. ## Creating a Hard Link in Linux You can create a hard link using the following command. ln \~/demo.txt ./demo-hard.txt ### [Solved] VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine URL: https://scriptcrunch.com/solved-vboxmanage-error-component-machinewrap/ Last updated: 2026-06-23T08:56:05.000Z ## Issue When starting up Virtual Box VMs using [vagrant](https://scriptcrunch.com/tag/vagrant/) in mac, it throws the following errors. ``` VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine ``` ``` VBoxManage: error: Failed to create the host-only adapter ``` In this blog, we have given a step-by-step [guide](https://scriptcrunch.com/tag/guides/) to solve this issue. ## Solution For VBoxManage: error: Details: code This component MachineWrap interface IMachine issue happens when there is insufficient permission for the Virtual box to start up the VM in mac. Follow the steps given below to resolve this issue. **Step 1:** Open MAC system preferences **Step 2:** Select the security and privacy option. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/security-privacy.png) **Step 3:** Select the General tab and enable the lock icon to make changes. Then there will be an option to **enable system extensions**. Instead of the restart, you will see another option. Once you click that, you will see Oracle on the list. Enable that in the checkbox. It will ask for a system restart and restart the system. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/enable-oracle-permission.png) Now if you try to bring up the VM, you won't see the component MachineWrap, interface machine issue. ## VBoxManage: error: Failed to create the host-only adapter "Failed to create the host-only adapter" is also related to MAC security. You need to allow the changes in the security setting as explained in step 3 of the before section. ## Mac OS Issue: error: VBoxNetAdpCtl: Error while adding new interface There is also an issue with the new MAC OS Monterey version. Which is fixed in the **latest Virtual box build**. So you need to remove the existing version of Virtualbox and reinstall the latest build to get rid of this issue. ``` There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["hostonlyif", "create"] Stderr: 0%... Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to create the host-only adapter VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 95 of file VBoxManageHostonly.cpp ``` Let me know if it fixes your virtual box error. ## Error Creating Network With OS Monterey update you could get errors with networks if you try to create an IP other than the 198 range. To rectify this issue, open the networks file. ``` sudo vi /etc/vbox/networks.conf ``` Add the following to the file. ``` * 0.0.0.0/0 ::/0 ``` It should solve the network create error. ### [4 Months Off] TeamTreehouse Discount Coupon and Review URL: https://scriptcrunch.com/35-off-teamtreehouse-discount-coupon-and-review/ Last updated: 2026-06-23T08:56:06.000Z I joined Treehouse to learn web [development](https://scriptcrunch.com/tag/development/) basics and WordPress so I could start a website like this. Teamtreehouse is one of the best online portals for learning programming and application development. Be it mobile development or web application development, treehouse got it covered using its fine-tuned courses on all the latest technologies. ## TeamTreehouse Techdegree Holiday Offer Teamtreehouse is running a holiday offer for its Techdegree program. Offer is valid till December 27\. This is the biggest deal of the year for techdegree program. [Redeem Techdegree Holiday Offer](https://scriptcrunch.com/recommends/techdegree-holiday-offer/) ## 4 Months Off TeamTreehouse Discount Coupon Before diving into the review, we would like to share the current discounts and deals. Teamtreehouse discount coupon applies to both monthly and yearly subscriptions. It also has a[ trial program](https://scriptcrunch.com/recommends/teamtreehouse/) wherein you can avail their courses for completely free for a certain period of time. [Get 4 Months Off On Treehouse](https://scriptcrunch.com/recommends/free-basic-subscription/) ### Other Treehouse Current Discounts 1. [4 Months Free Pro Treehouse Subscription](https://scriptcrunch.com/recommends/pro-plan-treehouse/) 2. [Treehouse Tech Degree Offer](https://scriptcrunch.com/recommends/treehouse-techdegree/) ## TeamTreehouse Review In this Review, I will cover all the aspects of Treehouse, its courses and what you can really get from their offerings. ### Learning Paths You have different learning paths ( tracks ) in the treehouse dashboard. Depending on what you want to learn and develop, you can choose a learning path. Every tool or language is explained from the very basics. ![teamtreehouse discount coupon and review](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/treehosue.png) ### What You Get For Your Free Trial In free trial, you will get access to full treehouse courses. You can choose a learning path and start learning a particular technology. If you like the courses, you can [go](https://scriptcrunch.com/tag/go/) for the paid subscription. #### Course Structure Every course has lectures, quizzes, and projects. This will help you to remember the things you learned. Also for every project, there is an interactive browser-based code playground. It can be used to edit the project code and check for various other combination of your code. #### Earning Badges and Points For every course, there are badges of completion. Also, you get points for completing the tasks. This will keep you motivated and you can track your progress from the first day of your course. ## Conclusion If you are looking for an online portal for learning programming and web development, the treehouse is a great option. With a good learning community, you can learn and build web and mobile apps in a short period of time. Moreover, you can use the Teamtreehouse discount coupon to get the 4 months free offer. Alternatively, you can use [Udemy.com](https://scriptcrunch.com/recommends/udemy-online-course/) for more coding courses from different instructors. Courses are priced from free to $200\. You can all the courses on discount using coupon codes from here - [Udemy coupons.](https://crunchadeal.com/?ref=scriptcrunch.com) ## Teamtreehouse Coupon FAQ's ### Does Teamtreehouse has a Black Friday or Cyber Monday Offer?Teamtreehouse has a holiday offer for its techdegree program where you can get 10% discount on its techdegree courses. ### DataCamp Discount: Get up to 50% Discount URL: https://scriptcrunch.com/datacamp-coupon/ Last updated: 2026-06-23T08:56:06.000Z With the Datacamp discount, you can save on premium and team plans. The discount is available only for a limited time. ## \[50% OFF\] Datacamp Flash Sale Get a 60% discount on a Datacamp subscription using the flash sale. [Get Datacamp 50% Discount](https://scriptcrunch.com/recommends/datacamp-promo/) ## DataCamp Basic Free Access (Limited Acess) With Datacamp's basic account, you can have free access to limited course content. [Get Started For Free](https://scriptcrunch.com/recommends/datacamp-pricing/) ## Datacamp Key Features Overall Datacamp offers, 1. 52 skill tracks 2. 14 Career tracks 3. 300+ Courses 4. 250+ Instructors Datacamp primarily focuses on the following areas 1. Data Science 2. Data Engineering 3. Machine Learning ## Top Technologies Covered By Datacamp 1. [Python](https://scriptcrunch.com/tag/python/) 2. R 3. Scala 4. SQL 5. Git 6. Shell 7. Tableau 8. Power BI ### [Solved] Jenkins Plugin Installtion Failed: Downloaded file /var/lib/jenkins/plugins/ does not match expected SHA-1 URL: https://scriptcrunch.com/resolved-jenkins-plugin-failed/ Last updated: 2026-06-23T08:56:07.000Z ### **Issue** While installing or updating [Jenkins](https://scriptcrunch.com/tag/jenkins/) plugins, it fails and throws the following `SHA-1` error. ``` java.io.IOException: Downloaded file /var/lib/jenkins/plugins/*.tmp does not match expected SHA-1, expected 'f2ncNlydUUSPrk6SoG255v+2kQU=', actual 'lZRJco4Ouv1j0AG4Aet7HadHg/Q=' ``` Here is the reference image of the error ![Jenkins plugin installation/upgrade error](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-plugin-installtion-error-min.png) ## Solution This error could happen due to the following reasons. 1. Jenkins update center is not synced with your Jenkins 2. You are running Jenkins behind a proxy. Please find the solution for each scenarios below. ### Jenkins Update Center is not Synced Follow the below steps to rectify the sync issue. **Step 1:** [Go](https://scriptcrunch.com/tag/go/) to `manage Jenkins --> Manage Plugins` and click the advanced tab. Scroll down and towards the end of the page, you will find the `Update Site` option as shown below. Click check now and sync with the update center. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-udpate-center-min.png) **Step 2:** Restart the Jenkins server. Now if you you try to install or upgrade the plugins, you should not see the `SHA-1` error. ### Update Corporate Proxy Settings for Jenkins Plugins If you are running Jenkins behind a corporate proxy, you need to update the proxy settings for Jenkins plugin installtion and updates. If you do not have the proxy details, you can talk to your Network administrator and get the proxy details. Once you have the details, Go to `manage Jenkins --> Manage Plugins` and click the advanced tab. You will find the "HTTP Proxy Configuration" at the top. Enter the proxy details and validate it with the update center URL as shown below. > **Note:** ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-proxy-details-min.png) On successful validation, save the configurations and try installing the plugins. If the issue persists, try a server restart as well. ### [Solved] EMR Cloudformation: Error parsing parameter '--parameters': Expected: '=', received: 'EOF' for input URL: https://scriptcrunch.com/error-parsing-parameter/ Last updated: 2026-06-23T08:56:07.000Z **Issue:** While executing [AWS](https://scriptcrunch.com/tag/aws/) CLI for launching Cloudformation EMR stack, it throws the following error. ``` Error parsing parameter '--parameters': Expected: '=', received: 'EOF' for input ``` **Solution:** You will get this error if you pass the absolute template path without the `file://` at the beginning of the EM Cloudformation template or parameter file path. For example, if you pass the following ``` aws cloudformation create-stack --stack-name demo-stack --template-body /home/demo/ec2-template.yaml --parameters /home/demo/ec2-parameter.json ``` However, if you pass the template path with `file://` prefix as shown below, it should not throw any error. ``` aws cloudformation create-stack --stack-name demo-stack --template-body file:///home/demo/ec2-template.yaml --parameters file:///home/demo/ec2-parameter.json ``` This is applicable for all the aws cli parameters which requires the file path as template or a parameter. ### Script To Retrieve AWS EMR Master IP Address URL: https://scriptcrunch.com/script-retrieve-aws-emr-master-ip/ Last updated: 2026-06-23T08:56:08.000Z Somtimes it is required to fetch the EMR master IP dynamically for automation. One such use case is connecting [AWS](https://scriptcrunch.com/tag/aws/) Sagemaker notebook instances to EMR with Livy. For this, you need to have the EMR master's private IP address to be configured in the Sparkmagic configurations. ### Prerequisites 1. Python3 2. Boto3 installation 3. Valid AWS CLI access to EMR Cluster services. ## Python boto3 Script To Retrieve EMR Master IP Here is the [python](https://scriptcrunch.com/tag/python/) script that will retrieve the EMR master's private IP address using the EMR cluster id as a parameter. > **Note:** ``` import boto3 import json boto_client_emr = boto3.client("emr") cluster_id = "j-DFGDSFGREWG" def get_emr_master_pvt_ip(boto_client_emr, cluster_id): emr_list_instance_rep = boto_client_emr.list_instances( ClusterId=cluster_id, InstanceGroupTypes=[ 'MASTER', ], InstanceStates=[ 'RUNNING', ] ) return emr_list_instance_rep["Instances"][0]["PrivateIpAddress"] emr_master_ip = get_emr_master_pvt_ip(boto_client_emr, cluster_id) print("EMR master IP is" + " " + emr_master_ip) ``` ### Module Requirements 1. This script uses [AWS boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html?ref=scriptcrunch.com) python module. 2. JSON module ### Script Input The only input required for this script is the EMR cluster-ID. You can get this ID from the EMR cluster dashboard as shown below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/emr-id-min.png) In the script it is shown as `cluster_id = "j-DFGDSFGREWG"`. When you execute the script, replace the ID with your EMR cluster ID. ### Script Usage The following line of code stores the master IP in `emr_master_ip` variable. ``` emr_master_ip = get_emr_master_pvt_ip(boto_client_emr, cluster_id) ``` You can use this variable as per your requirement. `get_emr_master_pvt_ip` is the method which accepts the cluster ID variable. If you execute the given code, you will get an output with a message showing the Master IP address. It comes from the print statement in the script. Use python3 to execute the script as shown below. ``` ➜ python3 emr.py EMR master IP is 10.0.0.201 ``` ### How To Enable Docker Remote API URL: https://scriptcrunch.com/enable-docker-remote-api/ Last updated: 2026-06-23T08:56:08.000Z In this post, you will learn how to expose [Docker](https://scriptcrunch.com/tag/docker/) engines API for remote docker command execution through REST APIs ### What is Docker remote API? The primary use of a Docker remote API is to connect with the Docker engine remotely. Let's say you are running the docker host on a remote server and you want to connect to it from your laptop. For this scenario, you can use the remote API and connect to it using the REST API's as the docker engine accepts REST requests. One more use case is that let's say you have an application and you want to get the details of the containers in docker host. For this, you can use the remote API feature. #### Docker Courses You Might Like 1. [Docker Mastery: The Complete Toolset From a Docker Captain](https://scriptcrunch.com/recommends/docker-course/) 2. [Learn DevOps: The Complete Kubernetes Course](https://crunchadeal.com/coupon/the-complete-kubernetes-course-coupon/?ref=scriptcrunch.com) ## Enable Docker Remote API All the docker configurations are present in the file`/lib/systemd/system/docker.service`. In that file, there is an ExecStart parameter. Open the file`/lib/systemd/system/docker.service`, search for ExecStart and add value as shown below. ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock The above command will bind the docker engine server to the Unix socket as well as TCP port 4243\. "0.0.0.0" means docker-engine accepts connections from all IP addresses. > **Note** *Also, please add necessary firewall rules for your server to accept connection on port 4243* Now for all the changes to take place, you need to restart the daemon and Docker service. Execute the following commands to do that. sudo systemctl daemon-reload sudo service docker restart Now, remote API is enabled on your docker host. To test this, there are a few ways. ### How do I access Docker API? You can use curl command-line utility or REST APIs to access the Docker API. Both ways are explained below. ### Test using curl Get the IP address of your Docker host where you enabled remote API and execute the following command from any terminal which supports curl. You can test with the localhost as well. > **Note:** curl http://localhost:4243/version curl http://35.225.233.5:4243/version The above command will output all the images in your docker host in JSON format. **You Might Like:** [Docker Useful Hacks](https://scriptcrunch.com/docker-useful-hacks/) ### Test using a REST client You can test the API using REST client like Postman. If you use the following URL in your REST client, you will get the JSON output in a prettified manner as shown in the image below. ``` http://192.168.5.5:4243/images/json ``` ![enable docker remote API](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/1.png) In this [tutorial](https://scriptcrunch.com/tag/tutorials/), you learned to enable Docker remote API. For better security, you can use certificates with the REST requests. That we will cover in another detailed post If you face any issues with this setup, let us know in the comments section. ### How To Install and Configure MariaDB on Centos/RedHat URL: https://scriptcrunch.com/install-configure-mariadb-centos-redhat/ Last updated: 2026-06-23T08:56:08.000Z I want to install MariaDB on Redhat. How do I install MariaDB from command Line? **About MariaDB**: It is an open-source [database](https://scriptcrunch.com/tag/databases/) solution. #### MariaDB Quick Installation on Centos/Redhat **Step 1:** Install MariaDB server and client sudo yum install mariadb-server mariadb -y **Step 2:** Start and enable MariaDB services sudo systemctl start mariadb sudo systemctl enable mariadb **Step 3:** Check the status of MariaDB service sudo systemctl status mariadb #### How to Secure MariaDB Installation Set password for your MySQL instance using the following command. The command will prompt for the current root password, you can hit enter as there is no default password. All the other prompts are self-explanatory. sudo mysql\_secure\_installation #### How To Login To MariaDB server From CLI Login using MySQL client terminal using the root password using mysql command. mysql -u root -p #### How To Create a MariaDB User and a Database **Step 1:** Create a user named `myuser`. Replace `s3cret` with a required strong password. CREATE USER 'myuser'@'localhost' IDENTIFIED BY 's3cret'; **Step 2:** Create a db named mydb. ``` CREATE DATABASE mydb; ``` #### How To Grant Privileges To a MariaDB Database User **Step 1:** Grant all privileges on the `mydb` database to the `myuser` user. GRANT ALL PRIVILEGES ON mydb.\* TO 'myuser'@'localhost'; **Step 2:** Flush the privileges and exit the MySQL terminal. ``` FLUSH PRIVILEGES; exit ``` ### Installing and Setting up a WordPress on RHEL 7 / CentOS 7 URL: https://scriptcrunch.com/install-configure-wordpress-rhel/ Last updated: 2026-06-23T08:56:09.000Z ### Basic Requirements **Step 1:** Connect to the server using key or user/password [ssh](https://scriptcrunch.com/ssh-concept/) \-i \~/.ssh/demo.pem [ec2](https://scriptcrunch.com/tag/ec2/)\-user@34.218.66.191 **Step 2:** update yum repo metadata. sudo yum update -y **Step 3:** Install wget sudo yum install -y wget ### Install LAMP (Linux, Apache, MySql \[mariaDB\] and PHP) stack **Step 1:** Install, start, enable and check the status of Apache web server (httpd) sudo yum install -y httpd sudo systemctl start httpd sudo systemctl status httpd sudo systemctl enable httpd > [Serverpilot WordPress management](https://scriptcrunch.com/recommends/serverpilot/) **Step 2:** Install and start MariaDB (MySQL) sudo yum install -y mariadb-server mariadb sudo systemctl start mariadb sudo systemctl enable mariadb **Step 3:** Configure MariaDB. Enter appropriate values on each prompt. sudo mysql\_secure\_installation **Step 4:** Install php, php modules and restart httpd sudo yum install -y php php-mysql php-gd sudo systemctl restart httpd **Step 5:** To test php installation, create simple PHP script. Open a test.php file using the following command. sudo vi /var/www/html/demo.php **Step 6:** Copy the following php script to the file and save it. **Step 7:** Now, try accessing the demo script using the public IP followed by demo.php as shown below. If every configuration is correct, you will see a web page with all the installed php information. http:///demo.php ### Configure Database User and Password For Wordpress We should not use the root user and password for WordPress. It should be used only for administrative purposes. So let's create a new [database](https://scriptcrunch.com/tag/databases/), user, and password for the WordPress website we are going to set up. **Step 1:** Login to MariaDB (MySQL) with root credentials you created. It will open the MariaDB shell where you can run the scripts for managing [databases](https://scriptcrunch.com/tag/databases/) and its users. mysql -u root -p **Step 2:** Create a database named wordpress. You can give your own database name. CREATE DATABASE wordpress; **Step 3:** Now create a user named wordpress\_admin for managing the wordpress database. You can choose your database username and password. CREATE USER wordpress\_admin@localhost IDENTIFIED BY 'password'; **Step 4:** Grant all database privileges to wordpress\_admin on wordpress database. GRANT ALL PRIVILEGES ON wordpress.\* TO wordpress\_admin@localhost IDENTIFIED BY 'password'; **Step 5:** Flush the privileges using the following command. FLUSH PRIVILEGES; **Step 6:** Exit the database shell exit ### Install and Configure Wordpress Now that we have all the components required for running WordPress, we will [go](https://scriptcrunch.com/tag/go/) ahead with the WordPress installation. **Step 1:** Download latest WordPress wget http://wordpress.org/latest.tar.gz **Step 2:** Extract the tar file. tar -xvf latest.tar.gz **Step 3:** Copy wordpress folder content to /var/www/html folder cp -vR wordpress/\* /var/www/html/ **Step 4:** Change the owner of /var/www/html to apache user. Because the WordPress files will be manipulated by httpd apache user. sudo chown -R apache:apache /var/www/html/\* #### Configuring Wordpress **Step 1:** cd in to /var/www/html folder /var/www/html **Step 2:** Copy wp-config-sample.php to wp-config.php file. cp wp-config-sample.php wp-config.php **Step 3:** Open wp-config.php file and add the database details in the following parameters. // \*\* MySQL settings - You can get this info from your web host \*\* // /\*\* The name of the database for WordPress \*/ define('DB\_NAME', 'wordpress'); /\*\* MySQL database username \*/ define('DB\_USER', 'wordpress\_admin'); /\*\* MySQL database password \*/ define('DB\_PASSWORD', 'password'); That's it! If you browse to the IP you will be able to access the WordPress website Also read, 1. [How to Setup Free SSL (https) for WordPress Website using Cloudflare](https://comtechies.com/setup-free-ssl-https-wordpress.html?ref=scriptcrunch.com) 2. [How to SetUp High-Performance WordPress on Cloud/VPS](https://comtechies.com/secure-high-performance-wordpress.html?ref=scriptcrunch.com) ### Getting Started With Go: Beginner Tutorial URL: https://scriptcrunch.com/golang-for-devops/ Last updated: 2026-06-23T08:56:09.000Z Create a file named `main.go` in your project directory. package main import "fmt" func main() { fmt.Println("Hellow World Scripties") } From the above code, you should be having the following questions. 1. How do I run this code? 2. What does **package main** mean? 3. What does **import fmt** mean? 4. What does **func** mean? 5. How is the **main.[go](https://scriptcrunch.com/tag/go/)** file organized? ### How do I run this code Open the terminal and browse to your project folder containing main.go file Execute your main.go program using the following command. go run main.go Following are the available commands in Go. In that, we have used **run** command to execute our hello world program. build compile packages and dependencies clean remove object files doc show documentation for package or symbol env print Go environment information bug start a bug report fix run go tool fix on packages fmt run gofmt on package sources generate generate Go files by processing source get download and install packages and dependencies install compile and install packages and dependencies list list packages run compile and run Go program test test packages tool run specified go tool version print Go version vet run go tool vet on packages ### What does **package main** mean: Every go program must start with a package declaration. It is for code organization and reusability. There are two types of packages 1. **Executable:** Can be executed directly through a command line or a click. This is normally used for creating small utilities. Each executable package is meant for some functionality. Once such example is creating a [database](https://scriptcrunch.com/tag/databases/) backup. 2. **Reusable:** Reusable packages are helper functions or reusable codes or a library that can be called within other program files. How do you know you are creating an **executable** package or **reusable** package? If your package declaration starts with **main**, it means you are creating an executable package. Any name other than **main** will be a reusable package. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/untitled-diagram.jpg) ### What does **import fmt** mean? It imports a package named fmt. This package helps in printing text to the standard output. It is a standard library. You can view the list of standard libraries available from here **func main()** func represent function. The go program execution starts from the main function. This main function will always reside in the main package file. **fmt.Println("Hellow World Scripties")** prints the text mentioned inside the quotes to the standard output. ### [Solved] Helm - Error: no available release name found URL: https://scriptcrunch.com/helm-error-no-available-release/ Last updated: 2026-06-23T08:56:10.000Z > [helm](https://scriptcrunch.com/a-kubernetes-helm-guide-for-the-cka-exam/) If you get no available release error in helm, it is likely due to the RBAC issue. While configuring helm, you would have probably created a RBAC with a service account named tiller which binds to a clusterRoleBinding with cluster admin credentials. Here is how the RBAC file looks like. ``` apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: tiller namespace: kube-system ``` However, when you initialize helm, you would have missed to pass the service account with the init command. ### Error: no available release name found Resolution The resolution is pretty simple. You just need to pass the created service account with the init command.. Before you do this delete the existing tiller deployment using the following command. ``` kubectl delete deployment tiller-deploy -n kube-system ``` Make sure the tiller-deploy deployment is deleted using the following command. ``` kubectl get deployment tiller-deploy -n kube-system ``` Now, re-initialize helm with service account. ``` helm init --service-account=tiller ``` Now if you try deploying using helm, you should not be seeing "Error: no available release name found" error. ### Docker Useful Hacks: Cheat Sheet For Beginners to Experts URL: https://scriptcrunch.com/docker-useful-hacks/ Last updated: 2026-06-23T08:56:10.000Z [Docker](https://scriptcrunch.com/tag/docker/) has many commands to remember. If you are starting up with docker, We are pretty sure that you will have a hard time remembering all those commands and to manage containers. In this article, we have explained the necessary command to make you more productive while working with docker. ## Docker Useful Hacks The following section contains useful hacks that help you while working with docker. We don't recommend using the bulk stopping and removing commands in production. This is just for dev purposes. ### Run docker without sudo When you install docker, you have to use sudo to work with docker commands. To avoid using sudo, you need to add your current user to docker group using the following command. Restart the terminal for the changes to take place usermod -aG docker ${USER} Execute the following command if you do not want to restart the terminal newgrp docker ### Connecting to Docker Container Use "docker exec" command to connect to a running container. This command will attach a shell session in your current terminal. docker exec -it bash docker exec -it sh ### Remove Unused Docker Objects The best way to remove all stopped, dangling and unused networks is through prune command. ``` docker system prune ``` You can remove all unused [docker volumes](https://scriptcrunch.com/docker-volume/) using volume prune command. ``` docker system prune --volumes ``` ### Stopping all containers at once docker stop $(docker ps -a -q) To forcefully stop, docker stop -f $(docker ps -a -q) ### Removing all containers at once ``` docker rm $(docker ps -a -q) ``` To forcefully remove, ``` docker rm -f $(docker ps -a -q) ``` ### Removing all docker images at once ``` docker rmi $(docker images -q) ``` To forcefully remove, ``` docker rmi -f $(docker images -q) ``` ### Assign a name to the container To assign a name to a container, use the "--name" parameter as shown below. ``` docker run -d --name ubuntu/apache ``` ### List all running containers To list all the running containers, you can use the docker ps command docker ps ### List all containers To list all running, stopped and exited containers, you can use the -a flag. docker ps -a ### List all images To list all the available docker images in your host, use the following command. docker images ### Remove unwanted/intermediate/untagged images Most of the times while building new images, there is a possibility of untagged, intermediate images that might eat up your disk space as well as increases your images list. To clean up those images, you can use the following command. ``` docker rmi $(docker images --filter "dangling=true" -q --no-trunc) ``` ### How to Run Commands in a Stopped Container URL: https://scriptcrunch.com/run-commands-stopped-container/ Last updated: 2026-06-23T08:56:10.000Z There are few situations in which you might want to get into the container shell or may be run a single command in a stopped container. Situations like, 1. You started building an image and it stopped at some point. You are only left with an intermediate container and you want to troubleshoot it. 2. The image you built is not starting up and you want to into the containers shell for [troubleshooting](https://scriptcrunch.com/tag/troubleshooting/). In this [guide](https://scriptcrunch.com/tag/guides/), you will learn how to run commands against a stopped [docker](https://scriptcrunch.com/tag/docker/) container. ## Run Commands in a Stopped Container Ther is no way you can run commands in a stopped container as the container needs to be in running state for getting the shell access or for executing commands. For both scenarios explained above, there is one solution. You need to commit the stopped container to an image and then run a container in interactive mode to gain access to the shell or terminal. Follow the instructions given below.Commit the image of the stopped container using the command syntax shown below. 1 . Commit the image of the stopped container using the command syntax shown below. docker commit (stopped container name/id) (user defined image name) For example, docker commit 8bd2a352dd5a michael/apache 2\. Now, run the image in interactive mode using the new committed image name as shown below. docker run -it (image name) (command) For example, docker run -it michael/apache /bin/sh That's it. Now you will have a terminal session to your container and you can run commands against it. ### [Solution] Git Clone Error: java.io.IOException: error=2, No such file or directory URL: https://scriptcrunch.com/git-clone-error-java-io-ioexception/ Last updated: 2026-06-23T08:56:11.000Z ### Issue: In [Jenkins](https://scriptcrunch.com/tag/jenkins/), when I am trying to clone a git repository I am getting the following error. Attempting to resolve master from remote references... --version # timeout=10 ls-remote https://github.com/repo.git # timeout=10 java.io.IOException: error=2, No such file or directory org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed ### Solution: This is a common issue which occurs when you are configuring a new Jenkins or configuring it for the first time. Make sure you have the following settings already configured. It could be because of these reasons as well. 1. Git should be installed on the slave where you are trying to clone the repo. 2. Your git repo should be accessible from the slave machine. 3. You should have [Git Plugin](https://plugins.jenkins.io/git?ref=scriptcrunch.com) installed on Jenkins If the above prerequisites are met and you are getting the error, then is a Jenkins git configuration issue. You need to configure git on Jenkins. ### Jenkins Git Configuration **Step 1:** Login to your slave machine and get the git executable path using the following command. which git You should see something as shown below. \[jenkins@jenkins-slave \~\]$ which git /bin/git \[jenkins@jenkins-slave \~\]$ `/bin/git` is the git executable location **Step 2:** [Go](https://scriptcrunch.com/tag/go/) to `Manage Jenkins` \--> `Global Tool Configuration` ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/jenkins-git-issue.png) **Step 3:** Add the git executable path you got in Step 1 as shown below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/git-executable-jenkins.png) Thats it! now if you build your Jenkins jobs, you should not see the error! Please comment below if you think there are more edge cases in this type of errors. ### How To Add Sudo User and Permissions in Linux URL: https://scriptcrunch.com/add-sudo-user-permissions-linux/ Last updated: 2026-06-23T08:56:11.000Z Sudo user in [Linux](https://scriptcrunch.com/tag/linux/) will have permissions similar to a root user. With full sudo privileges, a user will be able to perform any operations on the Linux system. It is very important to categorize a user as a sudo user based on the use case. In this [guide](https://scriptcrunch.com/tag/guides/), we will look in to the following. 1. Create a new Linux user 2. Adding full sudo privileges to a user 3. Adding sudo privileges for specific command execution. ### Create a new Linux user **Step 1:** Login to your server as root. **Step 2:** Create a user using `useradd` command. Replace username with your custom user. sudo adduser username **Step 3:** Set a password for the user. sudo passwd username You will be prompted for updating the new password. Enter the required password. Changing password for user [jenkins](https://scriptcrunch.com/tag/jenkins/). New password: Retype new password: passwd: all authentication tokens updated successfully. ### Add sudo Privileges to a User Now lets make our new user or an exiting user a sudo user. **Step1:** Add the user to wheel group. usermod -aG wheel username > **Note** **Step 2:** Execute `visudo` command to open `/etc/sudoers` file. visudo **Step 3:** Make sure the following line is uncommented in the file. %wheel ALL=(ALL) ALL By default, even if a user is part of `wheel` group, you need to provide the password every time you run a command as sudo. If you need password less sudo access, you need uncomment the following where it has `NOPASSWD` and save the file using `ESC + w + q + !` %wheel ALL=(ALL) NOPASSWD: ALL **Step 4:** Now lets test the sudo user by logging in as the user. su username Now, try running sudo commands. It should work based on your password preferences (with or without password) you set for wheel group. ### Adding sudo privileges for specific command execution. There are scenarios where you might want only specific commands to be run a sudo privileges for a specific user. Lets see how we can achieve it. You can group the set of commands to be run under `Cmnd_Alias` For example, if you open the `/etc/sudoers` file, you can find the following aliases. \## Command Aliases ## These are groups of related commands... ## Networking # Cmnd\_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool ## Installation and management of software # Cmnd\_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum ## Services Cmnd\_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable Lets say, you want a user to have only permissions to run commands under the `SERVICES` alias, you need to have the following entry in the `/etc/sudoers` file username ALL = SERVICES > **Note**`Cmnd_Alias` ### Linux Academy Coupon and Review: Get 24% Off on Annual Plan URL: https://scriptcrunch.com/linuxacademy-coupon/ Last updated: 2026-06-23T08:56:11.000Z [Linux](https://scriptcrunch.com/tag/linux/) Academy is one of the best websites for learning Linux, [DevOps](https://scriptcrunch.com/tag/devops/) and cloud computing. DevOps and cloud computing skills are very sought after skills in the market now. Linux Academy provides great on-demand training on these sought-after skills. In this article, we have added Linuxacademy coupon to get the discount on the subscription. **You Might Like:** [Pluralsight Free Access](https://devopscube.com/pluralsight-free-subscription/?ref=scriptcrunch.com) ## LinuxAcademy Coupon and Promo Code Linux Academy courses are paid. You have to either pay monthly or yearly to access all its courses. To save money for you we have found a great **Linuxacademy coupon** to get you 24% off on its yearly subscription and an additional 10% off from stacksocial. **Offer Link:** [60% Off Linux Academy Deal](https://scriptcrunch.com/recommends/linux-academy-coupon/) ### Courses Offered By Linux Academy Linux Academy offers courses on the following main domains. 1. Linux beginner to professional training and certification courses. 2. DevOps tools and certification courses (Chef, puppet, [docker](https://scriptcrunch.com/tag/docker/), [ansible](https://scriptcrunch.com/tag/ansible/) etc..) 3. Cloud computing certification courses ([AWS](https://scriptcrunch.com/tag/aws/), Google cloud, Azure etc) ### Linux Academy Review If you an IT professional and looking forward to learning new technologies, Linux academy is for you. As you know, Linux, DevOps and cloud computing are the leading domains in terms of well-paid salaries. You can get trained in all these technologies from Linux Academy trainers. ### Pricing Linux Academy offers both monthly and yearly subscription. Monthly Subscription: $49 Yearly Subscription: $444 You can get 24% Off using our exclusive deal. That is, you can get the annual subscription for 24% Off. **Offer Link:** [24% Off Linux Academy Deal](https://scriptcrunch.com/recommends/linux-academy-coupon/) ### Teaching Method All the Linuxacademy courses are on-demand courses. You can access the courses anytime and anywhere you want. It also offers mobile applications for viewing content offline. This is a great feature. ### Best Features Following are the best features of Linuxacademy. 1. Unlimited access 2. Mobile apps for offline viewing. 3. 6 virtual servers for practicing the classes. 4. Certificate of completion. 5. Tech puzzles and quizzes. 6. Best in class instructor and community support. ### Conclusion Even though LinuxAcademy is paid, it is worth spending the subscription charge to skill up your career. Also, using our **Linuxacademy coupon**, you can get the best deal on the subscription charges. You can also checkout pluralsight for IT courses. It offers many IT related online training for developers and devops professionals. You can check out pluralsight offers from here --> [Pluralsight Promo code](https://devopscube.com/pluralsight-coupons-offers/?ref=scriptcrunch.com) ### Hashicorp Vault Setup: Getting Started Guide URL: https://scriptcrunch.com/hashicorp-vault-setup/ Last updated: 2026-06-23T08:56:12.000Z In this [guide](https://scriptcrunch.com/tag/guides/), you will learn the latest Hashicorp [vault](https://scriptcrunch.com/tag/vault/) setup using step by step instructions. The backend for vault storage used is server Filesystem ## Hashicorp Vault Setup Follow the step by step `instructions` given below to get a working vault setup with UI. > **Note:**[development](https://scriptcrunch.com/tag/development/) **Step 1:** [Go](https://scriptcrunch.com/tag/go/) to Hashicorp vault downloads page and download the latest package. wget https://releases.hashicorp.com/vault/1.0.1/vault\_1.0.1\_linux\_amd64.zip **Step 2:** Unzip the package unzip vault\_1.0.1\_linux\_amd64.zip **Step 3:** Move the vault executable to /usr/bin sudo mv vault /usr/bin/ **Step 4:** verify vault command by checking its version. vault -v **Step 5:** Enable vault command completion. vault -autocomplete-install **Step 6:** Create vault data folder. sudo mkdir /vault-data **Step 7:** Create vault config file in hcl format as shown below. ui = true storage "file" { path = "/vault-data" } listener "tcp" { address = "0.0.0.0:8200" tls\_disable = 1 } **Step 8:** Start the vault server in the background. vault server -config=config.hcl & **Step 9:** Initialise vault to get the keys. vault operator init It will output 5 unseal keys and a root key as shown below. Note down those keys. Root key will be used to login to vault CLI and UI. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/vault-keys-initialization.png) **Step 10:** By default vault will be sealed. It should be unsealed with minimum of three unseal keys as shown below. vault operator unseal A621ZvA8JyQ8TIu30PwD6u1yFfTVFuxczIHw9Ls5KV8s vault operator unseal KMoQ2CzF7lKN6s/rmoUorX9PGQSa1F33PHq/q7wpe3w3 vault operator unseal 9YRVkV5x93xNEEzeBZmnr/4XALt6D7xR/wOKnemPuLBb Now if you check the vault status, it should say false for sealed parameter as shown below. ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/unsealed-vault.png) > **Note:step 9** **Step 11:** You can also access the vault UI on port 8200 of your vault server. For example, http://35.192.109.160:8200/ui/ ![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/vault-ui.png) You can login to the UI using the root key you got in **step 9**. ### Jenkins Installtion Guide: Step by Step Instruction For Linux URL: https://scriptcrunch.com/jenkins-installtion-guide/ Last updated: 2026-06-23T08:56:12.000Z This [guide](https://scriptcrunch.com/tag/guides/) will help in [Jenkins](https://scriptcrunch.com/tag/jenkins/) installation using step by step instructions. It explains the different methods to setup jenkins on a [Linux](https://scriptcrunch.com/tag/linux/) server. ### Hardware Requirements Jenkins server should meet the following minimum hardware requirements to run smoothly. 1. 2GB RAM 2. 30GB Hard disk (Better to have a additional disk for storing Jenkins data) > Note: This tutorila will work only on Redhat based Linux systems (Redhat & centos) ### Prerequisites Following are the two mimimim requirements for Jenkins setup. 1. Java 2. Git (Not mandatory) #### Java Installation Java is a primary requirement for Jenkins as it is a java based application. **Step 1:** Install java jdk sudo yum install -y java-1.8.0-openjdk-devel **Step 2:** Verify java installation java -version #### Git Installation git is not a mandatory requirement. However, most of your Jenkins operations will be based on git. So it is better to have it installed on the Jenkins server. **Step 1:** Install git sudo yum install -y git **Step 2:** Verify git installation git --version ## Jenkins Installation Methods Jenkins can be installed in the following ways 1. Using yum repository 2. Using jenkins war file ### Jenkins Installation Using yum Repo **Step 1:** Add the Jenkins repo to the server sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key **Step 2:** Using the following command, find the specific version of Jenkins that you need. sudo yum --showduplicates list jenkins | expand **Step 3:** Install jenkins by following the below syntax. sudo yum install -y jenkins-(package-info) For example, sudo yum install -y jenkins-2.156-1.1 **Step 4:** Start and enable jenkins service sudo chkconfig jenkins on sudo systemctl start jenkins **Step 4:** check the jenkins service status sudo systemctl status jenkins You will be able to access Jenkins on port 8080. ### Jenkins Installation Using Jenkins war File **Step 1:** Download the latest jenkins war file [from here](http://mirrors.jenkins.io/war-stable/latest/jenkins.war?ref=scriptcrunch.com) wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war **Step 2:** Run the jar java -jar jenkins.war If you want to run jenkins on a custom port, execute the jar with --port flag as shown below. java -jar jenkins.war --httpPort=9090 ### Other Jenkins Resources: 1. [How To Backup Jenkins Data And Configurations](https://devopscube.com/jenkins-backup-data-configurations/?ref=scriptcrunch.com) 2. [How To Setup Custom UI Theme For Jenkins](https://devopscube.com/setup-custom-materialized-ui-theme-jenkins/?ref=scriptcrunch.com) ### How To Create CA and Generate SSL/TLS Certificates & Keys URL: https://scriptcrunch.com/create-ca-tls-ssl-certificates-keys/ Last updated: 2026-06-23T08:56:12.000Z This [guide](https://scriptcrunch.com/tag/guides/) explains the process of creating CA keys and certificates and uses them to generate SSL/TLS certificates & keys using SSL utilities like OpenSSL and cfssl. Terminologies used in this article: 1. PKI - Public key infrastructure 2. CA - Certificate Authority 3. CSR - Certificate signing request 4. SSL - Secure Socket Layer 5. TLS - Transport Layer Security 📌 If you are looking for SSL certificates for your website, look at [Namecheap SSL Certificates.](https://namecheap.pxf.io/yqDOqN?ref=scriptcrunch.com) ### Certificate Creation Workflow Following are the steps involved in creating CA, SSL/TLS certificates. 1. **CA Key and Certificate Creation** 1. Generate a CA private key file using a utility (OpenSSL, cfssl etc) 2. Create the CA root certificate using the CA private key. 2. **Server Certificate Creation Process** 1. Generate a server private key using a utility (OpenSSL, cfssl etc) 2. Create a CSR using the server private key. 3. Generate the server certificate using CA key, CA cert and Server CSR. > **Also Read:** [Types of SSL/TLS Certificates Explained](https://scriptcrunch.com/types-of-ssl-tls-certificates-explained/) This guide explains the steps required to create CA, SSL/TLS certificates using the following utilities. 1. openssl 2. cfssl > This guide is focused on creating your own CA and SSL/TLS certificates. It is meant for [development](https://scriptcrunch.com/tag/development/) or to use within an organizational network where everyone can install the root CA certificate that you provide. For usage in public (internet) facing services, you should consider using any of the available third party CA services like Digicert etc. ### Generating Certificates Using OpenSSL Openssl utility is present by default on all [Linux](https://scriptcrunch.com/tag/linux/) and Unix based systems. #### **Generate CA Certificate and Key** **Step 1:** Create a openssl directory and CD in to it. ```sh mkdir openssl && cd openssl ``` **Step 2:** Generate the CA private key file. ```sh openssl genrsa -out ca.key 2048 ``` **Step 3:** Generate CA x509 certificate file using the CA key. You can define the validity period of the certificate in days. Here we have mentioned 1825 days. The following command will prompt for the cert details like common name, location, country, etc. ```sh openssl req -x509 -new -nodes \ -key ca.key -sha256 \ -days 1825 -out ca.crt ``` Or , you can pass these information in the command as well as shown below. ```sh openssl req -x509 -new -nodes \ -key ca.key -subj "/CN=scriptcrunch/C=US/L=CALIFORNIA" \ -days 1825 -out ca.crt ``` #### Generate SSL/TLS Certificates **Step 1:** Create a server private key ```sh openssl genrsa -out server.key 2048 ``` **Step 2:** Create a configuration file named` csr.conf` for generating the Certificate Signing Request (CSR) as shown below. Replace the values as per your needs. > **Note: alt\_names should contain your servers DNS where you want to use the SSL.** Also, add all the IPs associated with the server if clients connect using an IP instead of a DNS name. ```sh cat > csr.conf < ca-csr.json < ca-config.json < server-csr.json < Note: hosts entry in the json should contain the server DNS or Public/Private IP address, hostnames, local DNS etc based upon the interface you want to receive the authentication requests. For example, you could have a server with TLS authentication over public internet and private network within the organisation. **Step 2:** Now create the server SSL certificates using CA keys, certs and server csr. This will create server-key.pem (Private key) and server.pem (Certificates) files. ```sh cfssl gencert \ -ca=ca.pem \ -ca-key=ca-key.pem \ -config=ca-config.json \ -profile=web-servers \ server-csr.json | cfssljson -bare server ``` ### Types of SSL/TLS Certificates Explained - Beginners Guide URL: https://scriptcrunch.com/types-of-ssl-tls-certificates-explained/ Last updated: 2026-06-23T08:56:13.000Z In this [guide](https://scriptcrunch.com/tag/guides/), we have explained the different types of SSL/TLS certificates with its use cases. **Terms Used:** 1. **CA** \- Certificate Authority 2. **Root CA** \- Root Certificate Authority Certificate (Public) 3. **SSL** \- Secure Socket Layer 4. **TLS** \- Transport Layer Security ## Types of SSL/TLS Certificates There are three types of SSL Certificates. 1. Self Signed SSL 2. SSL from Trusted Certificate Authorities 3. SSL signed by own Certificate Authority Let's have a look at each type and its use cases. ### **Self Signed Certificate** Self-signed certificates are generated without a Certificate Authority. Whenever you try to access the website or service which uses the self-signed certificate it will always throw a browser warning saying that your connection is not secure. Also, it doesn't have an expiry date. > **Use Case:** ### **Certificates Signed By Trusted CA** There are Certificate Authorities trusted by all web browsers. Normally these are paid services (Symantec, Comodo, DigiCert etc). In this model, the CA vendor will do validations to make sure the requested party owns the domain for which the SSL is requested for. When you access a website which uses an SSL certificate signed by a trusted CA, you will not see the warning sign as the browser trust these Certificate Authorities by default. [Letsencrypt](https://letsencrypt.org/?ref=scriptcrunch.com) is a free open source trusted CA. > **Use Case:** ### **Certificates Signed By Your Own CA** You can create your own CA certificate and use it to sign the SSL certificates. It is normally used within an organisations network or authentication between specific services which is limited to the organisation network. In this model, the root CA cert will be installed on all the clients/servers which use SSL for authentication. > **Use Case:** **Read Next:**[How To Create CA and Generate SSL/TLS Certificates & Keys](https://scriptcrunch.com/create-ca-tls-ssl-certificates-keys/) ### How To Install and Configure Terraform URL: https://scriptcrunch.com/how-to-install-and-configure-terraform/ Last updated: 2026-06-23T08:56:13.000Z Terraform can be installed in the following platforms 1. MAC 2. [Linux](https://scriptcrunch.com/tag/linux/) 3. Solaris 4. Windows 5. FreeBSD 6. OpenBSD Follow the steps given below to install and configure terraform in your system. **Step 1:** Head over to the terraform downloads page -> [Terraform Downloads](https://www.terraform.io/downloads.html?ref=scriptcrunch.com) **Step 2:** Download the zip file for your platform. All packages are available in zip format. **Step 3:** Unzip the package using unzip utility that is supported in your platform. For example, for Linux, unzip terraform\_0.11.8\_linux\_amd64.zip **Step 4:** Terraform is a bundled executable and you can directly execute the unzipped terraform file using ./ from the location you have the terraform executable file. For example, $ ./terraform version Terraform v0.11.8 You can add the unzipped terraform executable to the system path. So that you can execute the terraform command from any path in the system. You can check the system path locations using the following command. echo $PATH For Linux, you can add it to /usr/local/bin. **Note:* For windows, its* a exe *and you can directly install it like you install other* exe *applications.* ### AWS Certification: IAM Essentials and Concepts Cheat Sheet URL: https://scriptcrunch.com/aws-certification-iam-essentials-cheat-sheet/ Last updated: 2026-06-23T08:56:13.000Z In this IAM essentials, we will look into the important aspects of IAM and its functionalities. ### IAM Basics 1\. [AWS](https://scriptcrunch.com/tag/aws/) Identity and Access Management (IAM) - Create users and groups to manage your AWS resources. Individual permissions can be applied using policies. 2\. Granular policies can be applied to users and groups on AWS resources (eg: start instances, stop instances etc..) 3\. IAM also provides federated access. Using which, anyone without aws credentials can use AWS console or API's. The access can be configured with services like AD, AWS Directory services, Amazon Cognito or any other open Id services like facebook and google. \[alert-announce\] **RECOMMENDED COURSES** [**AWS Certified Solutions Architect (2018**)](https://comtechies.com/recommends/certified-architect?ref=scriptcrunch.com) **[AWS Certified Developer Associate level (2018)](https://comtechies.com/recommends/aws-developer-course?ref=scriptcrunch.com)** **[AWS Certified SysOps Administrator Associate (2018) ](https://comtechies.com/recommends/sysops-course?ref=scriptcrunch.com)** \[/alert-announce\] ### IAM Authentication 1\. Supports multifactor authentication. 2\. Supports temporary security credentials for accessing AWS services using STS (security token service). #### Temporary Credential Scenarios **Identity Federation** You can have the following identity federation schemes. 1\. Enterprise identity federation: Uses Security Assertion Markup Language (SAML) 2.0\. Can be used with Microsoft AD FS, Shibboleth etc. Basically, any identity provider with SAML 2.0 support can create a single sign-on system using STS. You can also use a custom federation service using URLs ( code based) to connect to AWS using STS tokens. ![aws iam essentials](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/aws-iam-sts.png) 2\. Web-based Federation: using openId like facebook, google, amazon cognito etc.. 3\. Cross-account Access Role: You can create IAM roles with permissions for other AWS linked accounts or third party accounts to access resources on your account. 4\. [ec2](https://scriptcrunch.com/tag/ec2/) instance role: Rather than saving the access and secret key on the server for API calls, you can create a role and attach it to the instance. So you can make API calls without a permanent access key and secret key. #### IAM user Credentials An IAM user can have the following type of credentials. 1\. Access Keys and password (For CLI, API access). You can set policies for passwords. 2\. X.509 (For CLI access) 3\. [SSH](https://scriptcrunch.com/ssh-concept/) keys (For code commit ) Note: User access keys and X.509 certificates can be rotated. #### IAM roles An IAM roles are designed to make API and CLI calls to AWS services without an Access Key and Secret key. Once you attach a role to an ec2 instance, it will be able to make API calls to allowed services in the policy which is attached to the role. You can attach a role to an IAM user also. 1\. You can have a maximum of 250 roles. You can increase the limit using special request form. If you want many roles, you can [go](https://scriptcrunch.com/tag/go/) for temporary access using STS. 2\. You cannot attach a role to a group. 3\. You cannot attach a role to a running ec2 instance. 4\. You can also attach a role to ASG launch configuration. 5\. You can restrict an IAM user to attach only specific roles to instances. ### IAM Service Role A service role is an IAM role which is associated with AWS managed services like EMR, Elastic Bean Stalk, Ops works etc. A service role is required by these managed services to assume a role in making API calls to other AWS services. ### IAM Instance Profile Instance profile is a container to hold an IAM role. This can be attached to an instance. When you create a role using AWS management console, by deafult an instance profile will be created with the same name as the roles name. Whereas when you create a role using CLI, only role will be creates. You need to create an instance profile with the same name as the role or a different name. Note: Please help us update this doc if you think some more information can be added. ### Complete DevOps Tutorial Series URL: https://scriptcrunch.com/devops-tutorial-series/ Last updated: 2026-06-23T08:56:14.000Z The aim of this [tutorial](https://scriptcrunch.com/tag/tutorials/) series is to take anyone from zero to [devops](https://scriptcrunch.com/tag/devops/). We will cover each and every step required you to practice devops and learn automation tools. All the tutorial series will contain enough information and linked resources to get a good understanding of the tools and technologies explained. ## DevOps Tutorial Series: Learning Path This tutorial series is split into multiple parts. It is structured in a way to get started from scratch for absolute beginners. ### Introduction and Basics --- Introduction to DevOps \[[What Does DevOps Really Mean](https://devopscube.com/what-is-devops-what-does-it-really-mean/?ref=scriptcrunch.com)\] [Linux](https://scriptcrunch.com/tag/linux/) \- Linux Flavorus, File System and Basic Operations Linux - User Management and File Permissions Linux - Installing and managing applications Linux - Networking and Firewall --- **Online Course:** [Learn DevOps: Continuously Deliver Better Software](https://scriptcrunch.com/recommends/complete-devops-course/) --- ### Virtualization, Cloud Computing, and Server Provisioning --- Understanding Virtualization and Cloud Computing Creating a Virtual Machine on [AWS](https://scriptcrunch.com/tag/aws/) cloud Connecting to Virtual Machine and Basic Operations ### Web Servers, Websites, Databases and Two-Tier Architecture --- In this series, we will cover, web server basics, application server basics, [database](https://scriptcrunch.com/tag/databases/) basics and two-tier architectures. Installing and Setting up a static Website Using Apache and Nginx Web servers Installing and Setting up a Dynamic Wordpress Website Using LAMP Stack on a Single Server 3\. Installing and Setting up a Dynamic Wordpress Website Using LAMP Stack on Multiple Servers \[ Two-Tier Architecture \] 1. Setting up Nginx Proxy for Wordpress Application ### Version Control --- Git - Getting started With Version Control Systems Git - Basic Operations Setting up a repository in Github and Performing Basic Git Operations ### Application Servers, Application Builds, APIs and Three Tier Architecture --- Installing and configuring Apache Tomcat Server Building a sample Java Application Deploying Sample Java Application to Apache Tomcat Server HTTP Codes, API basics, and Postman App Testing API Calls to the Sample Application Using Postman App ### Shell Scripting and Automation --- Getting Started with Shell Scripts Automating Application Installation using Shell Scripts [Ansible](https://scriptcrunch.com/tag/ansible/) Basics and Use cases Setting up Ansible and Writing your First Playbook Automating Wordpress Setup using Ansible ### GoLang Tutorial: Variable Tutorial For Beginners URL: https://scriptcrunch.com/golang-variables-tutorial/ Last updated: 2026-06-23T08:56:14.000Z A variable is an identifier for allocating memory to store a specific value. ### Variable Declaration Variable declaration in [GO](https://scriptcrunch.com/tag/go/) has the following syntax. var An example variable declaration is shown below. package main import "fmt" func main() { var name string // variable declaration fmt.Println("my name", name) } **[Try in Go Playground](https://play.golang.org/p/ljL%5FHDhDggX?ref=scriptcrunch.com)** In the above code we declared the variable type string, however, we have assigned any value to it. So go automatically assigns the defaults value as empty. If the type is int, the default value will be zero. Now let's try to assign some value to few variable types. package main import "fmt" func main() { var name string = "scriptcrunch" fmt.Println("my name", name) var num int = 1234 fmt.Println("Site No", num) } ### Go Type Inference One good thing about go is, you don't have to declare the variable type like we did before. Go will automatically infer the variable type. For example package main import "fmt" func main() { var name = "scriptcrunch" fmt.Println("my name", name) ``` var num = 1234 fmt.Println("Site No", num) ``` } ### Multiple Variable Declaration A single variable declaration can contain multiple variables. package main import "fmt" func main() { var name, num = "scriptcrunch", 1234 fmt.Println("my name", name, "My number is", num) } Multiple variables can be declared in the following way as well.package main import "fmt" func main() { var ( name = "scriptcrunch" num = 1234 country string ranking float32 ) country = "United States" ranking = 13.456 fmt.Println("my name", name, "My number is", num) } **[Try in Go Playground](https://play.golang.org/p/yITScQX4Nz-?ref=scriptcrunch.com)** In the above example, we have four variables. Two variables have a value assigned during initialization while other two got initialized first with the variable type and later the values for assigned. ### Shorthand Declaration You can use the shorthand operator (:=) for assigning variables. Using shorthand you an initialize and assign variables in single line. package main import "fmt" func main() { ``` name := "scriptcrunch" num := 1234 country, code := "United States", 23.456 fmt.Println("my name", name, "My number is", num) fmt.Println("Country is", country, "code is ", num) ``` } ### How To Launch Multiple VM's With Single Vagrantfile URL: https://scriptcrunch.com/launch-multiple-vms-single-vagrantfile/ Last updated: 2026-06-23T08:56:15.000Z Often times you might want to launch more than one VM of a related application with different configurations. In this case, you don't have to create multiple [vagrant](https://scriptcrunch.com/tag/vagrant/) configurations. You can use a single Vagrantfile with multiple configurations as shown below. The best part is you can start VM's individually rather than starting all VM's at once. An example configuration which launches three VM's is shown below. Vagrant.configure("2") do |config| config.vm.provision "shell", inline: "sudo yum update -y" config.vm.define "master" do |master| master.vm.box = "bento/centos-7.1" master.vm.network "private\_network", ip: "192.168.5.2" master.vm.hostname = "master" master.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end config.vm.define "node1" do |node1| node1.vm.box = "bento/centos-7.1" node1.vm.network "private\_network", ip: "192.168.5.3" node1.vm.hostname = "node1" node1.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end config.vm.define "node2" do |node2| node2.vm.box = "bento/centos-7.1" node2.vm.network "private\_network", ip: "192.168.5.4" node2.vm.hostname = "node2" node2.vm.provider "virtualbox" do |vb| vb.memory = "2048" vb.cpus = "2" end end end To start the VM's, open the terminal and browse to the location which contains the Vagrantfile. execute the following command to bring up the VM's. vagrant up To [ssh](https://scriptcrunch.com/ssh-concept/), you can use the individual VM names mentioned in the configuration. For example, vagrant ssh master ### AWS Certification: S3 Storage Essentials and Concepts Cheat Sheet URL: https://scriptcrunch.com/aws-certification-s3-essentials-concepts/ Last updated: 2026-06-23T08:56:15.000Z ### Introduction Amazon s3 is a highly available and durable object storage which can store virtually any type of data. (Images, Videos, text documents, backups and so on). It is a global service, however, you can get the region-specific endpoint for faster access. Terminologies: 1. **Bucket**: A logical separation to store data. A bucket should have a unique name as it has a universal namespace. Each bucket can be accessed globally using a unique URL. 2. **Object**: Each data stored is called an object. Can be accessed via unique URL globally. ### Key Points 1. Pure Object storage 2. Each file can range between 1 b to 5 TB. 3. Allows unlimited storage. 4. Files are stored in buckets. 5. It is a key value store. (key: name, value: data) 6. Each object has a version ID. 7. Each object has a metadata associated with it. 8. [AWS](https://scriptcrunch.com/tag/aws/) provides 99.99% availability and 99.999999999 % of durability. 9. Provides Life Cycle management for objects. 10. Provides versioning of objects. 11. Provides encryption of objects. 12. Provides security using ACL's and Bucket policies. 13. Amazon S3 Transfer Acceleration feature can be used to accelerate the speed of object creation and retrieval. In this scenario, you will be charged only if there is a performance improvement. ### Object Consistency: S3 objects have the following consistency model. 1. **Read after write consistency** for **PUTS** for new objects 2. **Eventual consistency** for **overwrite PUTS and DELETES** (Takes a while to propagate) ### S3 URL's: Supports the following two type of URL's. 1. **virtual-hosted–style URL:** It has the following structure. http://bucket.s3-aws-region.amazonaws.com. 2. **Path Style:** It has the following structure. http://s3-aws-region.amazonaws.com/bucket ### S3 Storage Types and Classes 1. **s3 standard:** 99.99% availability and 99.999999999 % of durability . 1. can withstand 2 Availability zone failures. 2. Optimal for very frequent data access and storage 3. supports SSL in transit and rest 2. **S3 Infrequent Access:** This is for data which need very less accessed data but needs rapid access. Also, Comes with 99.9% availability and 99.999999999 % durability. 1. Cheaper than s3 standard. 2. Comes with a data retrieval charge. 3. This is suitable for a disaster recovery storage option. 4. supports SSL in transit and rest 3. **Reduced Redundancy Storage:** Gives 99.99% availability and 99.99% durability. 1. This type is for the data you can afford to loose. Basically non-critical data. 2. supports SSL in transit and rest 4. **Glacier:** This is an archival storage. 1. To retrieve data from glacier it takes 3 -5 hrs after the request. Here is the comparison Table ![aws certification s3 storage options](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/s3-storage-classes_mini.jpg) ### S3 Object Versioning: Object versioning is supported by S3. 1. You can version the object you upload to s3 for to prevent accidental deletion. 2. Every time you update the object a new versioned object will be added to your bucket increasing the space as there is no mechanism for deduplication or incremental backup. So it is necessary to think in terms of cost you are opting for versioning. 3. Once you enable versioning, you cannot disable it. You can only suspend it. 4. Can be integrated with Life Cycle Rules for purging unwanted data. 5. MFA can be used in conjunction with versioning for providing extra security. ### Cross Region Replication To maintain high availability of your object, you can enable the cross region replication of bucket. The only catch here is, if you enabling this of an existing bucket with objects, it will not replication the already existing objects. It will only replicate the new objects being uploaded to the bucket. To enable cross region replication, your source and destination buckets shoould be versioned. ### S3 Life Cycle Management you can set lifecycle policies to you s3 data to move to infrequent storage and then to the glacier for archival. Also, you can mention the deletion time. 1. The minimum days for moving standard data to infrequent access is 30 days and 128kb data. 2. However, you can move to glacier from standard in 1 day using lifecycle policies. 3. You cannot move objects to RR storage class using policies. ### s3 Transfer Acceleration This feature enables faster s3 object uploads using the CloudFront edge locations. If you enable this feature, you will get a distinct URL for uploading data to S3\. You will be charged extra for this feature only if there is an improvement in transfer as compared to the normal upload. Following are the use cases for s3 transfer acceleration. 1. If your user base is across the world and they all upload data to one centralized bucket. 2. If you are transferring terabytes of data across continents. ### S3 Security By default a new S3 bucket is private. You can secure your bucket objects using the following. 1. Bucket policies 2. Access control lists. 3. You can enable detailed access logs which you can store in a different bucket. **Encryption:** There are two types of encryption, 1. In Transit - using SSL/TSL. 2. **At rest:** There are four types 1. **Service Side Encryption:** \- It has the following three types. 1. ****S3 managed Keys (SSE-s3)**In this, each object is encrypted using a key, and the keys are again encrypted using a **master key**. The master key is regularly rotated. Encryption used is **AES 256** 2. **AWS key management Service (SSE-KMS): -** Here the customers custom key is used as the master key for encryption using the AWS key management service. 3. **Customer-Provided Keys (SSE-C):**\- In this case, the customer has to set the encryption key. AWS will use this key for encrypting and decrypting the data. 2. **Client Side Encryption:-** In this case, you encrypt the data using any encryption scheme and then upload it to s3. ### S3 Pricing: S3 is charged on the following basis. 1. Storage 2. Request 3. Data Transfer. ### AWS Certification: Cloudfront Essentials, Tips, and References URL: https://scriptcrunch.com/cloudfront-essentials-tips-and-references/ Last updated: 2026-06-23T08:56:15.000Z Cloudfront is a low-latency content delivery network (CDN) service provided by [AWS](https://scriptcrunch.com/tag/aws/). Like any other CDN services, Cloudfront will distribute and deliver files all over the world using different AWS datacenters or edge locations. ## Cloudfront Essentials, Tips, and References In this article, we have explained the CloudFront essentials, tips, and references that would help you in preparing for the AWS certifications. ### Cloudfront Terminologies To understand CloudFront, you need to know about the following terminologies. 1. **Edge Location:** An edge location is an amazon facility where your content will be cached. CloudFront edge locations are present all major the world. Contains over 50 edge locations spread across the world. 2. **Origin:** An origin is a place where your original files that have to be served are present. An origin could be a web server (outside AWS), [ec2](https://scriptcrunch.com/tag/ec2/) instance, s3, ELB, Route another other storage which is accessible through the internet. 3. **Distribution:** This is the name of the CDN which consists of several edge locations for your content distribution. Basically, this would be a unique URL for your content distribution. 1. **Web Distribution**: Used typically for websites. 2. **RTMP**: Typically for streaming media which supports Adobe flash media server RTMP protocol. ### Object Caching Following are the things you should know about object caching. 1. The object cache time totally depends on the TTL you give while creating a distribution. 2. You can also delete the cache, for which you will be charged. > Note: Let's say, your video is cached and you uploaded a new version of it. Until the TTL period, CloudFront will service the old version. Once the TTL expires, CloudFront will request the new version for caching. ### Key Points 1. You can create **multiple origins** per distribution. 2. Each **origin id** should be unique to distinguish between same origins in a distribution. 3. CloudFront **Signed URL's or cookies** are used to restrict resource access to specific users. 4. You can use **AWS WAF ACL'**s to restrict access to the CloudFront content. 5. You can log CloudFront access logs to s3. 6. You can use the **geo restriction** feature to restrict or allow your content access. ### Cloudfront Use Cases Following are the few use cases for which you could leverage CloudFront for content distribution. 1. **Serving Website Content:** Top service static and dynamic content of a website. 1. You could either use a single origin for both static or dynamic content. 2. Or, create two different origins for static and dynamic content. This way you get granular management of your content delivery. 3. CloudFront caches your content at each edge location. 4. It proxies the request for all your interactive or dynamic content managed through CloudFront. Once the content is delivered , the user request will [go](https://scriptcrunch.com/tag/go/) through the edge location server to your origin server. This improves speed and losers latency in accessing the content. 5. You can also make use of CloudFront to upload content to your origin server. This will make use of AWS network for uploading by proxying the request at edge location. 6. It supports file upload up to 20 GB size. 7. You can also use CloudFront to deliver your API's. 2. **Serving Downloadable Softwares:** You can deliver downloadables and software updates using CloudFront. If your user base is located worldwide, CloudFront would reduce the latency. 3. **Serving Streaming Data:** You can also service streaming data through Cloudfront. It could be pre-recorded, on-demand progressive download or a live streaming event. ### Reference Architecture To have an overview of how CloudFront fits in with application, you can refer this -> [Cloudfront reference architecture](http://media.amazonwebservices.com/architecturecenter/AWS%5Fac%5Fra%5Fmedia%5F02.pdf?ref=scriptcrunch.com) Take a look at the following image to know howCloudFrontt works. ![how cloudfront works](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/how-cloudfront-works-diagram-jpeg.jpg) source: www.aws.amazon.com ### AWS Certification: Storage Gateway Essentials and References URL: https://scriptcrunch.com/storage-gateway-essentials-references/ Last updated: 2026-06-23T08:56:16.000Z [AWS](https://scriptcrunch.com/tag/aws/) storage gateway is a service, in which a virtual storage appliance (on a [hypervisor](http://searchservervirtualization.techtarget.com/definition/hypervisor?ref=scriptcrunch.com)) is placed in your on-premise data center. The virtual appliance, in turn, connects to AWS cloud storage services. All the data (from on-prem storages) which is connected to the virtual appliance will be written to AWS storage seamlessly. ![aws storage gateway architecture](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/aws-storage-gateway-architecture.png) source: www.aws.amazon.com ## Storage Gateway Essentials In this section, we will look into the storage gateway essentials and reference architectures required for AWS certification. ## Key Points 1. The Storage gateway appliance can be downloaded as a virtual machine from AWS. 2. The virtual appliance supports Vmware ESXi, Microsft Hyper v or a supported [ec2](https://scriptcrunch.com/tag/ec2/) AMI. 3. Storage gateway has a functionality to upload only the data that has been changed. 4. You can use Storage gateway with direct connect to increase the throughput. ### Storage Gateway Types Following are the three different types of storage gateways. 1. **Gateway Stored Volumes:-** In this model, you keep all the data in your data center and storage gateway will asynchronously copy all the data to AWS storage like s3 or glacier. This is one type of inexpensive offsite backup strategy you can design for your organization. 2. **Gateway Cached Volume:-** In this model, only frequently accessed data will be present on the local storage and all other data will be present in s3\. This model will save you some money but data cannot be accessed if there is no internet connectivity. 3. **Gateway Virtual Tape Library:-** This model support backing up data from a tape-based backup solution to AWS by integrating it with Gateway VTL cartridges. All these data can be backed up to a virtual tape library (s3) or virtual tape shelf (Glacier). The VTl has an industry standard ISCSI interface which your backup application can use to integrate. #### Reference Architecture: You can find the reference architecture from here -> [Storage gateway reference architecture](http://media.amazonwebservices.com/architecturecenter/AWS%5Fac%5Fra%5Fdisasterrecovery%5F07.pdf?ref=scriptcrunch.com) ### AWS Certification: ec2 Essentials, concepts and References URL: https://scriptcrunch.com/aws-certification-ec2-essentials-concepts/ Last updated: 2026-06-23T08:56:16.000Z [ec2](https://scriptcrunch.com/tag/ec2/) (elastic compute cloud) is one of the main services of [AWS](https://scriptcrunch.com/tag/aws/). It can be considered as the backbone of AWS. When it comes to the certification exam, this is one of the most important services that you should focus on. ec2 provides instances (virtual servers) . You can provision an instance in a matter of minutes. You can start, stop and terminate a virtual server based on your needs. ### ec2 Pricing Models There are three pricing models for ec2, 1. **OnDemand Instances:** In this model, you pay for the instance on per hour basis. There is no upfront amount or a commitment to be made for this model. 2. **Reserved instances:** In this model, you can reserve a specific number instances for a period of time. This gives you a discount in pricing when compared to reserved instances. 3. **Spot instances:** This allows you to bid a price of your choice for instances. When the price criteria match the spot instance prices, you can get it for your workloads. This is comparatively very cheap and it comes with a downside. AWS could terminate this instances without any notice when there is a requirement for more capacity. The following image shows the instance types and its use cases. ![instance-deatils_mini](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/instance-deatils_mini.jpg) source: Udemy AWS Course ### EBS Essentials EBS (Elastic Block Store) is a storage service which lets you create storage volumes that can be attached to an ec2 instance. Basically, your instance Operating System resides on EBS volumes. You can think of EBS as your computer hard disk and ec2 as your CPU and other associated processing components. Following are the EBS volume types. 1. **General Purpose SSD (GP 2):** Following are the GP2 characteristics 1. Allows 3 IOPS/ GB 2. Burst capacity up to 3000 IOPS for the available credit (ie 5.4 million I/O credits) 2. **Provisioned IOPS SSD (io1):-** Following are the IO1 characteristics 1. This EBS is for IO intensive applications like [databases](https://scriptcrunch.com/tag/databases/), NoSQL databases etc. 2. Allows up to 20000 IOPS volumes 3. **Magnetic (Previous Generation):** Low-cost EBS volume time specifically designed for normal workloads which have infrequent data access. 4. **Throughput Optimized HDD (`st1`) :** This is a low-cost storage which is optimized for throughput other than IOPS. This is best fit for sequential data access like log processing. 1. Support 40 MB/s per TB throughput. 2. Burst throughput up to 250 MB/s per TB. 5. **COLD HDD (sc1):** This is also an inexpensive EBS storage that measures performance in terms of throughput other than IOPS. 1. Supports 12 MB/s per TB 2. Burst capacity of 80 MB/s per TB from the credit balance. ### Volumes Vs Snapshots 1. A snapshot is a **point in time copy of an EBS** volume. 2. All **snapshot are incremental.** It means when every you are trying to take a new snapshot of an EBS volume, it will move only the changed blocks to s3 and not the entire data. 3. Volumes exist on EBS and **snapshots exists on S3**. 4. When a take a snapshot of a volume, automatically it gets stored in s3 5. When creating a volume from the snapshot, you can change the storage type. For example from magnetic to gp2. 6. Volumes created from an encrypted snapshots are encrypted automatically. **Root Device Volume** This is the volume which gets attached to your ec2 instance for boot. 1. To take the **snapshot of the root volume**, you have to **stop the instance first for snapshotting** it. If you try to take the snapshot of the live volume, AWS will stop the instance first before snapshotting it. ### Understanding EBS RAID [Raid](https://en.wikipedia.org/wiki/RAID?ref=scriptcrunch.com) stands for redundant array of independent disks. Following are the types of RAID 1. RAID 0 -> Striped for good performance without redundancy. 2. RAID 1 -> This model mirrors the data for redundancy. 3. RAID 5 -> **Not recommended by AWS** for EBS volumes 4. RAID 10 -> It is a combination of RAID 0 and RAID 1 **RAID Use case:** When you run workloads on ec2 instances with maximum IOPS and **you still need more IOPS**, you can **create RAID using multiple EBS volumes** for better performance. RAID Snapshots: To take RAID array snapshots, you can do any of the following. 1. Stop the instance and take the snapshots. 2. Stop the IO, Freeze the file systems, unmount RAID and then take the snapshots. ### AWS AMI's AMI (Amazon Machine Image) are the image templates created from instances or root volume snapshots. You can then launch new instances from these AMI's. There are two types of AMI's. 1. **EBS backed:** 2. **Instance Store (Ephemeral Storage):** It has the following properties. 1. You can add additional instance store volume during launch but not after launching the instance. 2. You can add additional EBS volumes to instance-store instances after its launch. 3. You **cannot stop an instance store-backed instance**. You can only reboot and terminate. Any underlying host failure would delete all your data on instance store. ### Security Groups A security group is a virtual firewall that acts as a secure layer on top of your instance. It allows you to manage traffic flow using port numbers. You can set rules to allow specific port traffic from specific IP or another security group ID ad source. 1. By default, **everything is denied at security group** end. You need to add rules for accessing your instances. 2. You **cannot add any rules** for denying the traffic. You can only add rules for allowing traffic. Same for outbound rules. 3. Security groups are **stateful by default.** By default, every traffic is allowed for outbound traffic . So you don't have to create an outbound rule for every inbound rule you specify. ### Key Points: 1. Multiple EBS volumes can be attached to an instance and one EBS volume cannot be attached to multiple instances. 2. If the spot instance is terminated by AWS, you will not get charged for the partial hour. 3. EBS volumes are replicated with the availability zone by AWS for reliability. 4. You can encrypt EBS volumes for data at rest and in transit between ec2 and EBS. 5. Root EBS volumes cannot be encrypted by default. You have to use services like BitLocker to do that. All the additional volumes can be encrypted by default. 6. If you edit a security group, it takes effect immediately without any delay. 7. Snapshots can be shared only if they are not encrypted. 8. You can share snapshots across accounts or make it accessible for public. 9. AMI's created from instances or **snapshots are region specific**. But you can copy those to other regions using CLI or API. ### AWS Certification: Cloudwatch Essentials, Concepts and References URL: https://scriptcrunch.com/aws-certification-cloudwatch-essentials/ Last updated: 2026-06-23T08:56:17.000Z Cloudwatch is a monitoring service from [AWS](https://scriptcrunch.com/tag/aws/). By default, cloud watch is enabled for your [ec2](https://scriptcrunch.com/tag/ec2/) instances which monitor your instances every five minutes. You can also enable detailed monitoring (Costs extra money ) which monitors your instances every one minute. ![cloudwatch essentials](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/cloudwatch.png) ### Cloudwatch Metrics: Cloudwatch let you monitor your instances using metrics. Following are the few metrics available. It is not limited to those, you can get metrics of other services as well. 1. EBS Metrics 2. EC2 Metrics 3. S3 Metrics Following are the metrics available for ec2. 1. CPU Utilization/Credits 2. Network In/Out 3. Disk read/write 4. Status Checks Following are the metrics available for S3 1. No of objects 2. Bucket size EBS has many metrics like read, write, queue length etc. Using these metrics you can create monitoring dashboards with widgets displaying graphs and text data. \[alert-announce\] **RECOMMENDED COURSES** [**AWS Certified Solutions Architect (2018**)](https://comtechies.com/recommends/certified-architect?ref=scriptcrunch.com) **[AWS Certified Developer Associate level (2018)](https://comtechies.com/recommends/aws-developer-course?ref=scriptcrunch.com)** **[AWS Certified SysOps Administrator Associate (2018) ](https://comtechies.com/recommends/sysops-course?ref=scriptcrunch.com)** \[/alert-announce\] ### Cloudwatch Events This is basically an event notifier for your AWS resources. You can set event notifiers like when an ec2 instance is in running state notify the lambda function to notify DNS entries. ### Cloudwatch Logs This option lets you aggregate system logs or application logs on cloudwatch and process it. To do this you need to install an agent on your ec2 instance and set a role to write permissions to cloudwatch logs. ### Cloudwatch Alarms You can set specific alarms based on available cloudwatch metrics. Once such example is an alarm to notify CPU utilization. You can set up an alarm with an SNS topic to receive alerts on your email address. Based on alarm you can also set autoscaling actions (scaling up or down) or an ec2 instance action (stop, reboot or terminate) ### Key Points 1. Default standard monitoring is 5 minutes and detailed monitoring is 1 minute. 2. Alarms are for threshold notifications. 3. Event for AWS resource even event notification 4. Custom log analysis using cloudwatch logs. ### How to Create and Setup SSH Authentication for BItbucket and Github URL: https://scriptcrunch.com/setup-ssh-authentication-for-bitbucket-and-github/ Last updated: 2026-06-23T08:56:17.000Z I want to setup [ssh](https://scriptcrunch.com/ssh-concept/) authentication keys for my GitHub and Bitbucket account. So that I can commit to those repositories without username and password. How can I achieve this? **Solution:** You can setup a passwordless authentication to your repositories on Github and Bitbucket using ssh keys. Follow the steps given in this article carefully to set it up. ### Create a Key Pair First, you need to create a key pair using OpenSLL utility. 1 .CD in to .ssh folder of your system. cd \~/.ssh 1. Create a public and private key pair. When prompted for options, just press enter to select the default options. Optionally you can set a passphrase for your key. t 1. Copy the public key. cat id\_rsa.pub 1. Head over to Github or Bitbucket settings page and in the ssh keys option, add the id\_rsa.pub contents that you have copied. 2. Once you are done with adding the keys, you can test the ssh connection using the following commands. First time it will ask to accepts the fingerprint. For bitbucket, ssh -T git@bitbucket.org For Github, ssh -T git@github.com ### Cloning Repo An important thing to notice when cloning the repo is, you should clone the repo **with ssh URL and not the https URL.** If you clone with https URL, ssh authentication won't happen and it will ask for username and password. For example, git clone git@bitbucket.org:devopscube/example.git That's it. Now you will be able to push to your repository without username or password. ### [solved] Jenkins Intermittent "Slave went offline during the build" URL: https://scriptcrunch.com/solved-jenkins-intermittent-slave-went-offline-build/ Last updated: 2026-06-23T08:56:17.000Z Issue: I have my [Jenkins](https://scriptcrunch.com/tag/jenkins/) master and slave setup on [AWS](https://scriptcrunch.com/tag/aws/) instance. I am build i have a maven deploy task to upload a large artifact to nexus. During which the upload is getting timed out and i am getting "Slave went offline during the build" error. How do i solve this issue. This issue is normally caused by kernel bug in you slave instances. There are many cases in [ec2](https://scriptcrunch.com/tag/ec2/) instances like this. There could be other reasons as well. Here we will discussing a kernel issue that causes this problem. ### The Problem Normally this issue is caused when the [TX (packets going outside)](https://www.experts-exchange.com/questions/24035359/What's-the-difference-between-Tx-and-Rx-Packets.html?ref=scriptcrunch.com) are dropped. Run the following command on the slave machine. dmesg | grep rocket If you get the following output, you can confirm that it's a kernel bug. xen\_netfront: xennet: skb rides the rocket: 20 slots ### The Solution You can solve this issue by dropping all the packet segmentation. Execute the following command on your slave machine sudo ethtool -K eth0 sg offThe above command should solve the issue. Let us know in the comment section, if your issue has been solved or if there is some other solution to it. Your feedback might help others. ### Check Application Status Using Ansible Play - wait_for moudle URL: https://scriptcrunch.com/check-application-status-using-ansible/ Last updated: 2026-06-23T08:56:18.000Z I have an application running on port 8080\. I want to check if the port is open and the application is successfully running on the port. How can i do this using [ansible](https://scriptcrunch.com/tag/ansible/) wait\_for module? ## Check Application Status Using waif\_for module There are two things, 1. If a port is opened, it doesn't mean your application has started. 2. You need to check the response code for a specific URL to make sure that your application is running. 3. Download the page content and check for a specific string in your application to make sure you are getting the right application page. Let's look at each scenario. ### Check for Port You can check for a specific port using the following code. - name: Wait for apache app to kick in wait\_for: port: 80 delay: 10 timeout: 900The above code will check for port 80 connectivity for 900 seconds. If the port doesn't come up within 900 seconds, then ansible will throw a timeout error. You can change the parameter based on your needs. ### Check based on HTTP response code You can make sure the application is up using the following code which loops until a particular response code is retrieved. - name: "wait for website to come up" uri: url: "http://localhost:8080" status\_code: 200 register: result until: result.status == 200 retries: 90 delay: 10The status code might change depend on the application. Some applications might respond with 401\. Test the response code with a REST client before you implement the ansible code. ### Check based on page content You can use the following content to check the application status based on a string in the web page. - name: Check if web page contains \`user\` string uri: url=http://localhost:8080 return\_content=true register: response failed\_when: "'user' not in response.content"You can replace "user" with a string that is available in your application web page. ### [Solved] Glusterfs already part of a volume Error For Volume Creation URL: https://scriptcrunch.com/solved-glusterfs-already-part-volume-error-volume-creation/ Last updated: 2016-11-10T13:13:40.000Z I am trying to create a volume in Glusterfs and I am getting an error saying "Volume creation Failed: gdata is already part of a volume". How can i rectify this problem? ## Glusterfs: already part of a volume Error This error normally occurs when traces of metadata and configs are present it the brick you have created. You can execute the following commands to rectify the issue. Note: /path/to/brick refers to the mount path of Glusterfs volume. setfattr -x trusted.glusterfs.volume-id setfattr -x trusted.gfid rm -rf /.glusterfs ### How to Install and Configure MongoDb on Redhat 7/CentOS 7 URL: https://scriptcrunch.com/install-configure-mongodb-redhatcentos-7/ Last updated: 2026-06-23T08:56:18.000Z How do I install the latest [mongoDB](https://scriptcrunch.com/tag/mongodb/) [database](https://scriptcrunch.com/tag/databases/) server and components in Redhat 7 or a centos 7 box? There are no Mongodb packages available in the default yum repository. You need to add the mongoDb repository and then install and configure it. Follow the [guide](https://scriptcrunch.com/tag/guides/) given below which has the steps for the same. ## Install MongoDb on Redhat 7/CentOS 7 1\. Add repository /etc/yum.repos.d/mongodb-org-3.2.repo\[mongodb-org-3.2\] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86\_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc2\. Install mongodb. sudo yum install -y mongodb-org3\. Set SElinux content for mongodb port, if it is in enforcing mode. You can check the SELinux status using "sestatus" command. semanage port -a -t mongod\_port\_t -p tcp 270174\. Start MongoDB service. sudo service mongod startYou can check the mongoDB logs using the following command. tail -f /var/log/mongodb/mongod.log5\. Add mongod service to boot. sudo chkconfig mongod on6\. To stop and restart mongoDB service, you can use the following commands. sudo service mongod stop sudo service mongod restart ### Enable MongoDB Remote Access By default mongoDb can be accessed only on the installed host. If you want remote access of mongodb instance, you need to do the following configuration. 1. Open mongod.conf file sudo vi /etc/mongod.conf 1. Search for bindIP parameter in the file, and repalace its value to 0.0.0.0 as shown below. If you want to bind the mongodb service to a specific port, you can replace 0.0.0.0 to the IP. bindIp: 0.0.0.0 1. restart the mongod service. sudo service mongod restart ### How to Install Anible IN Redhat 7/ Centos 7 Servers URL: https://scriptcrunch.com/install-anible-redhat-7-centos-7-servers/ Last updated: 2026-06-23T08:56:19.000Z How do I install latest [ansible](https://scriptcrunch.com/tag/ansible/) server on a Redhat or Centos 7 server? You can easily install the latest stable version of ansible in a Redhat or centos7 server using the EPEL repo. The default yum repo does have the ansible installation. Follow the steps for the ansible setup. You can install Ansible in two ways. 1. Using yum repository 2. From the source. ### Install using yum 1\. Setup EPEL repository. wget http://dl.fedoraproject.org/pub/epel/7/x86\_64/e/epel-release-7-8.noarch.rpm sudo rpm -ivh epel-release-7-8.noarch.rpm2\. Update Server. sudo yum update -y3\. Install ansible. sudo yum install ansible4\. Confirm the ansible installation by checking ansible server version. ansible --version ### Install from source 1\. Clone the ansible source from Github git clone git://github.com/ansible/ansible.git --recursive2\. CD into ansible clone. cd ./ansible3\. Setup using bash source ./hacking/env-setup ### Linux Shell Scripting Beginner Tutorial - Part 1 URL: https://scriptcrunch.com/linux-shell-scripting-beginner-tutorial-part-1/ Last updated: 2026-06-23T08:56:19.000Z [Linux](https://scriptcrunch.com/tag/linux/) shell is an interactive mode to run the Linux commands. You can type commands in terminal using keyboard and you can run it using shell. Lets say , you want to automate some action on your Linux machine. In this case you cannot feed the terminal with commands one by one. So what you can do is, save the commands in a file and execute it. So that all the commands in the file will be executed one by one automatically. This is called shell script. Shell script file name has a .sh extension. ### How to run a shell script: 1\. Create a fileLinux shell is an interactive mode to run the Linux commands. You can type commands in terminal using keyboard and you can run it using shell. Lets say , you want to automate some action on your Linux machine. In this case you cannot feed the terminal with commands one by one. So what you can do is, save the commands in a file and execute it. So that all the commands in the file will be executed one by one automatically. This is called shell script. Shell script file name has a .sh extension. How to run a shell script: 1. Create a file vi demo.sh 1. Enter any basic command echo “ this is a demo shell script by $USER” Here $USER will display the current user name who is logged in. $USER is called environment variable. Ther are few system defined variables , which is associated with a system value. Eg: $HOME, $USERNAME , $OSTYPE etc.. You can list the environment variables by using the following command in the terminal. env 1. Save the file and change the read write permissions to 755 chmod 755 demo.sh 1. Execute the script using any one of the following method. ./demo.sh Bash demo.sh .demo.sh 1. Once executed, you will get the output mentioned in the echo section of the script. How to know if the script has executed successfully: Shell script is associated with exit codes 1 , 0, 127 etc,,. If the script is executed successfully, it will give exit code 0\. If not it will give a non-zero exit code . Exit code 1 means there are many possible errors. Exit code 127 means “command not found”. You can check the exit code of previously executed command using the following command. echo $? Try typing valid and invalid commands in the terminal and check the exit code status using the above command. ### Working with variables: Variables are used to store values in Linux like any programming language. You can assign any integer , float , string etc,, values to a variable. When you assign a value to a variable , there should not be any space on both sides of the “=” sign. Also, variables are case sensitive. A and a are considered as two different variables. You can assign a value to a variable as shown below. a=5 name=scriptscrunch b=1.2 sample shell script to add two numbers using varibales: save the following script in a file with .sh extension and run it in the terminal to see the output. a=1 b=2 c=`expr $a + $b` echo $c In the above sample script, values 1 and 2 are assigned to variables a and b. Variable c is assigned to evaluate a match expression. Here “expr “ has to be used for mathematical expressions, otherwise the shell will take the assigned values as string. When using expr, there should be a space on both sides of the arithmetic operator . ### Adding two numbers by taking input from the user: echo " Sample addition of two numbers" echo "enter the first number" read a echo "enter the second number" read b c=`expr $a + $b` echo $c “echo $c” echoes out the output value stored in variable c. read command is used to get the input from the keyboard. In the above script, read gets the input from the user and stores it in a variable. The values stored in the variables are added using the expr function. ### About echo command: 1\. if you want to use escape characters like n or t , you have to execute the echo command using “-e” switch. Eg: echo –e "this t words t in t this t sentence t are t separated t by tabs" 1. you can execute commands inside an echo statement by using single quotes. echo "this is echo inside `echo "echo statement" ’ " ### Running multiple commands in a line: To run multiple commands on a line, separate the commands using semi colon (;) ls ; echo "demo" ; date ### A simple command to sort names in a file: Lets say you have 100 names in a file and you want to sort it in alphabetical order. The following command will do the job. sort < names > sorted_names the sort function sorts the name by getting the names from the file (names) using < operator. Once sorted , it will output the results to a new file (sorted\_names) you mention in the command using > operator. Kindly leave your feedback in the comments section below, so that I can improve the [tutorial](https://scriptcrunch.com/tag/tutorials/) series. ### [ Solved ] Vagrant Folder Mount Issue URL: https://scriptcrunch.com/solved-vagrant-folder-mount-issue/ Last updated: 2026-06-23T08:56:19.000Z By default [vagrant](https://scriptcrunch.com/tag/vagrant/) mounts the host folder to /vagrant directory of the Virtual machine where you have the vagrantfile. This allows us to share files and codebase to the virtual machine without dealing with file transfer utilities or SCP command. But you might face error sometimes that it does not mount the host directory to the vagrant folder. This happens mostly due to os update. To resolve this follow the steps given below. ## Solution 1 Step 1: Shh into the vagrant box. ```bash vagrant ssh ``` step 2: execute the following command. ```bash sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions ``` Step 3: Exit from VM ```bash exit ``` Step 3: Reload the configuration using the following command. ```bash vagrant reload ``` That's it! Now the vagrant folder will be mounted to the host folder. ## Solution 2 If the problem is not solved using slotion1, you should try the steps given below. Step1: execute the following command. ```bash cd /opt/VBoxGuestAdditions-*/init ``` Step 2: Setup VBoxGuestAdditions ```bash sudo ./vboxadd setup ``` Step 3: Exit VM ```bash exit ``` Step 4: Reload VM ```bash vagrant reload ``` Now [ssh](https://scriptcrunch.com/ssh-concept/) into the VM and try accessing /vagrant. ### How To Deploy a Spring Webapp To Tomcat Server URL: https://scriptcrunch.com/how-to-install-and-setup-tomcat-on-ubuntu-server/ Last updated: 2026-06-23T08:56:20.000Z This [tutorial](https://scriptcrunch.com/tag/tutorials/) will [guide](https://scriptcrunch.com/tag/guides/) you through the steps for deploying a plain spring web application to a tomcat server. If you haven't setup Tomcat server, you can follow the steps given below to set it up on a Ubuntu server. ### Setting Up tomcat7 on Ubuntu All the required steps for the configuration and setup is given below. 1. Update the server. ```bash sudo apt-get update ``` 1. Install Tomcat7 from the repository. ```bash sudo apt-get install tomcat7 ``` 1. Open /etc/default/tomcat7 and find JAVA\_OPTS and replace the default value with the following. ```bash JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC" ``` 1. Now, restart the tomcat service. ```bash sudo service tomcat7 restart ``` 1. Now if you [go](https://scriptcrunch.com/tag/go/) to localhost:8080 you can see the default tomcat7 web page saying "It Works". ### Install Maven To Build the Project You need some build tool to build the project and create a war file for deployment. If you dont have maven installed, install maven using the following command. ```java sudo apt-get install maven ``` ## Deploying Spring Web App To Tomcat Server Now you have tomcat and a build tool ready. Also, you might have your project file with the pom.xml file for maven. 1. cd in your project folder where you have the pom.xml file and run the following command. ```bash mvn clean install ``` 2\. Once the project is built, you can get the war file from the target direcory in your project folder. Copy the tar file to /var/lib/tomcat7/webapps directory. 1. Restart the Tomcat server using the following command. ```bash sudo service tomcat7 restart ``` 1. Thats it ! Your app is not deployed. Now if you visit, :8080/appname, you can view your running app. ### List of Main Advantages of Distributed Version Control Systems URL: https://scriptcrunch.com/295/ Last updated: 2026-06-23T08:56:20.000Z In this post, we will discuss some important concepts which showcase some of the advantages of distributed version control systems. A picture is worth thousand words. If you want to know the difference between a centralized and distributed version control system, have a look at the image below. ![advantages of distributed version control systems](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/centralized-vs-distributed-advantages.png) ## Advantages of Distributed Version control systems If we take a look at all the version control systems, there are many topologies. They are discussed below. ### Centralized Centralized topology has an architecture of developers pushing the changes to on central repository. ### Hierarchical In this model all the developers push changes to sub-system repositories. One of such example is [Linux](https://scriptcrunch.com/tag/linux/) kernel [development](https://scriptcrunch.com/tag/development/). In this graphics, sounds etc are treated at sub-systems. Once the development is over for a version, all the sub-system repositories will be periodically merged into single main repository. ### Distributed In this type, each developer will push the code changes to their own repository. There will be project maintainers, who will pull the changes made my the developers top the main official repository. One such example is the open source projects on Github. If you like to contribute to a project, you can fork the project, work on it and give a pull request to the original code base. The project maintainer will review your code and if he thinks it adds value, he will merge it to the official repository. **Also Look:** [Git Fundamentals Course](https://scriptcrunch.com/recomended/git-fundamentals-course/) ### Easy Backups When you clone a repository, you copy the whole code and it becomes a backup. ### Reliable Branching and Merging In DVCS branching is really easy when compared to Centralized approaches. You can different branching strategies. For example, you can have a feature branch to work on a new feature and you can merge it easily with the main branch without much pain. #### Full Local History DVCS maintain a full local history which helps in finding out new bugs and tracking and rollback are made very easy. ### WordPress Insert into Post Blank Page Issue [Solved] URL: https://scriptcrunch.com/wordpress-insert-post-blank-page-issue/ Last updated: 2025-09-25T12:03:49.000Z Q: When I try to use images using "insert into post" option, WordPress is giving a blank page and the image is not getting inserted. How do I solve this issue? The above-mentioned problem occurs when you use a new theme or maybe because of some code changes in your WordPress function file. ## Insert into Post Blank Page Solution There could be many reasons for this but most probably it is because of the **link URL** problem. Normally for uploading a logo or a media file, you would do that following and get the blank page without actually setting the logo. 1. You upload a file or select a file from media. 2. Click the "insert into post" and you will see a blank page. If you notice, there is an option called "Link URL" as shown below. ![insert into post wordpress issue](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/wordpress-insert-into-post-issue.png) If the Link URL is blank after selecting the image, most probably you will get the blank page error. To resolve this problem just select the "File URL" option. That would add the image link to the "Link URL" box as shown below. ![insert in to post link url issue](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/09/wordpress-insert-into-post-issue-1.png) Now, if you user the "insert into post" option, it will get updated without any issues. If this solves your issue, kindly share this post in relevant communities as there are very fewer blog posts explains this issue. We faced the same with ScriptCrunch and after a lot of google search, we found this fix in a forum. If this doesn't solve your issue, if could be because of the following possible reasons. 1. **Plugin** update's:- if you are facing this problem after updating a plugin, you might want to deactivate that plugin and recheck if it works. 2. **Wordpress code theme update: -** If your theme gets updated and if it has some bugs, insert in to post might not work. You can check this with the theme developer or their support forum. 3. **Wordpress Update: -** Core WordPress update could also result in this issue sometimes. Let us know in comment section if you have more queries or suggestions to improve the article. ### Linux Process Management Tutorial For Developers URL: https://scriptcrunch.com/linux-process-management-tutorial/ Last updated: 2026-06-23T08:56:20.000Z [Linux](https://scriptcrunch.com/tag/linux/) is a multitasking system, which means it can run multiple tasks (process) at a time. Basically, a process is a running program or a task or a command on your Linux system. ## Linux Process Management for Developers When you are developing applications on Linux, you will be using a web server, [database](https://scriptcrunch.com/tag/databases/) server etc..At times, you might want to have a look at the process or may want to terminate and restart it. In this article, we will cover some of the basic process related tips for developers working on Linux based systems. ### Process Management Daemons Every Linux system has one of the following process management daemons. It will be the first process to be started on the system when you boot it up. 1. Init - SysV (first adoption - historic) 2. Upstart - (first adoption - 2006) 3. [Systemd](https://scriptcrunch.com/linux-systemd/) (first adoption - 2011) Note: In the latest OS releases, systemd is been widely used. in ubuntu 15.05, cenots 7, init is replaced by systemd. ### Process related commands You can list all the process in Linux using `ps` command. ps auxTo get a filtered meaningful output, you can use `grep` filtering utility. For example, if you want to list all the processes run by the [vagrant](https://scriptcrunch.com/tag/vagrant/) user, you can execute the following command. ps aux | grep vagrantTo get the process id of a specific service, you can use `pgrep` with the service name as shown below. pgrep httpdTo get the list of process in a tree structure, you can use the `pstree` command. **Note:** `pstree` is not installed on Linux systems by default. You can install `pstree` from relevant distro repo. pstree To get the process id with the tree structure, use the `-p` flag. pstree -p If your system is little slow and if you want to get a dynamic view of processes, you can use the `top` command. Top updates itself in real-time based on the CPU and memory usage by the processes. top To terminate a running process, you can use `kill` and `killall` command. If you know the process id, you can use the kill command as shown below. kill 9506 To forcefully kill the process, you need to add `-9` flag to the kill command. kill -9 9506 If you know the name of the process, you can use the killall command. killall apache2 ### Running Processes in Background When you execute a command on a terminal, you will need to watch it executing until it finishes the execution. For longer running commands you actually run the process in the background. To put a process in the background, just append the `&` at the end of the command. For example, `tail -f /var/log/syslog` gives a dynamic view of log files when it is added subsequently. To put this execution in the background, you need to execute the command as shown below. tail -f /var/log/syslog & You can view the background jobs using `jobs` command. For example, \[vagrant@devbox \~\]$ jobs \[1\]+ Running sudo tail -f /var/log/yum.log & \[vagrant@devbox \~\]$ In the above example `[1]` is the job id. To bring the job running at the background to foreground, use the `fg` command with the job id. For example, fg 1 You can send the process to the background using the `bg` command. First, you need to suspend the process using `ctrl+z`. For example, bg 1 If you going to run a really long running process, you can append `nohup` which stands for no hanging up. The advantage of using `nohup `over `&` is even if you close your terminal the process will run without interruption. For example, let's say you are untaring an archive which might take half an hour. In this case, you can use nohup and close the terminal. The job will run in the background without any problem. tar czf archive.tar.gz /var/\* nohup ### Starting and Stopping Services You can start, stop and restart services using the `service` command service start service stop service restart ### Linux Tutorial: Finding Files in Linux URL: https://scriptcrunch.com/linux-tutorial-finding-files-in-linux/ Last updated: 2026-06-23T08:56:21.000Z Note: In [Linux](https://scriptcrunch.com/tag/linux/), everything is treated as files. Even folders are treated as files. There will be situations where you might probably want to find a file in your Linux system. You can find files and folders in Linux using the following commands 1. Which 2. Whereis 3. Locate 4. Find ### Which: Which command returns the location of the executable's ( installer files present in your system) which you are looking for. For example, a search for apache web server executable (apache2 (Ubuntu), httpd (centos) ) can be done using the following command. which apache2The above command will return the location of the apache web server executable in the system. ### Whereis: Whereis command returns the location of binaries, executable's and the man pages of the file you are looking for. Whereis command is associated with three options, -s, -b and –m. when you use whereis command with –s switch, it returns the source file, -b returns only binary and –m returns the man pages. whereis apache2The above command returns the source, binary and man pages. whereis –s apache2The above command returns only the source if the source exists. whereis –m apache2 The above command returns the man pages for apache2. ### Locate: Locate command is used to locate files on your system. Before using the locate command, you have to update you db because there is a [database](https://scriptcrunch.com/tag/databases/) which stores all the locations of your files in the system. This db file can be found in the following location /var/lib/mlocate/mlocate.dbThis database has to be updated in order to use the locate utility efficiently. This can be done by running the updatedb utility in the terminal. updatedbYou have to run the updatedb utility every time in order to get the latest changes made to the file system. For example, you ran the updatedb and after that, you created a new file demo.txt . If you try to find demo.txt using locate, it won’t return any output. If you run updated utility and use the locate command again, you would be able to find the demo.txt file location. You can locate files using the following command. locate filenae ### Find: Find is an awesome utility to locate files on your system. You can find files based on name and using the find utility. ### Finding files using name You can search for a specific file by its name by using –name switch with the find command. find –name demo.txt ### Finding files using type You can search for a specific file by its type (eg: directory) by using –type switch with the find command. find –type d –name demo ### Finding file based on size Using find, you can list files based on size. find \~ -size -50MThe above command lists the files which are less than 50 MB find \~ -size +50MBThe above command lists the file which is above 50 MB kindly share this post and leave a comment for feedback ### Linux Shell Scripting Beginner Tutorials - Part II URL: https://scriptcrunch.com/linux-shell-scripting-beginner-tutorials-part-ii/ Last updated: 2026-06-23T08:56:21.000Z In this second series, you will learn about script debugging, conditional statements and case statements. ### Debugging shell script Everything goes wrong at some point. You can debug the shell script for error like any other programming languages using two switches “-v” and “-x”. Just append the switched before the script name to debug the script. ./ -x script.sh ./ -v script.sh **Command line arguments:** Arguments are something which will follows the command. For example , echo $0 , here echo is the command and $0 Is an argument passed to the command. $0 , by default will return the name of the shell script. Create a script file with .sh extension and try out the following example. #! /bin/sh echo $0 $1 $2 save the file and pass any two strings with the script file. ./scriptname.sh demo string Once you run your script with two arguments, you will get the names of two arguments and shell script name as output because $1 and $2 gets the arguments passed with the command. ### **Conditional Statements** You can use conditional statements like if, else in the script to make decisions. Let’s look at a simple example which uses conditional statement. **If ,then, else and elif Statements:** if \[condition\]; Then “code goes here” Elif\[condition\[; Then “code goes here” Else “code goes here” fi **Sample script for conditional statements:** #! /bin/sh echo "Guess this websites name" read guess if \[ "$guess" = "scriptcrunch" \]; then echo "You got it right!! Bingo" else echo "Your are wrong :( try again" fi;In the above code snippet, we get an user input from keyboard. The if statement checks if the input matches the “scriptcrunch” string. If the string is matched it will display the message from the “ then block” or else the “else” statement will be invoked and the message inside the else block will be displayed. “fi” closes the if code block. Note: When we deal with mathematical expressions, we use “–eq” instead of “=” in the if condition. ### **Working with loops** Shell script supports for and while loops. **Syntax for “for” loop** Syntax: For ((initial-condition;condition;iterator)) Do command1 command2 Done **Syntax for while loop** while\[condition\] Do Command1 Command2 Done **Sample script for “for” loop:** echo "enter you name" read name echo "how many times you want to print your name" read times echo -e "here you [go](https://scriptcrunch.com/tag/go/) n n \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*n" for((i=1;i<=times;i++)) do echo "$name" doneIn the above script, name stores the name you enter in the keyboard using read function. Times store the input value given by the user. In for loop we use times variable to print the name “n”times. ie the value given by the user. **Sample script for while loop:** echo -e "How many numbers you want to print???n" read number echo -e "n\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_n" x=1 while \[ $x -le $number \] do echo " $x" x=$(( $x + 1 )) done echo -e "n\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_n" ### **case statements** You can use case statements in shell script. The case statement will execute the commands which match the value mentioned in the case statement. Save the following script in case.sh file and change the permissions to 755 to execute the script. echo "enter any number between 1 and 6" read number case $number in "1") echo "you have won a BMW X6";; "2") echo "you have won a BENZ";; "3") echo "you have won a PRIUS";; "4") echo "You have won 1 million dollors";; \*) echo "Sorry!! Better luck next time ";; esac ### Linux Tutorial For Beginners- Part I URL: https://scriptcrunch.com/linux-tutorial-for-beginners-part-i/ Last updated: 2026-06-23T08:56:21.000Z **Why should you learn [Linux](https://scriptcrunch.com/tag/linux/)?** Linux is an awesome OS to work with. It is very malleable and it is really really fun to work with linux OS. Am not going to elaborate on this. Just read the article published by redhat and You will understand why you should learn Linux. Read: [why should you learn linux](http://servicesblog.redhat.com/2014/02/25/keep-learning-linux-its-the-future/?utm%5Fsource=twitterfeed&utm%5Fmedium=facebook) **Choosing a distro:** When you start learning about linux , Redhat, Ubuntu, centos , Fedora, suse and mint are names that would be going through your brain. But believe me, there are nearly six hundred different distros of linux. I suggest you to start with Centos ( a derivative of Redhat enterprise linux) and Ubuntu ( a debian based distro). Choosing a distro is of your choice. For more info on choosing a distro , [read this](http://lifehacker.com/5889950/how-to-find-the-perfect-linux-distribution-for-you?ref=scriptcrunch.com) In this [tutorial](https://scriptcrunch.com/tag/tutorials/) I will be explaining the important things to do when you start learning the Linux command line. I started learning linu from udemy course. If you are new to linux and you want a good grip on linux, you can subscribe for the online course. It is a really good course for linux foundation. Course link: [Linux tutorials by linux academy](http://click.linksynergy.com/link?id=AfpokvaRFDA&offerid=323058.101484&type=2&murl=https%3A%2F%2Fwww.udemy.com%2Fmastering-the-linux-command-line%2F&ref=scriptcrunch.com) **Getting started:** Shell: To run command in Linux we use a command line interpreter called shell. You can virtually do any Linux based operations using the shell. You can open a shell terminal using the GUI options in your distro or you can user Ctrl + Alt + T shortcut keys to open the terminal. Also read: [Linux shell scripting beginner tutorial](http://www.scriptcrunch.com/2014/03/Linux-shell-scripting-beginner-tutorial.html?ref=scriptcrunch.com) **Viewing OS information:** cat command is used to view the contents of a file. The information about the CPU and OS are present inside files under the /etc folder. 1\. Command to view the cpu information cat /proc/cpuinfo 2\. Commad to find the OS details cat /etc/*release* **Adding users and Passwrods:** 1\. Open the terminal and issue the following command to execute commands as root. sudo su 2\. To Create an user , lets say scriptuser , execute the following command in the terminal useradd -s /bin/bash -m -d /home/scriptuser -g root scriptuser the above command creates a user “scriptuser”, create the home directory for the user. 3\. Add password for the user. Passwd scriptuser 4\. Only the root user will have all the privileges to execute and modify all the files in the server. Inorder for the user to have certain privileges to executes commands and install softwares, it should have some root privileges. To provide the user root privileges , you should add the user to ther sudoers list. Sudoers file will be present inside the /etc folder. location: /etc/sudoers. Use any one of the foloowing commands to open the sudoers file. vi /etc/sudoers (or) visudo vi is the editor for linux. There are other ediotors like nano. 5\. Add the following line to the sudoers file. scriptuser ALL=(ALL:ALL) ALL scriptuser is the username and ALL=(ALL:ALL) ALL will give the user certain root privileges. After adding this line , press Esc key , w and q to save the edited file. Now you will be able to execute commands using root privileges by using sudo before the command. **Working with directories (folders)and files:** 1\. Create a directory using the following command mkdir directory_name 2\. Remove a directory rmdir directory_name 3\. You can browse through the directories using cd (current directory) command cd /dir1/dir2 4\. You can find the current working directory using the following command. pwd **Editor:** vi is the commonly used and a very powerful text editor. 1\. Open a file vi filename 2\. Save a file by pressing the following keys consequently. esc + w +q 3\. Exit the file without saving esc + q 4\. Search for a particular word in a file /keyword + enter 5\. Delete a particular line
use dd by placing the cursor in the line which you want to delete the file.
6\. Undo the action by pressing u 7\. Copy and paste and particular line yy to copy and p for paste To create a file you can either use the editor or touch command. 1\. If you create a file using touch command, the file size will be zero. touch filename 2\. Creating a file using vi. vi file name 3\. Deleting a file rm filename 4\. Force deleting rm –f filename 5\. To delete all the files in a folder , cd in to the directory and issue the following command. rm –rf * r stands for recursive and f stands for force, \* denotes all. 6\. To delete a folder with files. rm –rf foldername 7\. Create a hidden file by appending a . operator before the file name. mkdir .dirname touch .filename **Listing Files and folders:** 1\. You can list all the files and folders using the ls command. ls 2\. Use the following command to list all the hidden folders ls –a 3\. List all the files with particular extension. ls *.png ls *.sh 4\. List all the files with their starting with a ls a* 5\. List all the files starting with letter a to d from a particular folder ls /folder-name/[a-d]* kindly share this article and leave a comment for queries. ### Windows Powershell Tutorials - Discovering Commands and Using Help URL: https://scriptcrunch.com/windows-powershell-tutorials-discovering-commands-and-using-help/ Last updated: 2014-02-09T10:52:00.000Z When you start learning powershell you wont be knowing all the commands. So the help system will let you discover the commands and gives you a short note about what a particular command does. By using help you can avoid lots ans lots of errors and you can save time in the learning process. The first thing you have to do is update the help system. You can update the help system using the following command. update-help The above command will update all the help files associated with powershell. **Getting Started:**If you want to know what are the options available for a particular command ***Update-Help*** will do the work. Let say , you want to know about update-help command. Issue the following command in the powershell window to get a detailed information about the ***Update*** ***\-Help*** command. Help update-help -full If you want to see the results in a separate window, where you can search for a particular string, use the following command. help update-help -ShowWindow **Discovering Commands:**As you start learning , you wouldnt be aware of most of the commands. So lets say , you want to know the command which shows you all the details about ipadress. Powershell has a great way to discover command using help. Poweshell supports wildcard search. The following command will search for the commands which has the ***ipaddress*** string attached to it. help *ipaddress* The above command will list out all the commands which includes ***ipaddress***. From that you can get the command which shows you all the ipaddress details. In this case it is ***Get-NetIpAddress*** **Using Help:**Now you know how to discover a command and the next thing you have to learn is that what and all parameters and values you can pass to the particular command. You can find that using the help command. The following command will show you the details and syntax of the **Get-Service** command. help Get-Service The syntax section in the help will show you how to use the command. In the help section of Get-Service command , syntax looks like the following image. If you look at the image above, there are three ways you can use the *Get-Service* command. The strings which start with ***\-*** are parameters and ****** means values which you pass to the command. The two square brackets which are jammed one against each other means that you can pass multiple values with the command. The commands within square brackets are not mandatory, which means you can run the ***Get-Service*** all by itself and it return all the available services. *\-Name* is a positioned parameter in **Get-Service** command, which mean if you pass a value with Get-Service method with or without the ***\-Name*** Parameter, it will give the same output. Its because , powershell automatically adds the positioned parameter to the value. Int this case ***\-Name*** parameter is positioned first. For example, the following two commands will give the same output. Get-Service -Name winrm Get-Service winrm **Changing the error color:**When ever you get an error , it will be shown in red color. There is a simple command which changes the error color if you don't like red. The following command will change the error color from red to green. $host.Privatedata.ErrorForeGroundColor = 'green' $host.Privatedata.ErrorBackGroundColor = 'black' ### Windows Powershell Tutorials For Beginners - Getting Started URL: https://scriptcrunch.com/windows-powershell-tutorials-for-beginners-getting-started/ Last updated: 2026-06-23T08:56:22.000Z **What is powershell:** Windows powershell is an excellent command line shell for windows operating system. It is also described as a an object oriented programming language. Using powershell scripts you can manage your windows operating system, automate tasks, manage applications etc,.etc,.For windows administrators windows powershell acts as a major component in the windows server administration process. This is my first post in powershell [tutorial](https://scriptcrunch.com/tag/tutorials/) series. In this post i will explain how to set up the lab environment for learning powershell and the basics of powershell. **Setting up powershell:** Windows powershell comes bundled with windows 8 operating system and with windows server. I would suggest you to set up a windows server 2012 for learning powershell. You can install 2012 evaluation version, or you can purchase a server licence (if you think you have lotta money to spent) and install it on your home machine with good configuration (4 GB RAM, blah blah blah). Another way is to get access to windows servers is using windows azure or [AWS](https://scriptcrunch.com/tag/aws/) cloud services. Windows Azure provides one month free trial for its service while AWS gives you free access to one server instance for one year. Its like, you run one windows server 2012 for one year and you will be charged nothing. How cool is that huh??.i know!! For an AWS account all you need is a credit card to sign up. You can also use other AWS services ([databases](https://scriptcrunch.com/tag/databases/), application deployment services etcc) for free for one year time. AWS guys call it " AWS free tier". You can get more details about the free tier here [AWS free tier](http://aws.amazon.com/free/?ref=scriptcrunch.com) Spinning up a windows virtual machine is really simple on AWS . They have a really really good documentation. In this tutorial series , am going to use windows server 2012 server instance from AWS and powershell version 3. 1\. Open windows powershell ISE (integrated scripting environment). [Go](https://scriptcrunch.com/tag/go/) to tools --> options to set the font size and theme as per your needs. You can also use the Powershell console, but i would suggest you to use th ISE for learning purposes. What ever you are using, make the font and window properties proper, so that you can have a nice and clean window to work with. 2\. One good thing about ISE is that , when you start typing a command it automatically shows all the possible commans in a suggestion box. After the first command , when you type - it will narrow down all the available parameters for that particular command. In this case, i type the get-service command followed by parameter -Name followed by service name RemoteAccess. It shows the status , name and display name of that service. Get-Service -Name RemoteAccess Get-Service -Name S* The above command lists all the the services which are running and stopped , which starts with the letter S. You can check the version of powershell using the following command $psversiontable Powershell also supports backward compatibility. If you have PS version 3 and if you want to run PS version 2, Goto run and type the following powershell.exe -version 2.0 The above command will open a poershell 2.0 window. You can check the version using $psversiontable commmand. If you are using just the powershell window other than ISE i would suggest you to use tab for auto-completion of commands. It will reduce a lot of typographical errors you make. Type a couple of letters and use tab for auto-completion of the command. If a command doesn't complete when you hit tab, it means your command is wrong. ### Powershell Tutorials: 1\. [Discovering Commands And UsingHelp](http://www.scriptcrunch.com/2014/02/windows-powershell-tutorials.html?ref=scriptcrunch.com) ### How To Process Rails Form With Model Without The Data Getting Saved To Database URL: https://scriptcrunch.com/how-to-process-rails-form-with-model-without-the-data-getting-saved-to-database/ Last updated: 2026-06-23T08:56:22.000Z Rails form\_for helper used the active record class for handling the forms and saving to [database](https://scriptcrunch.com/tag/databases/). However in some cases you might not want your form data to be saved in a database. For example, if you are developing an application which creates a bucket in amazon s3, you wouldn’t want your bucket name to be stored in the database, you just pass the bucket name using form and write backend controlled codes to check if the bucket exists and if not pass the form name parameter to S3 function to create a bucket. Here we wont be needing a database to save the bucket name ,because you can use other [AWS](https://scriptcrunch.com/tag/aws/) sdk functions to vie, delete and lists the buckets. So we make little tweaks to our model class to make this work. Here I have a model named demo.rb. and it looks like this. `class Demo include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :name validates :name , presence:true def initialize(attributes ={}) attributes.each do |name , value| send("#{name}=" , value) end end` In the above code the demo class is not inheriting the active record class. Instead we are including other modules like validations, conversion and we are extending Naming. These classes have to be added for the form to work properly. For example, Active model validation lets you validate your form. Since you are posting the data from the form using hashes you need initialize method to get those values in a hash. It loops through the attributes and uses the send method to assign the data and value. The view has the same code as it does for the normal model. It looks like this. `<%= form_for(@demo) do |f| %> <%= render 'shared/bucket_error_messages' %> <%= f.label :name%> <%= f.text_field :name%> <%= f.submit "createbucket", class: "btn btn-default" %> <% end %>` In controller instead of @demo.save? you should use @demo.valid? since we are not saving the data to the database. And the code looks like this `class DemosController < ApplicationController def index redirect_to :action => "show" end def new @demo = Demo.new end def create @demo = Demo.new(params[:demo]) if @Demo.valid? end end` The create action doesn’t save the data , instead it does the action you mention the if condition. ### How To Rectify Transaction Lock /var/lib/rpm in Linux URL: https://scriptcrunch.com/how-to-rectify-transaction-lock-varlibrpm-in-linux/ Last updated: 2013-12-18T19:04:00.000Z When you interrupt yum installation and try to reinstall the package again , you are likely to get a transaction lock. You can rectify this issue using the following methods. 1\. Remove the db files and rebuild those files again using the following commnds. Sudo rm -f /var/lib/rpm/__db.00* Sudo rpm --rebuilddb Once you executed the above commands all the locks will be freed and you can continue with your instllation. 2\. You can also remove the locks by kill all the existing process which is holding the lock on the resource using the following commands. Sudo ps –ef The above command will show all the existing process. Find the process id and kill the ,process using the following command Kill –9 Use the following command to search the yum processes Ps aux | grep yum The above command will list all the yum process. Get the process id and kill all the process using the following command. Kill -9 process-id ### How To Connect Jsp And Mysql Using Eclipse URL: https://scriptcrunch.com/how-to-connect-jsp-and-mysql-using-eclipse/ Last updated: 2026-06-23T08:56:23.000Z This [tutorial](https://scriptcrunch.com/tag/tutorials/) will teach you how to connect MySQL [database](https://scriptcrunch.com/tag/databases/) and JSP on eclipse. I really had a hard time connecting JSP and MySQL since I could not find any right resource on the internet. So, I thought I would share my experience. Here am using eclipse indigo. ## Getting Started **Prerequisites:** **1\. Apache Tomcat web server** **2\. Mysql Server.** **Step1:** Create a dynamic web project by going to File-->New-->Dynamic web project. **Recommended:** [JSP, Servlets, and JDBC for Beginners: Build a Database App](https://scriptcrunch.com/recommends/udemy-jsp-course/) [![](http://2.bp.blogspot.com/-3w0YgEhfcB0/UUHzeEd5ErI/AAAAAAAAA6U/zJn3BLT45o8/s640/1.PNG)](http://2.bp.blogspot.com/-3w0YgEhfcB0/UUHzeEd5ErI/AAAAAAAAA6U/zJn3BLT45o8/s1600/1.PNG?ref=scriptcrunch.com) **Step2:** Give your project a name and select the target run-time as Apache tomcat, that you have installed in your system already, and click finish.Now, you workspace is ready for the SQL connection test. [![](http://4.bp.blogspot.com/-KEQZMJu2LCY/UUH08zIBGeI/AAAAAAAAA6c/ktzmYbzpaOo/s640/1.PNG)](http://4.bp.blogspot.com/-KEQZMJu2LCY/UUH08zIBGeI/AAAAAAAAA6c/ktzmYbzpaOo/s1600/1.PNG?ref=scriptcrunch.com) **Step3:** Create a new file called ConnectJspToMysql.JSP and paste the following code. <% try { /\*here mysqltest is the database name. you have to give the database name you have created and 3306 is the default sql port \*/ String connectionURL = "jdbc:mysql://localhost:3306/mysqltest"; Connection connection = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); /\* "root" and "root" are the mysql username and password . if you have a different user name and password you have to change that in code \*/ connection = DriverManager.getConnection(connectionURL, "root", "root"); if(!connection.isClosed()) %> <% out.println("Successfully connected to " + "MySQL server using TCP/IP..."); connection.close(); } catch(Exception ex){ %> <% out.println("Unable to connect to database."); } %> **Step4:** Download MySql connector and add it to eclipse. [Dowload it here](http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.24.zip/from/http://cdn.mysql.com/?ref=scriptcrunch.com). Now unzip the downloaded file in some location. **Step 5:** Now got to eclipse. Expand your project folder. [Go](https://scriptcrunch.com/tag/go/) to java resources-->Libraries-->Ear libraries and then right click on EAR libraries. You will see an option called configure build path. select that option and select "add external jar files" and find the unzipped MySQL connector folder and select thejava-mysql-connector.jar file and click open. [![](http://1.bp.blogspot.com/-cHbgTma-BLA/UUH5KCGNLVI/AAAAAAAAA6o/vHKy12cD10A/s640/3.PNG)](http://1.bp.blogspot.com/-cHbgTma-BLA/UUH5KCGNLVI/AAAAAAAAA6o/vHKy12cD10A/s1600/3.PNG?ref=scriptcrunch.com) That it, Now you can run your JSP program and you will get an output saying, connection established using TCP-IP. ### Setting Up Ruby On Rails Environment On Windows, Linux And Testing The Application With Heroku PaaS URL: https://scriptcrunch.com/setting-up-ruby-on-rails-environment-on-windows-linux-and-testing-the-application-with-heroku-paas/ Last updated: 2026-06-23T08:56:23.000Z In this [tutorial](https://scriptcrunch.com/tag/tutorials/) am going to explain how to set up ruby on rails environment , create a rails application and test that application on Hereoku paas, so that you can see how your application will look and work in production environments. Also i will [go](https://scriptcrunch.com/tag/go/) through the errors i encountered during the setup process. ## Setting up rails environment on ubuntu: I have already written a post for setting up rails environment on ubuntu. Follow this link for that article [Rails on Ubuntu](http://www.ask-cloud.com/2013/09/how-to-setup-ruby-on-rails-on-ubuntu.html?ref=scriptcrunch.com) ## Setting up rails environment on windows: 1)Download and install the rails installer from here. *[Download rails installer for windows](http://railsinstaller.org/en?ref=scriptcrunch.com).* It will install all the necessary programs like ruby, ruby gems and rails. 2)If your are behind the proxy, you will not be able to install the gems using bundler. So make sure you set the proxy in cmd promt. Eg: ***set http\_proxy= http://your\_proxy:port*** 3)Open command prompt and CD in to sites folder using cd *cd:sites.* Run the following command to create a new rails application. rails new my_app 4)Your rails application will be created when the above command is executed. Rails comes with a default webrick web-server, so you don't have to configure a web server for running your applications locally. Make my\_app as your current directory and execute the following command to start the rails server. ***$ rails s*** or ***$ rails server*** 4)In your web browser go to *localhost:3000 ,* you will find the welcome page of the newly created rails application "my\_app". Now we have a running rails application which is set up locally. We can test our rails application in Heroku, a[ platform as a service](http://www.comtechies.com/2012/01/cloud-computing.html?ref=scriptcrunch.com) which basically offers free plans for hosting basic applications. So that you know how your application looks in the production environment. ## Setting Up Heroku For Rails Application Deployment: 1) Create a heroku account in [heroku.com](http://heroku.com/?ref=scriptcrunch.com) 2) Install the toolbelt for heroku from here. ***[Heroku Toolbelt Install](https://toolbelt.heroku.com/?ref=scriptcrunch.com)*** 3) Inorder to push your application to heroku server, you need git configured in your system. Git is a opens source version controlling system. You can download and configure git in you system from the following link. *[Configure Git For Windows And Linux](http://git-scm.com/download?ref=scriptcrunch.com).* Once setup is over, execute *$ git init* from your application folder to create the repository for yout application. Which will be later used to push your application to the heroku platform. 4)Open the terminal and cd in to to your app folder and execute the following command to login to your heroku account from the terminal. ***$ heroku login*** 5) Add the pg gem to the gemfile of your application because heroku basically uses postgreSQL. So in production environment we use postgreSQL. Locally we use sqlite. group :production do gem 'pg' '0.12.2' end 6)Execute *$ bundle install --without prodution* (This command will quit the production gems from installing in you local system) 7)Execute ***$ rake assets:precompile*** 8) Add the files to the git repository using ***$ git add .*** 9) Commit the changes to git using *$ git commit -a -m "Initial commit" .* Here "-a" stands for all and "-m" stands for the comment you want to give for the commit. If you don't mention -m , git will automatically open the default editor to enter your comments about the commit. 10) Now execute *$ heroku create .*This command will create a new application container for your rails app with a url , through which you can access your application through web browser. The DNS is a randomly generted unique URL. It also adds the heroku remote git for your application. 11)Ececute *$ git push heroku master* to push your application to the heroku app container. If you get any error like "public key denied", ececute *$ heroku keys:add* command and then execute the push command. 12) Now you can access the demo application from the url provided by heroku. You can also mange your application from the heroku dashboard from heroku website. ### What is SSL and How To setup SSL On Linux Httpd, Apache2 URL: https://scriptcrunch.com/what-is-ssl-and-how-to-setup-ssl-on-linux-httpd-apache2/ Last updated: 2026-06-23T08:56:24.000Z SSL (Secure Socket Layer) is a protocol , which establishes a secure connection between a web browser and the server so that no one can steal the data sent back and forth from the web browser and web server. In layman's terms, you can have a secure connection between the user and server by encrypting the data that is sent over the network,so that data theft can be avoided. You probably noticed https instead of http when accessing net-banking sites and other important sites. It is because those sites use SSL protocol. ## How SSL Works: 1) The user requests a website using **https** eg: **https://www.yoursite.com** , the server receives the request and sends a certificate and public key to the web browser. 2)The browser checks if the certificate is trusted by checking it with the trusted certificate authorities it already has. The browser by default has some trusted certificate authorities. You can view it in the settings of your browser. 3)If the certificate is verified by the web browser, then it sends the requests to the web server by encrypting the requests using the public key issued by the web server. The web server in turn decrypts it using the private key it holds. Thus a secured connection is established between the web browser and web server. ## Setting Up SSL (self signed) on Linux Httpd. In this [tutorial](https://scriptcrunch.com/tag/tutorials/) am going to explain how to set up SSL on httpd (rhel based) or apache2 (debian). It uses the self signed certificate , you can use it for testing purposes. I assume that you have httpd server ready with a website. 1)Install mod\_ssl by executing the following command in your terminal. ***$ yum install mod\_ssl openssl*** 2) Create a private key ***$ openssl genrsa -out ssl.key 1024*** 3) Generate CSR ***$ openssl req -new-key ssl.key -out ssl.csr*** 4) Generate a self singned certificate using the key and csr for 365 days. ***$ openssl x509 -req -days 365 -in ssl.csr -signkey ssl.key -out ssl.crt*** 5) Copy the key, crt and csr files to respective folders using the following commands. ***$ cp ssl.crt /etc/pki/tls/certs*** ***$ cp ssl.key /etc/pki/tls/private/ssl.key*** ***$ cp ssl.csr /etc/pki/tls/private/ssl.csr*** 6)Open the httpd.conf file using any editor to set the virtual host settings. ***$ vi /etc/httpd/conf/httpd.conf*** 7) Add 443 port to the virtual post and find SSLcertificateFile and SLCertificatekeyFile and add the appropriate file pathof your crt file and key file. 8) Save the file and restart the httpd server. ***$ service httpd restart*** 9) Open port 443 and block 80 in your local web server and access the site using https. You will be able to connect to the site using https. ***Eg: https://localhost/index*** ### Setting Up A New Rails Applications And Working With Controllers And Views URL: https://scriptcrunch.com/setting-up-a-new-rails-applications-and-working-with-controllers-and-views/ Last updated: 2026-06-23T08:56:24.000Z Controllers and views are the integral part of ruby on rails frameworks. The requests from the client is first sent to the server and the server directs the request to appropriate controller, the controllers in turn directs the request to a model if necessary and connects it to the view to show the output tot the user. The image below shows how the frameworks handles requests from the clients. ## Creating A Rails Application: 1) Set up the rails environment. Follow the link if you don't have rails setup in your workstation. ***[Setup Rails Environment](http://www.ask-cloud.com/2013/09/how-to-setup-ruby-on-rails-on-ubuntu.html?ref=scriptcrunch.com)*** 2)Once the rails environment is setup , open the terminal and create a directory where you can put your ruby project files. CD in to the directory and execute the following command to create a new rails applications. Here am gonna create a application called rails\_demo. Once the command is executed, it will create all the necessary files needed for a rails application. ***$ rails new rails\_demo*** 3) Rails comes with a default webrick we server. Once your application is created , you can check if it is working by starting the rails server. You can access your application in the web browser using https://localhost:3000\. Before starting the rails server make sure that your current directory is your application directory. In our example its rails\_demo. Execute the following command to start the rails server. ***$ rails server*** After the server has started and if you access your application through web browser ,you will see a welcome message. Use Cntrl + C to stop the server. ## Creating A Controller And And View: In this example we will create a controller and view to access it from the web browser. 1)Create a controllers and view by executing the following command. ***$ rails generate controller welcome index*** In the above command welcome is the controllers name and index is the view which is associated with the controller. View is a html document which renders the output to the users in the web browser. If you open the welcome controller present inside ***/demo\_rails/app/controllers/welcome\_controller.rb*** file, you can see that index in defined inside the welcome controller. View is located in /demo\_rails/app/views/welcome/index.html.erb 2) Now if you [go](https://scriptcrunch.com/tag/go/) the url *http://localhost:3000/welcome/index* you can see welcome message from the index view. It is just a html message which get created by default. You can try adding other html tags , scripts etc.. and view it in the browser. In the url **welcome** is the controller name and index is the view name. It is how rails routes the requests. When a controller is called ,the controller connects the view associated with it and shows the output in the web browser. Leave a comment for more queries. ### Introduction To Ruby On Rails MVC Framework URL: https://scriptcrunch.com/introduction-to-ruby-on-rails-mvc-framework/ Last updated: 2026-06-23T08:56:25.000Z Ruby on rails is a framework for developing web applications based on ruby programming language. Ruby is not only used for web application [development](https://scriptcrunch.com/tag/development/) but also for various other native applications. Ruby is purely object oriented and it make programming lots more easier using the oops concepts. Ruby has the same syntax like [python](https://scriptcrunch.com/tag/python/), perl, list etc,,.So if you have worked on python you would learn ruby pretty quickly. Ruby on rails on the other-hand is not a programming language but a opensource framework created in ruby to develop awesome ruby based web applications so quickly when compared to other languages and frameworks. It a developer friendly framework and , it does a lot of work for you by creating codes using codes. It will confuse you a little bit, but we will get to that in the later part of this article. ## What is a Framework: A framework is a software toolkit with prewritten code libraries and datas organized in structures , which helps you in developing applications. Ruby on rails framework is based on MVC architecture. So what the heck is a MVC architecture. To put it in a simple way. MVC pattern is a way to deveop an applcation in a organized and secure way. ## MVC Framework: MVC stands for model, view and controller. **Model:** It contains the data. All the data's associated with the application are contained by model. **View:** View is the web UI of the application where the user submits the requests and view contents of the application. **Controller:** Controller is the integral part of the MVC architecture. Controller handles the incoming user requests from the UI and process it according to the needs. If the request is to update or delete any data from the [database](https://scriptcrunch.com/tag/databases/) , the controller will process the request accordingly by sending appropriate requests to the database. If we take the traditional web applications, the view and the controller are bundled together. when a user creates a request for some data, the code that is bundled with the UI will process the request and connect to the database based on user needs. But in MVC the UI, business logic and data are seperated. ### NonMVC model: **MVC model:** ### How To Setup Ruby On Rails On Ubuntu With PostgreSQL Database URL: https://scriptcrunch.com/how-to-setup-ruby-on-rails-on-ubuntu-with-postgresql-database/ Last updated: 2026-06-23T08:56:25.000Z Ruby on rails is an excellent framework for developing web apps using ruby. And to be clear, ruby on rails is not a language but it is a framework. Lot of people misunderstand ruby on rails as a language. Using ruby on rails you can develop a web application really faster as opposed to other frameworks. Ruby on rails is a developer friendly framework and it makes life so easily by doing most of the [development](https://scriptcrunch.com/tag/development/) work for you. IN this [tutorials](https://scriptcrunch.com/tag/tutorials/) i will explain how to set up ruby on rails framework on your ubuntu machine and deploy a web application with postgreSQL [database](https://scriptcrunch.com/tag/databases/). ## Setting Up Ruby On Rails environment: 1) For setting up the ruby on rails environment you need to have ruby installed in your workstation. Install the development tools first, it will install all the dependencies needed for ruby environment. And then install the latest ruby from the apt repository. ***\# sudo apt-get install build-essential*** ***\# sudo apt-get install ruby1.9.1*** If you get any dependency error, just install those dependencies using apt. Also if you are running the old 1.8.7 version of ruby, make the system point to the newest version using the following command. \# ***sudo update\-alternatives \--config ruby*** 2) Now install rubygems using the following command. ***\# sudo apt-get install rubygems*** 3) Install rails framework using the following command. ***\# sudo gem install rails*** The above command will install rails frame work and by default rails uses sqlite database and webrick webserver. So for testing you can use the webrick web server. You can deploy rails application using apache web server by installing the passenger module for apache. 4) Create a sample rails application using the following command. ***\# sudo rails new demo\_app*** The above command will automatically creates the necessary configuration files and folder for the rails app. ## Installing And Setting Up PostgreSQL With Rails 1) Install postgreSQL using the following command \# ***sudo apt-get install postgreSQL*** 2) Install the gui for manaing the [databases](https://scriptcrunch.com/tag/databases/) using the following command. \# ***sudo apt-get install pgadmin3*** Use pgadmin3 in terminal to view the gui. 3) Now create a user "postgres" ***\# sudo -u postgres psql postgress*** 4) Set a password for the user postgres using the following command. It will prompt you to enter the password two times. ***\# password*** 5) Login in to postgres user with root privileges to use the psql cli to manage databases using terminal. ***\# su postgres*** 6)Create a database using the following commmand. ***\# createdb db\_name*** /\* db\_name can be any user defined name 6)Access the database using cli using the followin command. \# psql db\_name 7) The following commands are used to list the databases and tables. ***\# l*** \---> lists all the available databases ***\# c*** \---> lists the current database you are working with. ***\# d*** \---> lists the tables associated with the database. ***\# d tablename*** \--->shows the structure of the table. ## Creating a Rails Application with PostgreSQL: 1\. ***\# rails new psql\_demo -d postgresql*** The above command will create the necessary config files and folders needed for rails application to use postgresql. For further queries , leave a comment. ### PhP Classes and Objects Explained URL: https://scriptcrunch.com/php-classes-and-objects-explained/ Last updated: 2026-06-23T08:56:26.000Z Class: Class is a way to organize the data. For instance , you want to write a program to display the names of parts of a car. What you can do is you can echo out all the part names of a car. So , now you want to display the part names of 10 cars . Now echoing out sounds little bitter, isnt it? here is where object oriented concepts comes in to play. To solve the problem, we use the class concept. here int this [tutorial](https://scriptcrunch.com/tag/tutorials/) i have created a class called coder, which contains the coders details. So we create a class template called coder. Then we create many instances of the coder class to display the details of various other coders. Class systax: Object: Object is an instance of the class. class is like a template and we can create many copies of the class using the object. Object Syntax: Example: name =$a; $this->language =$b; *//$this keyword assigns the parameter value to the variables declared as public.* $this->position =$c; } function thisTest($a) { $this->name = $a; *//$this keyword here assigns the parameter to the variable name associated with function thisTest.* *}* } ?> OOP demo

This ia a php object oriented demo

showDetails("michael","php","junior programmer"); //using the person object , here we pass the parameters to the showDetails fucntion. echo "
".$person1->name."  ".$person1->language."

"; $person1->thisTest("libin"); echo "
".$person1->name."
"; ?> ### PhP Simulation Script Using Conditional Statements. URL: https://scriptcrunch.com/php-simulation-script-using-conditional-statements/ Last updated: 2013-05-05T13:26:00.000Z This script simulates a dog moving to its kennel. It consists of all conditional statements except switch. Initially we set to random positions for the dog and the kennel using the php function rand(). We set up the position using the x, y cordinates. Here i have used a 10X10 square. you can check out the script given below. You can see the demo here. ***[Simulation Demo](http://dogsimulation.ap01.aws.af.cm/?ref=scriptcrunch.com)*** ` Dog
$kennelX) $dogX--; if($dogY<$kennelY) $dogY++; elseif($dogY>$kennelY) $dogY--; echo '
';  
for($y=0;$y<$squaresize;$y++){  
       for($x=0;$x<$squaresize;$x++) {  
       if(($y==$kennelY)&&($x==$kennelX))  
        {  
        echo ''; //kennel is set  
        }        
        elseif (($y==$dogY)&&($x==$dogX))  
        {  
        echo ''; //dog is set  
        }          
        else  
        {  
        echo '.'; //prints empty square  
        }  
        echo ($x!= $squaresize-1)?"   ":"";  
        }  
        echo "
n"; } echo "
n"; }while ($dogX!=$kennelX || $dogY!=$kennelY); ?> ` ### Conditional Statements in PhP URL: https://scriptcrunch.com/conditional-statements-in-php/ Last updated: 2013-05-04T18:38:00.000Z 1\. If, else and ifelse: "; } elseif ($num<1) /*checks if the name is less than one or else it will go to the else statement */ { Echo "the number is less than one"."
"; } Else { Echo "if and else if dint work "."
"; } 2\. Conditional statement using ternary operators: 3\. For loop: "; //print the value of count for each iteration if($count==4) { echo "you have reached 4"."
"; break; //breaks out of the loop if the count value reaches 4 } } 4\. Switch Statement: Switch statement is a better version of if else statement. You might want to use the switch statement if you want to jump right to the answer. If an answer is found , it breaks out of the switch statement. 5.While and Do while: In do while, the code is executed and after that the condition is checked. It means if you use do while your code will be executed atleast one time irrespective of the condition. But in while loop, the condition is checked first and after that if it satisfies the condition , the code will be executed. See the examples below. "; $value++; } while($value<=10); //checks the condition after one successful execution $max = 1; while ($max<10) { echo $max."
"; $max++; } ?> ### Variables, Type casting ,Concatination and Constants in PhP URL: https://scriptcrunch.com/variables-type-casting-concatination-and-constants-in-php/ Last updated: 2013-05-04T13:48:00.000Z 1\. Variables: ***$*** sign is used for defining the variables in PHP. eg: ***$var\_1 =12***. Here the datatype is automatically assigned. You don't have to specify the datatype of a declared variable. ***echo*** is used to output the results. 2\. Changing a variable's data type: 4) and ($a>3))."
"; //gives output 1 since it satisfies the condition. && is a conditional operator settype($a, int); // sets the datatype to int even if the declared variable is of type float echo "$a"."
"; //displays only 5 since we set the data type to int echo (int)($b); //displays the int value since $b is typecasted to int .It does not change the real value but it changes the output. ?> 3\. Concatenation : "; //concatenates the two variables var1 and var2 using the dot operator. echo "$num1" . "$num2" ."
"; ?> 4\. Constants: In PhP you can define constants. The value of the constant remains unchanged throughout the execution of the program. You can define a constant using the ***define ()*** function as shown below. It is common to use capital letters for defining the constants. Also avoid using the php reserved keywords such as boolean, echo etc,,, "; define ("MY_ID" , 1234); //defines the value for an integer. echo MY_ID . "
"; ?> ### How To Configure PDO Mysql Driver On Ubuntu URL: https://scriptcrunch.com/how-to-configure-pdo-mysql-driver-on-ubuntu/ Last updated: 2013-04-30T16:34:00.000Z I assume that you have lamp stack installed in your system. And if you have PHP version lower than 5.1, you have to you have to upgrade it to php5. Step 1: Check the PHP info if the PDO driver is already installed. It will be automatically installed if you installed the latest lamp server. You can check the PHP info by running the following script on the server. Step 2: Run the script and you will find the whole PHP info. Click cntrl+F and check for PDO. You will find the PDO info like the image below. [![](http://4.bp.blogspot.com/-DnxSO7LGSP4/UX_w3BaOlUI/AAAAAAAABBw/3WTOhRPvDqI/s640/phpinfo().png)](http://4.bp.blogspot.com/-DnxSO7LGSP4/UX%5Fw3BaOlUI/AAAAAAAABBw/3WTOhRPvDqI/s1600/phpinfo%28%29.png?ref=scriptcrunch.com) Step 3: Just add the following line to the php.ini file. You can find the location of the php.ini file in the phpinfo page. extension=pdo.so Step 4: Restart the apache server using the following command. sudo service apache2 restart Step 5: run the following script to see if your PDO driver and mysql connection are working or not. `getMessage (); } ?> ` Step 6: If you get the error " driver not found", you have to recheck your installation. ### MongoDB and Php Beginner Tutorials URL: https://scriptcrunch.com/mongodb-and-php-beginner-tutorials/ Last updated: 2026-06-23T08:56:26.000Z [Database](https://scriptcrunch.com/tag/databases/) connection: Connecting [mongoDB](https://scriptcrunch.com/tag/mongodb/) with php is really simple if your configured php with mongoDB using php driver. Assuming that you have already configured php with mongoDB am going to explain the php script to connect mongoDB. For configuring mongoDb with php inlinux , you can follow this link. ***[How to Configure Php with mongoDb on Ubuntu](http://%3C/?php%20//connect%20to%20mongoDB%20using%20mongo%20class%20$m%20=%20new%20Mongo%28%29;%20//selecting%20the%20database,%20which%20will%20be%20created%20on%20the%20fly%20$db%20=%20$m-%3EselectDB%28%22comtechies%22%29;%20//creating%20or%20selecting%20a%20collection.%20If%20the%20collection%20is%20already%20there%20it%20will%20be%20selected%20or%20it%20will%20be%20created%20on%20the%20fly.%20$collection%20=%20$db-%3Ecomtechies-%3Edemo;%20//creating%20a%20document%20with%20array%20$doc%20=%20array%28%20%20%20%20%20%20%20%20%20%22name%22%20=%3E%20%22bibin%22,%20%20%20%20%20%20%20%20%20%22place%22%20=%3E%20%22kollemcode%22,%20%20%20%20%20%20%20%20%20%22position%22%20=%3E%20%22admin%22%20%29;%20//inserting%20the%20document%20in%20to%20collection%20$collection-%3Einsert%28$doc%29;%20?%3E)*** Sample Php web app using mongoDB: selectDB("comtechies"); //creating or selecting a collection. If the collection is already there it will be selected or it will be created on the fly. $collection = $db->comtechies->demo; //creating a document with array $doc = array( "name" => "bibin", "place" => "kollemcode", "position" => "admin" ); //inserting the document in to collection $collection->insert($doc); //store the first row in the collection to the variable result $result = $collection->findone(); //shows the result var_dump($result); ?> ### How To Convert .Pem File To .ppk Usign Puttygen On Ubuntu URL: https://scriptcrunch.com/how-to-convert-pem-file-to-ppk-usign-puttygen-on-ubuntu/ Last updated: 2013-04-24T07:34:00.000Z Converting a .pem to .ppk format is a matter of one line code. First, you need to have puttygen installed on your system to convert pem to ppk. Step1: Install puttygen by issuing the following command in terminal. sudo apt-get install putty-tools Step2:Make your current directory where you have the .pem file and issue the following commands. Let's say I have my .pem file in downloads folder cd /downloads puttygen keyname.pem -o keyname.ppk //keyname is your keys name That's it , you are done. You can see the converted .ppk file in the folder. ### How To Host A JSP,PHP,Python Websites For Free URL: https://scriptcrunch.com/how-to-host-a-jspphppython-websites-for-free/ Last updated: 2026-06-23T08:56:26.000Z With the advent of cloud platform services, many PaaS providers offer free hosting service as their basic plan. This let users try out their platform and you can test the service for a particular time. For instance amazon [AWS](https://scriptcrunch.com/tag/aws/) can be used for free for one year. All you need is a credit card to sign up. Amazon offers one year free tier , in which you can deploy a micro server, which can be a [linux](https://scriptcrunch.com/tag/linux/) or windows instance. Most of the PaaS service providers provide a basic free plan or a free trial. Am going to explain few of those services in which you can host your websites for free for testing purposes. [1.Cloudbees: ](http://www.cloudbees.com/?ref=scriptcrunch.com)Cloudbees is an excellant platform for deploying your java based applications. Sign up process is so easy and you can deploy your website in cloudbees in minutes. Just you have to upload the war format of your jsp website. you can deploy php and various website in cloudbees . It also offers two [databases](https://scriptcrunch.com/tag/databases/) Mysql and MongoHQ which is a noSQL [database](https://scriptcrunch.com/tag/databases/). Both databases have basic free plan. [2.Appfog:](http://www.appfog.com/?ref=scriptcrunch.com) Appfog is also an excellant platform for deploying website developed in various languages. App fog has a basic free plan in which you can deploy and test you web applications on cloud. Appfog basically uses three IaaS services as their backend services. [3.Xeround: ](http://www.xeround.com/?ref=scriptcrunch.com)Xeround offers free mysql database service on cloud. Basic free paln includes 10 mb free database storge. Which is quite enough for testing purposes. [Tutorials](https://scriptcrunch.com/tag/tutorials/): 1. [Cloudbees](http://www.comtechies.com/2013/03/how-to-deploy-jsp-and-mysql-website-on.html?ref=scriptcrunch.com) 2. [Xeround](http://www.comtechies.com/2013/04/free-cloud-databases.html?ref=scriptcrunch.com) 3. [Cloud Databases](http://www.comtechies.com/2013/04/free-cloud-databases.html?ref=scriptcrunch.com) ### How To Setup Php ,Mysql And Apache To Run On Windows And Linux URL: https://scriptcrunch.com/how-to-setup-php-mysql-and-apache-to-run-on-windows-and-linux/ Last updated: 2026-06-23T08:56:27.000Z Setting up the Php, Mysql and Apache environment on windows and [Linux](https://scriptcrunch.com/tag/linux/) is not a hard thing to do. Either you can install everything separately or you can install it as a package. For windows it is called WAMP server (Windows Apache Mysql Php) and for linux it is called LAMP server (Linux Apache Mysql Php). ### 1)Installing WAMP on windows: 1. Download Wamp server from here . ***[Downoad WAMP](http://www.wampserver.com/?ref=scriptcrunch.com)*** 2. Once the file is downloaded, click and install it. 3. You will find the wamp server icon on the task bar. 4. Right click the icon and you will see all the installed services. ie, php, MySQL, Apache and phpmyadmin. 5. Phpmyadmin is the GUI tool for managing Mysql [databases](https://scriptcrunch.com/tag/databases/). 6. By default the username of the MySQL [database](https://scriptcrunch.com/tag/databases/) will be "root". and there will be no password. You can set user name and password using command line interface of Mysql. 7. Using wamp server you can run your php and mysql websites on your localhost. ### 2)Installing LAMP server on Linux: 1. Open linux terminal and type the following code to install LAMP server in Linux. sudo apt-get install Lamp-server^