<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sohanyadavdevops on Medium]]></title>
        <description><![CDATA[Stories by Sohanyadavdevops on Medium]]></description>
        <link>https://medium.com/@sohanyadavdevops?source=rss-77bb3d04caf1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8ygpfncKZwYm5kDA</url>
            <title>Stories by Sohanyadavdevops on Medium</title>
            <link>https://medium.com/@sohanyadavdevops?source=rss-77bb3d04caf1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:32:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sohanyadavdevops/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Getting Started with AWS Lambda: A Beginner’s Guide]]></title>
            <link>https://medium.com/@sohanyadavdevops/getting-started-with-aws-lambda-a-beginners-guide-448c4319a81d?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/448c4319a81d</guid>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 10:11:47 GMT</pubDate>
            <atom:updated>2024-11-05T10:11:47.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*QEB1hOpjmj24oSVQSzM4mA.png" /></figure><p>Today, let’s explore AWS Lambda, an Amazon Web Services (AWS) computing service. With so many other compute services available, such as AWS EC2, AWS Elastic Beanstalk, and AWS OpsWorks, you might wonder why AWS Lambda is needed. In this AWS Lambda tutorial, we’ll delve into what AWS Lambda is, why it’s used, and the specific use cases where it stands out as the best choice.</p><p>Let’s see how Amazon defines AWS Lambda and then we will take a deep dive into the key concepts, and understand a use case with a hands-on in the end.</p><h3>What is AWS Lambda?</h3><p>Amazon explains AWS Lambda (λ) as a ‘serverless’ compute service, meaning the developers, don’t have to worry about which AWS resources to launch, or how they will manage them, they just put the code on lambda and it runs, it’s that simple! It helps you to focus on core-competency i.e. App Building or the code.</p><h3>Where will I use AWS Lambda?</h3><p>AWS Lambda executes your backend code while automatically managing the underlying AWS resources. When we say “manage,” this includes tasks like launching and terminating instances, performing health checks, auto-scaling, and applying updates or patches.</p><h3>So, how does it work?</h3><p>The code you want Lambda to run is called a <strong>Lambda function</strong>. Now, as we see a function runs only when it is called, right? Here, the <strong>Event Source</strong> is the entity that triggers a Lambda Function, and then the task is executed.</p><p><strong>Let’s take an example to understand it more clearly.</strong></p><p>Suppose you have an app for image uploading. Now when you upload an image, there are a lot of tasks involved before storing it, such as resizing, applying filters, compression, etc.</p><p>So, this task of uploading an image can be defined as an <strong>Event Source</strong> or the ‘trigger’ that will call the Lambda Function, and then all these tasks can be executed via the Lambda function.</p><p>In this example, a developer just has to define the event source and upload the code.</p><p>Let’s understand this example with real AWS resources now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*cqXvfkUNU1fRonov.png" /></figure><p>Over here we will be uploading images in the form of objects to an S3 bucket. This uploading of an image to the S3 bucket will become an event source or the ‘trigger’.</p><p>The whole process, as you can see in the diagram, is divided into 5 steps, let’s understand each one of them.</p><ol><li>The user uploads an image (object) to a source bucket in S3 which has a notification attached to it, for Lambda.</li><li>The notification is read by S3 and it decides where to send that notification.</li><li>S3 sends the notification to Lambda, this notification acts as an invoke call of the lambda function.</li><li>Execution role in Lambda can be defined by using IAM (Identity and Access Management) to give access permission for the AWS resources, for this example here it would be S3.</li><li>Finally, it invokes the desired lambda function which works on the object that has been uploaded to the S3 bucket.</li></ol><p><strong><em>If you were to solve this scenario traditionally, along with development, you would have hired people to manage the following tasks:</em></strong></p><p>This would have been an expensive, tedious, and tiresome task, therefore the need for AWS Lambda is justified. AWS Lambda is compatible with Node.JS, Python, and Java, so you can upload your file in a zip, define an event source and you are set!</p><p><strong><em>We now know — How Lambda works and What Lambda does</em>.</strong></p><p>Now, let’s understand-</p><ul><li><strong>Where to use Lambda?</strong></li><li><strong>What purpose does Lambda serve, that other AWS Compute services don’t?</strong></li></ul><p>If you were to architect a solution to a problem, you should be able to identify where to use Lambda, right?</p><p>So, as an architect, you have the following options to execute a task:</p><ul><li>AWS EC2</li><li>AWS Elastic Beanstalk</li><li>AWS OpsWorks</li><li>AWS Lambda</li></ul><p>Let’s take the above use case as an example and understand why we chose Lambda to solve it.</p><p>AWS OpsWorks and AWS ElasticBeanstalk are used to deploy an app, so our use case is<strong> not </strong>to create an app<strong> </strong>but to execute a back-end code.</p><h3>Then why not EC2?</h3><p>If you were to use EC2, you would have to architect everything i.e. load balancer, EBS volumes, software stacks, etc. In lambda, you don’t have to worry about anything, insert your code, and AWS will manage the rest!</p><p><em>For example</em>, in EC2 you would be installing the software packages on your virtual machine which would support your code, but in Lambda you don’t have to worry about any VM, insert plain code and Lambda will execute it for you.</p><p>But, if your code will be running for hours, and you expect a continuous stream of requests, you should probably go with EC2, because the architecture of Lambda is for a sporadic kind of workload, wherein there will be some quiet hours and some spikes in the no. of requests as well.</p><p><em>For example</em>, logging the email activity for say a small company, would see more activity during the day than in the night, also there could be days when there are fewer emails to be processed, and sometimes the whole world could start emailing you! In both cases, Lambda is at your service.</p><p>Considering this use case for a big social networking company, where the emails are never-ending because it has a huge user base, there may be better choices than Lambda.</p><h3>Limitations of AWS Lambda</h3><p>AWS Lambda is designed with certain limitations:</p><ul><li><strong>Disk Size</strong>: Limited to 512 MB.</li><li><strong>Memory</strong>: Ranges from 128 MB to 1536 MB.</li><li><strong>Execution Timeout</strong>: Maximum of 5 minutes.</li><li><strong>Request Body Payload</strong>: Cannot exceed 6 MB.</li><li><strong>Request Body</strong>: Limited to 128 KB.</li></ul><p>These are design boundaries, not limitations, and if your use case doesn’t fit within these, you can explore other AWS compute services.</p><h3>Pricing in AWS Lambda</h3><p>Like most AWS services, AWS Lambda follows a pay-per-use pricing model. You are charged based on the following parameters:</p><h3>1. Number of Requests:</h3><ul><li>The first 1 million requests per month are free.</li><li>$0.20 per million requests thereafter.</li></ul><h3>2. Duration:</h3><ul><li>Duration is calculated from the start of code execution until it returns or terminates, rounded up to the nearest 100ms.</li><li>You are charged $0.00001667 for every GB-second used, depending on the amount of memory allocated to your function.</li></ul><h3>Conclusion</h3><p>AWS Lambda is a powerful, serverless computing service that allows developers to focus on writing code without worrying about managing infrastructure. It’s ideal for event-driven applications with sporadic workloads and offers a cost-effective solution for executing backend code. With the knowledge gained from this guide, you should now be able to identify when and where to use AWS Lambda effectively in your projects.</p><p>Have I enjoyed the read? That’s it; we’re done!</p><blockquote>For hassle-free Cloud Management with DevOps at the center of the process, contact me on <a href="https://www.linkedin.com/in/yadavsohan/"><strong>Linkedin.com</strong></a></blockquote><blockquote><em>If you found this article helpful, please </em><strong><em>don’t forget</em></strong><em> to hit the </em><strong><em>Follow</em></strong><em> and </em><strong><em>Clap </em></strong><em>buttons to help me write more articles like this.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=448c4319a81d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to Linux Networking Commands for DevOps Professionals]]></title>
            <link>https://medium.com/@sohanyadavdevops/the-ultimate-guide-to-linux-networking-commands-for-devops-professionals-016cbbdbddfb?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/016cbbdbddfb</guid>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 07:08:26 GMT</pubDate>
            <atom:updated>2024-10-10T07:08:26.926Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqJ5paxjX0uQ2efwZkMmDg.png" /></figure><p><strong>Introduction: </strong>In the world of DevOps, networking is a cornerstone of infrastructure management. Understanding and efficiently using Linux networking commands is essential for troubleshooting, monitoring, and managing network configurations. This guide provides a comprehensive list of Linux networking commands, complete with examples and explanations, to equip you with the tools you need to excel in your role.</p><h3>Section 1: Interface and Address Management</h3><p><strong>1. ifconfig — Display Network Interface Information</strong></p><pre>ifconfig</pre><ul><li>ifconfigis a traditional command used to configure and display network interface parameters. It provides information such as IP addresses, netmasks, and broadcast addresses.</li></ul><p><strong>2. ip — Show/Manipulate Routing, Devices, Policy Routing, and Tunnels</strong></p><pre>ip address show</pre><ul><li>Theip command is the modern replacement forifconfig. It provides comprehensive options for managing network interfaces, routes, and tunnels.</li></ul><p><strong>3. hostname — Show or Set the System’s Host Name</strong></p><pre>hostname</pre><ul><li>Thehostname command displays or sets the system&#39;s hostname, which is used to identify the system on a network.</li></ul><p><strong>4. iwconfig — Configure a Wireless Network Interface</strong></p><pre>iwconfig</pre><ul><li>iwconfigis used for configuring wireless network interfaces. It allows you to set parameters like SSID, frequency, and encryption keys.</li></ul><p><strong>5. ethtool — Display or Change Ethernet Card Settings</strong></p><pre>ethtool eth0</pre><ul><li>ethtoolprovides detailed information about network interfaces and allows you to modify settings such as speed and duplex mode.</li></ul><p><strong>6. resolvconf — Manage DNS Information</strong></p><pre>resolvconf -u</pre><ul><li>resolvconfis used to manage DNS resolver information, ensuring consistent DNS settings across the system.</li></ul><p><strong>7. hostnamectl — Control the System Hostname and Related Settings</strong></p><pre>hostnamectl status</pre><ul><li>hostnamectlis part of systemd and allows you to view or change the system’s hostname and other related settings.</li></ul><h3>Section 2: Route and Traffic Management</h3><p><strong>1. route — Display or Manipulate the IP Routing Table</strong></p><pre>route -n</pre><ul><li>Theroute command displays or modifies the IP routing table. It’s essential for managing how packets are routed through a network.</li></ul><p><strong>2. ip route — Manage Routing Tables</strong></p><pre>ip route show</pre><ul><li>Theip route command is part of the ip suite, used for displaying and modifying the routing table.</li></ul><p><strong>3. route add — Add a New Route</strong></p><pre>route add default gw 192.168.1.1</pre><ul><li>This command adds a default gateway to the routing table, directing traffic destined for outside the local network.</li></ul><p><strong>4. route del — Delete a Route</strong></p><pre>route del -net 192.168.2.0 netmask 255.255.255.0</pre><ul><li>This command removes a specific route from the routing table, which can be necessary when reconfiguring network paths.</li></ul><p><strong>5. arp — Display or Modify the ARP Cache</strong></p><pre>arp -a</pre><ul><li>arp shows the Address Resolution Protocol (ARP) cache, mapping IP addresses to MAC addresses on the local network.</li></ul><p><strong>6. iptables — Administration Tool for IPv4 Packet Filtering and NAT</strong></p><pre>iptables -L</pre><ul><li>iptables is a powerful utility for setting up, maintaining, and inspecting the tables of IP packet filter rules in the Linux kernel.</li></ul><h3>Section 3: Diagnostic and Monitoring Tools</h3><p><strong>1. ping — Send ICMP ECHO_REQUEST to Network Hosts</strong></p><pre>ping google.com</pre><ul><li>ping checks the reachability of a host on the network by sending ICMP echo requests and measuring the response time.</li></ul><p><strong>2. traceroute — Print the Route Packets Take to Network Host</strong></p><pre>traceroute google.com</pre><ul><li>traceroute shows the path that packets take from your system to a specified host, useful for diagnosing routing issues.</li></ul><p><strong>3. netstat — Print Network Connections, Routing Tables, Interface Statistics</strong></p><pre>netstat -an</pre><ul><li>netstat provides a detailed view of network connections, routing tables, and interface statistics.</li></ul><p><strong>4. ss — Display Socket Statistics</strong></p><pre>ss -tulpn</pre><ul><li>ss is a modern replacement for netstat, providing more detailed information about TCP, UDP, and UNIX socket connections.</li></ul><p><strong>5. lsof — List Open Files</strong></p><pre>lsof -i :80</pre><ul><li>lsof lists open files and network connections. It’s particularly useful for identifying which processes are using specific network ports.</li></ul><p><strong>6. tcpdump — Dump Traffic on a Network</strong></p><pre>tcpdump -i eth0</pre><ul><li>tcpdump captures and displays the packets on a network interface. It’s invaluable for diagnosing network issues at the packet level.</li></ul><p><strong>7. iftop — Display Bandwidth Usage on an Interface</strong></p><pre>iftop</pre><ul><li>iftop shows real-time bandwidth usage on a network interface, helping you identify bandwidth-intensive processes.</li></ul><p><strong>8. iptraf — Interactive Color IP LAN Monitor</strong></p><pre>iptraf</pre><ul><li>iptrafprovides real-time monitoring of network traffic with an interactive, color-coded display.</li></ul><p><strong>9. mtr — Network Diagnostic Tool</strong></p><pre>mtr google.com</pre><ul><li>mtr combines the functionality of ping and traceroute, providing a real-time view of the network&#39;s performance as packets travel from source to destination.</li></ul><p><strong>10. nload — Visual Representation of Incoming and Outgoing Traffic</strong></p><pre>nload</pre><ul><li>nload provides a graphical representation of network traffic, showing the incoming and outgoing data rates.</li></ul><p><strong>11. iperf — Tool for Measuring TCP and UDP Bandwidth Performance</strong></p><pre>iperf -c server_ip</pre><ul><li>iperf measures the maximum TCP and UDP bandwidth performance between two hosts, making it useful for network performance testing.</li></ul><p><strong>12. fping — Quickly Ping Multiple Hosts</strong></p><pre>fping -a -g 192.168.1.1 192.168.1.254</pre><ul><li>fpingis similar toping but allows you to ping multiple hosts simultaneously, providing a quick overview of network reachability.</li></ul><h3>Section 4: DNS and Connectivity Utilities</h3><p><strong>1. dig — DNS Lookup Utility</strong></p><pre>dig google.com</pre><ul><li>digqueries DNS name servers, providing detailed information about DNS records and helping to troubleshoot DNS issues.</li></ul><p><strong>2. nslookup — Query Internet Name Servers Interactively</strong></p><pre>nslookup google.com</pre><ul><li>nslookupis a user-friendly tool for querying DNS servers, providing interactive DNS queries.</li></ul><p><strong>3. host — DNS Lookup Utility</strong></p><pre>host google.com</pre><ul><li>Thehost command performs DNS lookups and returns information about the given domain name.</li></ul><p><strong>4. nmap — Network Exploration Tool and Security Scanner</strong></p><pre>nmap -sP 192.168.1.0/24</pre><ul><li>nmapis used for discovering hosts and services on a network, providing information about the devices and their open ports.</li></ul><p><strong>5. netcat (nc) — Arbitrary TCP and UDP Connections and Listens</strong></p><pre>nc -l 8080</pre><ul><li>netcat, also known asnc, is a versatile tool for reading from and writing to network connections using TCP or UDP. It can be used for network diagnostics, testing, and data transfer.</li></ul><h3>Section 5: Remote Access and File Transfer</h3><p><strong>1. sshd — OpenSSH Daemon</strong></p><pre>service sshd restart</pre><ul><li>sshdis the OpenSSH server process that handles incoming SSH connections. Restarting it can resolve remote access issues.</li></ul><p><strong>2. ssh-keygen — Generate, Manage, and Convert Authentication Keys for SSH</strong></p><pre>ssh-keygen -t rsa</pre><ul><li>ssh-keygenis used to generate, manage, and convert SSH authentication keys, enabling secure SSH connections.</li></ul><p><strong>3. scp — Secure Copy (Remote File Copy Program)</strong></p><pre>scp file.txt user@remote:/path/to/destination</pre><ul><li>scpsecurely copies files between hosts over a network using SSH. It’s a reliable method for transferring files while maintaining security.</li></ul><p><strong>4. telnet — User Interface to the TELNET Protocol</strong></p><pre>telnet google.com 80</pre><ul><li>telnetis a protocol for accessing remote servers over a network. While largely replaced by SSH, it’s still useful for testing connections to specific ports.</li></ul><p><strong>5. curl — Command Line Tool for Transferring Data with URL Syntax</strong></p><pre>curl http://example.com/api</pre><ul><li>curlis a versatile tool for making HTTP requests from the command line. It supports a wide range of protocols and is often used for testing APIs and downloading files.</li></ul><p><strong>6. wget — Non-interactive Network Downloader</strong></p><pre>wget http://example.com/file.zip</pre><ul><li>wgetis a non-interactive command-line utility for downloading files from the web. It’s particularly useful for downloading large files or mirroring entire websites.</li></ul><h3>Section 6: Advanced Network Utilities</h3><p><strong>1. ss — Show Socket Statistics</strong></p><pre>ss -s</pre><ul><li>ssprovides detailed statistics on sockets, similar tonetstat, but with more advanced features and better performance.</li></ul><p><strong>2. ss — Show Listening Sockets</strong></p><pre>ss -l</pre><ul><li>This command displays all the sockets that are currently in a listening state, which is crucial for identifying active services on a server.</li></ul><p><strong>3. tcpdump — Capture and Display Packets on a Network</strong></p><pre>tcpdump -A -i eth0</pre><ul><li>This command captures and displays network packets in ASCII format, useful for debugging network traffic in a human-readable format.</li></ul><p><strong>4. nc — Utility for Reading from and Writing to Network Connections</strong></p><pre>nc -zv 192.168.1.1 22</pre><ul><li>netcatcan also be used to scan for open ports and services on a network, making it a powerful tool for network diagnostics.</li></ul><p><strong>5. ss — Display Socket Statistics</strong></p><pre>ss -t -a</pre><ul><li>This variation of thess command shows detailed statistics for TCP sockets, including both active and listening connections.</li></ul><p><strong>6. nmtui — Text User Interface for Controlling NetworkManager</strong></p><pre>nmtui</pre><ul><li>nmtuiprovides a text-based interface for managing NetworkManager, allowing you to configure network interfaces and connections interactively.</li></ul><p><strong>7. nmcli — Command-Line Client for NetworkManager</strong></p><pre>nmcli connection show</pre><ul><li>nmcliis the command-line interface for NetworkManager, used for managing network connections and settings.</li></ul><p><strong>8. nmcli — List Available Wi-Fi Networks</strong></p><pre>nmcli device wifi list</pre><ul><li>This command lists all available Wi-Fi networks, providing information about SSIDs, signal strength, and security settings.</li></ul><p><strong>9. iperf — Measure TCP and UDP Bandwidth Performance</strong></p><pre>iperf -c server_ip</pre><ul><li>iperfis a tool for measuring the bandwidth between two hosts, supporting both TCP and UDP protocols.</li></ul><p><strong>10. fping — Quickly Ping Multiple Hosts</strong></p><pre>fping -a -g 192.168.1.1 192.168.1.254</pre><ul><li>fpingallows you to ping multiple hosts with a single command, making it faster than the traditional methodping for checking multiple devices.</li></ul><p><strong>11. nmap — Security Scanner and Network Exploration Tool</strong></p><pre>nmap -sP 192.168.1.0/24</pre><ul><li>Thisnmap command scans a subnet for active hosts, providing a quick overview of devices on your network.</li></ul><p><strong>12. netcat — Arbitrary TCP and UDP Connections and Listens</strong></p><pre>nc -l 8080</pre><ul><li>netcatcan be used as a simple TCP/UDP server, allowing you to listen on a specific port and test connections.</li></ul><p><strong>13. scp — Securely Copy Files Between Hosts</strong></p><pre>scp file.txt user@host:/path/to/destination</pre><ul><li>Another example ofscp in action is securely transferring files between different hosts over a network.</li></ul><p><strong>14. tcpdump — Capture and Display Packets on a Network</strong></p><pre>tcpdump -i eth0 tcp port 80</pre><ul><li>Thistcpdump command captures TCP packets on port 80, which is useful for monitoring HTTP traffic specifically.</li></ul><p><strong>Conclusion:</strong></p><p>These commands cover a wide range of networking tasks and are invaluable for DevOps professionals managing Linux-based systems. From basic connectivity checks to advanced network diagnostics, these tools empower you to maintain and optimize your network infrastructure efficiently.</p><p>Whether you are troubleshooting network issues, monitoring performance, or securing your environment, having a solid understanding of these commands will make you a more effective and confident DevOps engineer.</p><p>I hope this helps! Follow for more such stories 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/0*O6rdOuCF2mlI-rsc.gif" /></figure><p>Enjoy it! 🍻 That’s It; we are done…</p><blockquote><em>For hassle-free Cloud Management with DevOps at the center of the process, contact me on </em><a href="https://www.linkedin.com/in/yadavsohan/"><strong><em>Linkedin.com</em></strong></a></blockquote><blockquote>If you found this article helpful, please <strong>don’t forget</strong> to hit the <strong>Follow</strong> and <strong>Clap </strong>buttons to help me write more articles like this.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=016cbbdbddfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure SSH to use two-factor authentication]]></title>
            <link>https://medium.com/@sohanyadavdevops/configure-ssh-to-use-two-factor-authentication-19e8196fc39d?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e8196fc39d</guid>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[two-factor-authentication]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Mon, 23 Sep 2024 04:49:00 GMT</pubDate>
            <atom:updated>2024-09-23T04:49:00.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*-pazOtm2X4qW6YH_FDNXYA.png" /></figure><h3>1. Overview</h3><p>SSH, the secure shell, is often used to access remote Linux systems. Because we often use it to connect with computers containing important data, it’s recommended to add another security layer. Here comes the two-factor authentication (<em>2FA</em>).</p><h3>What is two-factor authentication?</h3><p>Multi-factor authentication is a method of confirming your identity using at least two different ways of authentication. The most common and easiest to implement example of two-factor authentication uses a combination of passphrase (a complex password, often made of several words) and one-time passcode generated by a mobile app.</p><p>We will use the Google Authenticator app available for Android (in the <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2">Play Store</a>) and iOS (in <a href="https://itunes.apple.com/us/app/google-authenticator/id388497605">iTunes</a>) to generate authentication codes.</p><h3>What you’ll need</h3><ul><li>A computer running Ubuntu 16.04 LTS or above</li><li>A phone running Android or iOS</li><li>A configured SSH connection</li><li>You should understand the danger of stolen passwords.</li><li>You don’t need to know what two-factor authentication is and how it works.</li></ul><h3>2. Installing and configuring required packages</h3><h3>Installing the Google Authenticator PAM module</h3><p>Start a terminal session and type:</p><pre>sudo apt install libpam-google-authenticator</pre><p><strong>Configuring SSH</strong></p><p>To make SSH use the Google Authenticator PAM module, add the following line to the file</p><pre>sudo vim /etc/pam.d/sshd</pre><p>Add the following Line in the File sshd</p><pre>auth required pam_google_authenticator.so</pre><p>Now you need to restart the sshd daemon using:</p><pre>sudo systemctl restart sshd.service</pre><p>Modify\change ChallengeResponseAuthentication from no to yes, so this part of the file looks like this:</p><pre>sudo vim /etc/ssh/sshd_config</pre><pre># Change to yes to enable challenge-response passwords (beware issues with<br># some PAM modules and threads)<br>ChallengeResponseAuthentication no # CHANGE THIS TO YES</pre><pre># Change to no to disable tunnelled clear text passwords<br>#PasswordAuthentication yes</pre><pre>google-authenticator</pre><p>Simply type “<strong>y</strong>” (<strong>yes</strong>) as the answer in most situations. If something goes wrong, you can type again the ‘<strong>google-authenticator</strong>‘ command to reset the settings.</p><ul><li>Do you want authentication tokens to be time-based (y/n) <strong>y</strong></li></ul><p>After this question, you will get your ‘<strong>secret key</strong>‘ and ‘<strong>emergency codes</strong>‘. Write down these details somewhere, we will need the <strong>‘secret key</strong>‘ later on to set up the <strong>Google Authenticator</strong> app.</p><pre># google-authenticator</pre><pre>Do you want authentication tokens to be time-based (y/n) y<br>Warning: pasting the following URL into your browser exposes the OTP secret to Google:<br>  <a href="https://www.google.com/chart?chs=200x200&amp;chld=M|0&amp;cht=qr&amp;chl=otpauth://totp/root@tecmint%3Fsecret%3DCYZF2YF7HFGX55ZEPQYLHOO5JM%26issuer%3Dtecmint">https://www.google.com/chart?chs=200x200&amp;chld=M|0&amp;cht=qr&amp;chl=otpauth://totp/root@tecmint%3Fsecret%3DCYZF2YF7HFGX55ZEPQYLHOO5JM%26issuer%3Dtecmint</a><br>Failed to use libqrencode to show QR code visually for scanning.<br>Consider typing the OTP secret into your app manually.<br>Your new secret key is: CYZF2YF7HFGX55ZEPQYLHOM<br>Enter code from app (-1 to skip): -1 Code confirmation skipped Your emergency scratch codes are: 83714291 53083200 80975623 57217008 77496339</pre><p>Next, follow the setup wizard and in most cases type the answer as “<strong>y</strong>” (<strong>yes</strong>) as shown below.</p><pre>Do you want me to update your &quot;/root/.google_authenticator&quot; file (y/n) y Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y By default, tokens are good for 30 seconds and in order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n) y If the computer that you are logging into isn&#39;t hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n) y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*p_Z0QWLTE6uH2M2q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*pE3acTJ65hKhxDI1.png" /></figure><h3>4. Adding the secret key to Google Authenticator</h3><p>We will use the latest version of Authenticator from the Play Store. The process shouldn’t look very different on iOS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/0*7CoB-5jGIVqnGkLb.png" /></figure><h3>Adding the secret key using QR code</h3><p>Touch the Add icon (+) and select “Scan a barcode”. Use a phone camera to scan the QR code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/0*inMpsx2zW7qGqlER.png" /></figure><h3>Adding the Secret key using the Provided Key</h3><p>Touch the Add icon (+) and select “Enter a provided key”. Enter a name that you will recognize as being your 2FA method for SSH, then type the secret key provided by google-authenticator command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/0*QvHHDs24HgKR4vJB.png" /></figure><h3>5. Getting help</h3><p>Congratulations! You have just configured two-factor authentication for the SSH shell using Google Authenticator. Every time you (or some bad guy with your password…) try to log in to your SSH shell, you (or this bad guy) will be asked for an authentication key in addition to a traditional passphrase.</p><h3>Summary</h3><p>In this post, I showed “Configure SSH to use two-factor authentication”</p><blockquote>Enjoy it! 🍻 That’s It; we are done…</blockquote><blockquote>For hassle-free Cloud Management with DevOps at the center of the process, contact me on <a href="https://www.linkedin.com/in/yadavsohan/"><strong>Linkedin.com</strong></a></blockquote><blockquote><em>If you found this article helpful, please </em><strong><em>don’t forget</em></strong><em> to hit the </em><strong><em>Follow</em></strong><em> and </em><strong><em>Clap </em></strong><em>buttons to help me write more articles like this.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e8196fc39d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Commands and Concepts of Git & Github]]></title>
            <link>https://medium.com/@sohanyadavdevops/basic-commands-and-concepts-of-git-github-f0cce5203fe4?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0cce5203fe4</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 05:05:18 GMT</pubDate>
            <atom:updated>2024-08-30T05:05:18.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*8YLwmEX7g2f57KESpp_w4A.jpeg" /></figure><p><strong>Basic Commands and Concepts of Git &amp; Github:</strong></p><ul><li><strong>Installation</strong>:</li><li><strong>git apt-get install git</strong>: This command install Git using the APT package manager on Debian-based Linux systems.</li><li><strong>Check Git Version</strong>:</li><li><strong>git — version</strong>: Verify the installed version of Git on your system.</li><li><strong>Initialising a Repository</strong>:</li><li><strong>mkdir devops_batch_6</strong>: Create a new directory named <strong>devops_batch_6</strong>.</li><li><strong>git init</strong>: Initialise a new Git repository within the current directory.</li><li><strong>Viewing Directory Contents</strong>:</li><li><strong>ls -a</strong>: List all files and directories, including hidden ones, in the current directory.</li><li><strong>Creating a File</strong>:</li><li><strong>touch commands.tx</strong>t: Create a new file named <strong>commands.txt</strong>.</li><li><strong>Checking Status</strong>:</li><li><strong>git status</strong>: Display the current status of the repository, indicating untracked and modified files.</li><li>Adding Files to Staging Area:</li><li><strong>git add commands.txt</strong>: Add<strong> commands.txt </strong>to the staging area, preparing it for commit.</li><li><strong>Committing Changes</strong>:</li><li><strong>git commit -m “message”</strong>: Commit staged changes with a descriptive message, such as “Initial commit”.</li><li><strong>Viewing Commit History</strong>:</li><li><strong>git log</strong>: View a chronological log of commits, including commit messages, authors, dates, and commit IDs.</li><li><strong>Configuring User Information</strong>:</li><li><strong>git config — global user.name “user name”</strong>: Set the global username for Git.</li><li><strong>git config — global user.email “user email</strong>”: Set the global email address for Git.</li><li><strong>Branching</strong>:</li><li><strong>git branch</strong>: List all branches in the repository.</li><li><strong>git checkout -b dev</strong>: Create a new branch named dev and switch to it.</li><li><strong>git switch master or git checkout master</strong>: Switch back to the master branch.</li><li><strong>Cloning a Repository</strong>:</li><li><strong>git clone url</strong>: Clone a remote repository specified by url to the local machine.</li><li><strong>Pulling Changes</strong>:</li><li><strong>git pull</strong>: Fetch changes from the remote repository and integrate them into the current branch.</li><li><strong>Pushing Changes</strong>:</li><li><strong>git push origin main url</strong>: Push committed changes to the remote repository specified by url on the main branch.</li></ul><p>These commands and concepts empower DevOps engineers to manage code efficiently, collaborate seamlessly, and maintain version control across development and deployment pipelines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0cce5203fe4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install FreePBX 16 on Ubuntu/Linux]]></title>
            <link>https://medium.com/@sohanyadavdevops/install-freepbx-16-on-ubuntu-linux-f217a44975fd?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f217a44975fd</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[freepbx16]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 04:07:44 GMT</pubDate>
            <atom:updated>2024-08-21T04:07:44.053Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*tPr-8sjkH1PCgYOlns9KWw.jpeg" /></figure><p>FreePBX is a web-based open source GUI (graphical user interface) that controls and manages Asterisk (PBX). This tutorial will help you install FreePBX 16 on the Ubuntu 22.04/Linux system. A pre-requisite for this setup is an Asterisk Server that has been installed, configured, and confirmed to be running.</p><h3>Step 1: Install MariaDB Database server</h3><p>Run the commands below to install</p><pre>sudo apt update</pre><pre>sudo apt -y install mariadb-server mariadb-client</pre><h3>Step 2: Installing Node.js on Debian</h3><p>FreePBX has Node.js as a dependency, install it on your system by using the commands below:</p><pre>sudo apt install nodejs npm</pre><p>Check the version of Node.js installed.</p><pre>node --version<br>v10.19.0</pre><h3>Step 3: Install and configure Apache Web Server</h3><p>Install apache2 package from apt:</p><pre>sudo apt -y install apache2</pre><p>Then change Apache user toasterisk and turn onAllowOverride option :</p><pre>sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig</pre><pre>sudo sed -i &#39;s/^\(User\|Group\).*/\1 asterisk/&#39; /etc/apache2/apache2.conf</pre><pre>sudo sed -i &#39;s/AllowOverride None/AllowOverride All/&#39; /etc/apache2/apache2.conf</pre><p>Remove default index.html page</p><pre>sudo rm -f /var/www/html/index.html</pre><pre>sudo unlink  /etc/apache2/sites-enabled/000-default.conf</pre><h3>Step 4: Install PHP and required extensions</h3><p>Add APT repository configuration dependencies:</p><pre>sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2</pre><p>Add the PHP packages APT repository to your Ubuntu server.</p><pre>echo &quot;deb https://packages.sury.org/php/ $(lsb_release -sc) main&quot; | sudo tee /etc/apt/sources.list.d/sury-php.list</pre><p>Import repository key:</p><pre>wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -</pre><p>Remove any current version of PHP installed:</p><pre>sudo apt remove php*</pre><p>FreePBX is dependent on PHP, run the following commands to install PHP and the required extensions.</p><pre>sudo apt update<br>sudo apt install php7.4-mysql php7.4-cli php7.4-common php7.4-imap php7.4-ldap php7.4-xml php7.4-fpm php7.4-curl php7.4-mbstring php7.4-zip php7.4-gd php7.4-gettext php7.4-json</pre><p>Install the PHP Apache module:</p><pre>sudo apt install libapache2-mod-php7.4</pre><p>Update PHP variables</p><pre>sudo sed -i &#39;s/\(^upload_max_filesize = \).*/\120M/&#39; /etc/php/7.4/apache2/php.ini</pre><pre>sudo sed -i &#39;s/\(^upload_max_filesize = \).*/\120M/&#39; /etc/php/7.4/cli/php.ini</pre><pre>sudo sed -i &#39;s/\(^memory_limit = \).*/\1256M/&#39; /etc/php/7.4/apache2/php.ini</pre><h3>Step 5: Install FreePBX 16 on Debian 11 / Debian 10</h3><p>Install the following packages:</p><pre>sudo apt install sox mpg123 lame ffmpeg sqlite3 git unixodbc dirmngr postfix  odbc-mariadb pkg-config libicu-dev</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/0*9OHb6r5zHWfwqTs3.png" /></figure><p>Configure ODBC:</p><pre>sudo tee /etc/odbcinst.ini &lt;&lt;EOF<br>[MySQL]<br>Description = ODBC for MySQL (MariaDB)<br>Driver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so<br>FileUsage = 1<br>EOF</pre><pre>sudo tee /etc/odbc.ini &lt;&lt;EOF<br>[MySQL-asteriskcdrdb]<br>Description = MySQL connection to &#39;asteriskcdrdb&#39; database<br>Driver = MySQL<br>Server = server_ip<br>Database = asteriskcdrdb<br>Port = 3306<br>Socket = /var/run/mysqld/mysqld.sock<br>Option = 3<br>EOF</pre><p>Download the latest version of FreePBX 16 on Ubuntu 22.04 / Linux:</p><pre>sudo apt -y install wget</pre><pre>wget <a href="http://mirror.freepbx.org/modules/packages/freepbx/7.4/freepbx-16.0-latest.tgz">http://mirror.freepbx.org/modules/packages/freepbx/7.4/freepbx-16.0-latest.tgz</a></pre><p>Extract the file:</p><pre>tar xfz freepbx-16.0-latest.tgz</pre><pre>rm -f freepbx-16.0-latest.tgz</pre><p>Install Asterisk on Ubuntu 22.04 / Linux</p><pre>sudo apt update<br>sudo apt install asterisk</pre><p>Install FreePBX 16 on Ubuntu 22.04 / Linux</p><pre>cd freepbx</pre><pre>sudo systemctl stop asterisk</pre><pre>sudo ./start_asterisk start</pre><pre>sudo ./install -n</pre><p>If you have a root password for the database server, use:</p><pre>sudo ./install -n --dbuser root --dbpass password</pre><p>Replace <strong>the password</strong> with the root database password.</p><p>Sample installation output:</p><pre>Module framework version 16.0.10.33 successfully installed<br>Updating Hooks...Done<br>Chowning directories...Done<br>Done<br>Building Packaged Scripts... Done<br>Trusting FreePBX...Trusted<br>Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf<br>Setting Permissions...<br>Setting base permissions...Done in 0 seconds<br>Setting specific permissions...<br> 23828 [============================]<br>Finished setting permissions<br>Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf<br>Setting Permissions...<br>Setting base permissions...Done in 1 second<br>Setting specific permissions...<br> 23828 [============================]<br>Finished setting permissions<br>Generating default configurations...<br>Finished generating default configurations<br>You have successfully installed FreePBX</pre><p>Install all Freepbx modules</p><pre>sudo fwconsole ma disablerepo commercial</pre><pre>sudo fwconsole ma installall</pre><pre>sudo fwconsole ma delete firewall</pre><pre>sudo fwconsole reload</pre><pre>sudo fwconsole restart</pre><p>Enable the Apache Rewrite Engine and restart Apache 2.</p><pre>sudo a2enmod rewrite</pre><pre>sudo systemctl restart apache2</pre><p>If you have an active ufw firewall, open http &amp; https ports</p><pre>sudo ufw allow proto tcp from any to any port 80,443</pre><p>You have successfully installed FreePBX on Ubuntu Linux server.</p><h3>Create FreePBX systemd (startup script)</h3><p>Create a systemd unit for auto-starting the service:</p><pre>sudo tee /etc/systemd/system/freepbx.service &lt;&lt;EOF<br>[Unit]<br>Description=FreePBX VoIP Server<br>After=mariadb.service</pre><pre>[Service]<br>Type=oneshot<br>RemainAfterExit=yes<br>ExecStart=/usr/sbin/fwconsole start -q<br>ExecStop=/usr/sbin/fwconsole stop -q</pre><pre>[Install]<br>WantedBy=multi-user.target<br>EOF</pre><p>Enable the service to autostart</p><pre>sudo systemctl daemon-reload</pre><pre>sudo systemctl enable freepbx</pre><h3>Step 6: Access FreePBX Web Interface</h3><p>Open your web browser and connect to the <strong>ip_address_or_hostname/admin</strong> of your new FreePBX server.</p><p>1. Create the first admin account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*8mGPfzfuHqLQZC8e.png" /></figure><p>When done providing admin user details, click <strong>“Create Account” </strong>to create the account. On the next page, you’ll get a login console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*3BAtUM17NWXZp8xu.png" /></figure><p>You’ll get to the FreePBX dashboard, where you can manage your Asterisk PBX.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*M-NK9D3c931uUz9U.png" /></figure><p>You now have FreePBX 16 running on the Ubuntu 22.04/Linux system.</p><p>You can also check out another alternative, F<strong>rom ISO to AMI: Crafting Your Own Custom Amazon Machine Image</strong>:</p><p><a href="https://medium.com/@sohanyadavdevops/from-iso-to-ami-crafting-your-own-custom-amazon-machine-image-49bf27209ce6">From ISO to AMI: Crafting Your Own Custom Amazon Machine Image</a></p><p>I hope this helps! Follow for more such stories 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/0*5KNnpvtrdlio6ho6.gif" /></figure><blockquote><em>Enjoy it! 🍻 That’s It; we are done…</em></blockquote><blockquote><em>For hassle-free Cloud Management with DevOps at the center of the process, contact me on </em><a href="https://www.linkedin.com/in/yadavsohan/"><strong><em>Linkedin.com</em></strong></a></blockquote><blockquote>If you found this article helpful, please <strong>don’t forget</strong> to hit the <strong>Follow</strong> and <strong>Clap </strong>buttons to help me write more articles like this.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f217a44975fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From ISO to AMI: Crafting Your Own Custom Amazon Machine Image]]></title>
            <link>https://medium.com/@sohanyadavdevops/from-iso-to-ami-crafting-your-own-custom-amazon-machine-image-49bf27209ce6?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/49bf27209ce6</guid>
            <category><![CDATA[create]]></category>
            <category><![CDATA[ami]]></category>
            <category><![CDATA[amazon-machine-images]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Mon, 12 Aug 2024 05:14:35 GMT</pubDate>
            <atom:updated>2024-08-12T05:14:35.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*MuGhkfuRxuSDTonusPCLbw.png" /></figure><h3>Why do we need a custom AMI?</h3><p>While it might be very simple to get an instance up and running in AWS, this instance might not be exactly what you have been looking for. Some files are already customized, several packages that you do not either want or need are installed, and in some cases, you’ll want a clean kernel and not the <a href="https://packages.ubuntu.com/search?keywords=linux-aws">AWS-provided version</a> that is compatible with specific cloud tools only. So applying anything related to package updates on any other platform besides AWS will be like trying to start someone’s car with your own key — it has the same functionality, but you cannot communicate with it.</p><p>You can always buy an AMI that someone has prepared for such purposes. For those of us who like to do it the hard way and break their machine in the process, there is an alternative way — create your own AMI from scratch.</p><p>After spending some time googling this particular task, I sadly found out that most of the tutorials are just copy-paste and do not lead to the desired goal. This is one that works. It might not be the best way or the shortest way, but it works.</p><h3>What do we need?</h3><ul><li><strong>ISO</strong> of the distribution of your choice — I used the Ubuntu 20.04 server.</li><li><strong>Virtual Box</strong> — there are many options to create a VM choose your weapon according to your needs. I found Oracle VirtualBox to be the most suitable for this task, so I used the 6.1.30 version.</li><li><strong>AWS account</strong> — you will need some extended privileges to create buckets, roles, and policies.</li><li><strong>Configured </strong><strong>aws cli</strong> - if you have never used this tool, you can look up how to download it according to your distribution from <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">this link</a>. In order to use it, you will need to create a pair of the <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-prereqs.html#getting-started-prereqs-keys">access key ID and secret access key</a>. Once you have it, run itaws configure from your terminal and add your key ID and secret access key. The prompted region should match your working AWS region.</li></ul><h3>How do I do it?</h3><h3>Step 1: Create a machine.</h3><ul><li>Download your favorite flavor of the ISO.</li><li>Create a new machine in the Virtual Box and attach the ISO to it. Match the settings to your needs, my goal was to merely download and pack the latest OS security patches, so the basic CPU and RAM did the job.</li><li>Run the machine, install the distribution, and set the username and password. You will need them later!</li><li>Either during the installation or afterwards, install theopenssh package and enable the service.</li><li>If you want to connect to your future instance with a specific SSH key, import the public SSH key to the dedicated directory.</li></ul><pre>cd<br>mkdir .ssh<br>touch ./ssh/authorized_keys</pre><p>Paste your public SSH key in theauthorized_keys file. Otherwise, you will be able to connect to the <strong>instance only with the username and password</strong> you have created for the VM.</p><ul><li>Stop the machine and convert it to OVA format.</li><li>click on file → export appliance → Choose your machine to export</li></ul><p>chose the destination to save OVA file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/0*LYzzsYNPTa0UPXMw.png" /></figure><p>export</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h3>Step 2 — prepare AWS resources.</h3><ul><li>Go to your S3 storage, create a bucket, and upload your OVA.</li></ul><pre>aws s3 cp . s3://bucketname --recursive</pre><ul><li>Create a local directory with the following files. containers.json, role-policy.json, trust-policy.json. These files will define a role, a policy, and parameters for your AMI conversion.</li><li>First, set up an IAM role that will execute the conversion — vmimport. Edit trust-policy.json:</li></ul><pre>{<br>   &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>      {<br>         &quot;Effect&quot;: &quot;Allow&quot;,<br>         &quot;Principal&quot;: { &quot;Service&quot;: &quot;vmie.amazonaws.com&quot; },<br>         &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>         &quot;Condition&quot;: {<br>            &quot;StringEquals&quot;:{<br>               &quot;sts:Externalid&quot;: &quot;vmimport&quot;<br>            }<br>         }<br>      }<br>   ]<br>}</pre><ul><li>Then set up the policy for the role to use in the conversion process. Edit role-policy.jsonand insert the name of your bucket, where the OVA is stored.</li></ul><pre>{<br>   &quot;Version&quot;:&quot;2012-10-17&quot;,<br>   &quot;Statement&quot;:[<br>      {<br>         &quot;Effect&quot;: &quot;Allow&quot;,<br>         &quot;Action&quot;: [<br>            &quot;s3:GetBucketLocation&quot;,<br>            &quot;s3:GetObject&quot;,<br>            &quot;s3:ListBucket&quot;<br>         ],<br>         &quot;Resource&quot;: [<br>            &quot;arn:aws:s3:::YOUR BUCKET&quot;,<br>            &quot;arn:aws:s3:::YOUR BUCKET/*&quot;<br>         ]<br>      },<br>      {<br>         &quot;Effect&quot;: &quot;Allow&quot;,<br>         &quot;Action&quot;: [<br>            &quot;s3:GetBucketLocation&quot;,<br>            &quot;s3:GetObject&quot;,<br>            &quot;s3:ListBucket&quot;,<br>            &quot;s3:PutObject&quot;,<br>            &quot;s3:GetBucketAcl&quot;<br>         ],<br>         &quot;Resource&quot;: [<br>            &quot;arn:aws:s3:::YOUR BUCKET&quot;,<br>            &quot;arn:aws:s3:::YOUR BUCKET/*&quot;<br>         ]<br>      },<br>      {<br>         &quot;Effect&quot;: &quot;Allow&quot;,<br>         &quot;Action&quot;: [<br>            &quot;ec2:ModifySnapshotAttribute&quot;,<br>            &quot;ec2:CopySnapshot&quot;,<br>            &quot;ec2:RegisterImage&quot;,<br>            &quot;ec2:Describe*&quot;<br>         ],<br>         &quot;Resource&quot;: &quot;*&quot;<br>      }<br>   ]<br>}</pre><ul><li>Now create the role. From your terminal, run:</li></ul><p>aws iam create-role --role-name vmimport --assume-role-policy-document &quot;file://path/to/trust-policy.json&quot;</p><ul><li>Afterwards, attach the policy to it.</li></ul><p>aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document &quot;file://path/to/role-policy.json&quot;</p><ul><li>The last file you edit will reference the format of the image and the bucket.containers.json references the command that will read from it and just contains all the information about your image - format, number of disks, bucket, and the name (S3Key) of the image:</li></ul><pre>[<br>    {<br>     &quot;Description&quot;:&quot;vm import&quot;,<br>     &quot;Format&quot;:&quot;ova&quot;,<br>     &quot;UserBucket&quot;: {<br>        &quot;S3Bucket&quot;: &quot;YOUR BUCKET&quot;,<br>        &quot;S3Key&quot;: &quot;NAME OF YOUR IMAGE.ova&quot;<br>}<br>}]</pre><ul><li>Start the process of conversion. Run this command from your terminal:</li></ul><p>aws ec2 import-image --description &quot;YOUR DESCRIPTION&quot; --disk-containers &quot;file://path/to/containers.json&quot;.</p><p>An output of the command will provide you with an ami number, use it to check the process:</p><p>aws ec2 describe-import-image-tasks --import-task-ids import-ami-12345678</p><ul><li>When the process is completed, your AMI will be uploaded directly to your AMI directory.</li></ul><h3>Troubleshooting and aftermath</h3><ul><li>It is possible to use images in ova format; I had success with them. This may be useful for you.</li></ul><p>I hope this helps! Follow for more such stories</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/0*aZGLVWz87Dyg9wmQ.gif" /></figure><blockquote><em>Enjoy it! 🍻 That’s It; we are done…</em></blockquote><blockquote>For hassle-free Cloud Management with DevOps at the center of the process, contact me on <a href="https://www.linkedin.com/in/yadavsohan/"><strong>Linkedin.com</strong></a></blockquote><blockquote><em>If you found this article helpful, please </em><strong><em>don’t forget</em></strong><em> to hit the </em><strong><em>Follow</em></strong><em> and </em><strong><em>Clap </em></strong><em>buttons to help me write more articles like this.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49bf27209ce6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide to Building an AWS VPC with Terraform]]></title>
            <link>https://medium.com/@sohanyadavdevops/step-by-step-guide-to-building-an-aws-vpc-with-terraform-4d750baac8a9?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d750baac8a9</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws-vpn]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Fri, 09 Aug 2024 10:27:20 GMT</pubDate>
            <atom:updated>2024-08-09T10:27:20.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuwxfSmhNKUoq8IzMdOfyw.jpeg" /></figure><p>Creating an AWS VPC (Virtual Private Cloud) using Terraform involves defining the necessary resources like VPC, subnets, route tables, and security groups in a Terraform configuration file. Below is a basic example of creating a simple VPC with Terraform. Make sure you have Terraform installed and AWS credentials configured before proceeding.</p><h3>Step-by-Step Guide</h3><h3>1. Set up your Terraform environment:</h3><p>Ensure you have a directory for your Terraform configuration files. Inside this directory, create a file named <strong>main.tf</strong> where you’ll define your infrastructure.</p><h3>2. Write Terraform configuration (`main.tf`):</h3><p>Here’s an example <strong>main.tf</strong> that creates a VPC with two public subnets and two private subnets across two availability zones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*OLUN_5FfD_Q8f5r6.png" /></figure><p>In this example:</p><p>- The VPC CIDR block is set to `10.0.0.0/16`.</p><p>- Two public subnets are created in `us-east-1a`.</p><p>- Two private subnets are created in `us-east-1b`.</p><ul><li>Adjust the `region`, `availability_zone`, `cidr_block`, and other parameters per your requirements.</li></ul><h3>3. Initialize Terraform:</h3><p>Run `<strong>terraform init</strong>` in your directory containing `main. tf`. This initializes Terraform and downloads the necessary provider plugins.<br>Additional Considerations</p><p><strong>- Variables and Outputs:</strong> Consider using Terraform variables and outputs to make your configuration more flexible and to retrieve information about created resources.</p><p><strong>- Cleanup:</strong> When you’re done testing, run `<strong>Terraform destroy</strong>` to tear down the resources created by Terraform.</p><p>This basic example should get you started with creating an AWS VPC using Terraform. Customize and expand it based on your specific requirements and AWS environment setup.</p><p>Have I enjoyed the read? That’s it; we’re done!</p><blockquote><em>For hassle-free Cloud Management with DevOps at the center of the process, contact me on </em><a href="https://www.linkedin.com/in/yadavsohan/"><strong><em>Linkedin.com</em></strong></a></blockquote><blockquote>If you found this article helpful, please <strong>don’t forget</strong> to hit the <strong>Follow</strong> and <strong>Clap </strong>buttons to help me write more articles like this.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d750baac8a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Install Jenkins Step by Step]]></title>
            <link>https://medium.com/@sohanyadavdevops/how-to-install-jenkins-step-by-step-ff737c67dd58?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff737c67dd58</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[setup]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Wed, 07 Aug 2024 04:39:47 GMT</pubDate>
            <atom:updated>2024-08-07T04:39:47.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*PUrvvyiZaAq6d0ac.png" /></figure><ol><li>“Getting Started with Jenkins Installation”</li><li>“Step-by-Step Guide to Installing Jenkins”</li><li>“Installing and Configuring Jenkins for Continuous Integration”</li><li>“Jenkins Installation Tutorial: Setting up Your CI/CD Pipeline”</li><li>“Mastering Jenkins: Complete Installation Walkthrough”</li><li>“Automating Your Build Process: Installing Jenkins”</li><li>“Deploying Jenkins: Installation and Setup Guide”</li><li>“Jenkins Essentials: Installing and Configuring Your CI Server”</li><li>“Unlocking the Power of Jenkins: Installation and Basics”</li><li>“Jenkins Installation Made Easy: A Beginner’s Guide”</li></ol><p>The procedures in this chapter are for new installations of Jenkins.</p><p>Jenkins is typically run as a standalone application in its process. The Jenkins WAR file bundles <a href="https://github.com/jenkinsci/winstone">Winstone</a>, a <a href="https://www.eclipse.org/jetty/">Jetty</a> servlet container wrapper, and can be started on any operating system or platform with a version of Java supported by Jenkins.</p><h3>Installation of Java?</h3><p>Jenkins requires Java to run, yet not all Linux distributions include Java by default. Additionally, <a href="https://www.jenkins.io/doc/book/platform-information/support-policy-java/">not all Java versions are compatible</a> with Jenkins.</p><p>There are multiple Java implementations that you can use. <a href="https://openjdk.java.net/">OpenJDK</a> is the most popular one at the moment, we will use it in this guide.</p><p>Update the Debian apt repositories, install OpenJDK 17, and check the installation with the commands:</p><pre>sudo apt update<br>sudo apt install fontconfig openjdk-17-jre<br>java -version</pre><p>output:</p><pre>openjdk version &quot;17.0.8&quot; <br>OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)<br>OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)</pre><h3>Debian/Ubuntu</h3><p>On Debian and Debian-based distributions like Ubuntu, you can install Jenkins through apt.</p><h3>Long-Term Support?</h3><pre>sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \<br>  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key<br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \<br>  /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install jenkins</pre><p>To install, add the repo key. For the latest key, visit the Jenkins Directory for all distributions. at {<a href="https://pkg.jenkins.io/debian-stable/">https://pkg.jenkins.io/debian-stable/</a>}</p><h3>Weekly release?</h3><p>The team produces a new release weekly to provide bug fixes and new features to users and plugin developers who need them.</p><pre>sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \<br>  https://pkg.jenkins.io/debian/jenkins.io-2023.key<br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>  https://pkg.jenkins.io/debian binary/ | sudo tee \<br>  /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install jenkins</pre><p>To install, add the repo key. For the latest key, visit the Jenkins Directory for all distributions. at {<a href="https://pkg.jenkins.io/debian-stable/">https://pkg.jenkins.io/debian-stable/</a>}</p><p>The package installation will:</p><ul><li>Set up Jenkins as a daemon launched on start. Run systemctl cat jenkins for more details.</li><li>Create a ‘Jenkins’ user to run this service.</li><li>Direct console log output to systemd-journald. Run journalctl -u jenkins.service if you are troubleshooting Jenkins.</li><li>Populate /lib/systemd/system/jenkins.service with configuration parameters for the launch, e.g JENKINS_HOME</li><li>Set Jenkins to listen on port 8080. Access this port with your browser to start configuration.</li></ul><blockquote><em>If Jenkins fails to start because a port in 8080 is in use, run </em><em>systemctl edit jenkins and add the following:</em></blockquote><blockquote><em>[Service]<br>Environment=”JENKINS_PORT=8081&quot;</em></blockquote><blockquote><em>Here, “8081” was chosen but you can put another port available.</em></blockquote><h3>Fedora</h3><p>You can install Jenkins through dnf. You need to add the Jenkins repository from the Jenkins website to the package manager first.</p><h3>Long Term Support release</h3><p>An <a href="https://www.jenkins.io/download/lts/">LTS (Long-Term Support) release</a> is chosen every 12 weeks from the stream of regular releases as the stable release for that period. It can be installed from the <a href="https://pkg.jenkins.io/redhat-stable/">redhat-stable</a> yum, repository.</p><pre>sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat-stable/jenkins.repo<br>sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key<br>sudo dnf upgrade<br># Add required dependencies for the jenkins package<br>sudo dnf install fontconfig java-17-openjdk<br>sudo dnf install jenkins<br>sudo systemctl daemon-reload</pre><h3>Weekly release</h3><p>A new release is produced weekly to deliver bug fixes and features to users and plugin developers. It can be installed from the <a href="https://pkg.jenkins.io/redhat/">redhat</a> yum, repository.</p><pre>sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat/jenkins.repo<br>sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key<br>sudo dnf upgrade<br># Add required dependencies for the jenkins package<br>sudo dnf install fontconfig java-17-openjdk<br>sudo dnf install jenkins</pre><h3>Red Hat/CentOS</h3><p>You can install Jenkins through yum Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux, and other Red Hat-based distributions.</p><h3>Long Term Support release</h3><p>An <a href="https://www.jenkins.io/download/lts/">LTS (Long-Term Support) release</a> is chosen every 12 weeks from the stream of regular releases as the stable release for that time. It can be installed from the <a href="https://pkg.jenkins.io/redhat-stable/">redhat-stable</a> yum, repository.</p><pre>sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat-stable/jenkins.repo<br>sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key<br>sudo yum upgrade<br># Add required dependencies for the jenkins package<br>sudo yum install fontconfig java-17-openjdk<br>sudo yum install jenkins<br>sudo systemctl daemon-reload</pre><p>To install, add the repo key. For the latest key, visit the Jenkins Directory for all distributions. at {<a href="https://pkg.jenkins.io/redhat-stable/">https://pkg.jenkins.io/redhat-stable/</a>}</p><h3>Weekly release</h3><p>A new release is produced weekly to deliver bug fixes and features to users and plugin developers. It can be installed from the <a href="https://pkg.jenkins.io/redhat/">redhat</a> yum, repository.</p><pre>sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat/jenkins.repo<br>sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key<br>sudo yum upgrade<br># Add required dependencies for the jenkins package<br>sudo yum install fontconfig java-17-openjdk<br>sudo yum install jenkins</pre><p>To install, add the repo key. For the latest key, visit the Jenkins Directory for all distributions. at {<a href="https://pkg.jenkins.io/redhat-stable/">https://pkg.jenkins.io/redhat-stable/</a>}</p><h3>Jenkins Start?</h3><p>To enable the Jenkins service to start at boot, you can use the following command, depending on your operating system:</p><pre>sudo service enable jenkins</pre><p>You can start the Jenkins service with the command:</p><pre>sudo service start jenkins</pre><p>check the status of the Jenkins service:</p><pre>sudo service status jenkins</pre><p>you should see an output like this:</p><pre>Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled)<br>Active: active (running) since thu 2024-03-14 16:43:01 +03; 2min 57s ago</pre><h3>Unlocking Jenkins?</h3><p><a href="http://localhost:8080/">http://localhost:8080</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*ARL0QNKSwvb3AbVu.png" /></figure><p>You can use the following commands to find and display the initial admin password:</p><pre>sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><h3>Creating the first administrator user?</h3><p>you can create your first administrator user.</p><ol><li>When the <strong>Create First Admin User</strong> page appears, specify the details for your administrator user in the respective fields and click <strong>Save and Finish</strong>.</li><li>When the <strong>Jenkins is ready</strong> page appears, click <strong>Start using Jenkins</strong>.<br><strong>Notes:<br>- </strong>This page may indicate <strong>Jenkins is almost ready!</strong> instead and if so, click <strong>Restart</strong>.<br>- If the page does not automatically refresh after a minute, use your web browser to refresh the page manually.</li></ol><p>3. If required, login to Jenkins with the credentials of the user you just created and you are ready to start using Jenkins!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*6m0LfaT_BuhsPADW.png" /></figure><p>Installation of Jenkins plugins has been started. It will take a couple of minutes to complete the installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*t0bEqSCg2O2zruNk.png" /></figure><p>Create the Admin account for Jenkins Portal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*uQ7O3FuSxKSWaxQD.png" /></figure><p>On the <strong>‘Instance Configuration’</strong> page, it will ask you to set the default URL for Jenkins. Click on <strong>Save and Finish</strong> to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*IhkgN5wrbHZt0wcX.png" /></figure><p>Jenkins installation has been completed successfully. Now, you can work on Jenkins by clicking on <strong>Start using Jenkins</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jLSt64VuGv-N-D01.png" /></figure><p>Jenkins’s dashboard is displayed below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*aKlAPYq724H27wmy.png" /></figure><h3>Access Jenkins</h3><p>Now you can access Jenkins by simply providing an Admin username and password.</p><p>Enjoy it! 🍻 That’s It; we are done…</p><blockquote>For hassle-free Cloud Management with DevOps at the center of the process, contact me on <a href="https://www.linkedin.com/in/yadavsohan/"><strong>Linkedin.com</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff737c67dd58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Future of Kubernetes is AI-Powered: Exploring Open-Source Tools for Enhanced Deployments]]></title>
            <link>https://medium.com/@sohanyadavdevops/the-future-of-kubernetes-is-ai-powered-exploring-open-source-tools-for-enhanced-deployments-f67591e45c70?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f67591e45c70</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Wed, 31 Jul 2024 04:49:50 GMT</pubDate>
            <atom:updated>2024-07-31T04:49:50.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVcmN9SNMaicPxxWaB8nLA.png" /></figure><h3>Introduction:</h3><p>Kubernetes has emerged as the de facto standard for container orchestration, providing developers with a powerful platform for deploying, scaling, and managing containerized applications. However, as Kubernetes environments grow in complexity, organizations are increasingly looking for ways to leverage artificial intelligence (AI) to enhance their deployments. In this article, we’ll explore some open-source AI tools that can help organizations optimize their Kubernetes deployments for improved scalability, performance, security, and efficiency.</p><h3>KubeFlow:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*6rm04g-Lovf2HO31.jpeg" /></figure><p>KubeFlow is an open-source platform built on top of Kubernetes that provides end-to-end machine learning (ML) workflows. It allows data scientists and engineers to easily build, deploy, and manage ML models in Kubernetes clusters. KubeFlow integrates with popular ML frameworks such as TensorFlow and PyTorch, providing tools for training, serving, and monitoring ML models. With KubeFlow, organizations can streamline their ML workflows and accelerate the development and deployment of AI-powered applications.</p><h3>KEDA (Kubernetes-based Event-Driven Autoscaling):</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*teGPZbMLkjReBXR9.jpeg" /></figure><p>Kubernetes-based Event-Driven Autoscaling (KEDA) is an open-source project that enables event-driven autoscaling for Kubernetes workloads. KEDA integrates with various event sources, such as Kafka, Azure Queue Storage, and AWS SQS, allowing Kubernetes clusters to automatically scale based on incoming events. By dynamically adjusting the number of pods in response to changing workload demands, KEDA helps organizations optimize resource utilization and improve application performance.</p><h3>Prometheus:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*OLd_rNhcHELD6Ovk.jpeg" /></figure><p>Prometheus is an open-source monitoring and alerting toolkit designed for Kubernetes and other containerized environments. It collects metrics from Kubernetes clusters, applications, and services, allowing organizations to gain insights into the performance and health of their deployments. Prometheus provides powerful querying and visualization capabilities, as well as support for alerting and troubleshooting. With Prometheus, organizations can monitor the health of their Kubernetes deployments in real-time and proactively identify and address issues.</p><h3>KubeDB:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*i2DGOf0-T2EHrsFI.jpeg" /></figure><p>KubeDB is an open-source platform for running stateful applications on Kubernetes. It provides operators for managing databases, caches, and message queues in Kubernetes clusters, with features such as backup and restore, high availability, and automated failover. KubeDB simplifies the deployment and management of stateful applications in Kubernetes, allowing organizations to leverage the scalability and flexibility of Kubernetes for their database workloads.</p><h3>Kubernetes Cluster Autoscaler:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*c__T8UD1kvE5WQnJ.jpeg" /></figure><p>The Kubernetes Cluster Autoscaler is an open-source tool that automatically adjusts the size of Kubernetes clusters based on resource utilization and scheduling constraints. It helps organizations optimize resource usage and ensure that their Kubernetes clusters have enough capacity to handle workload demands. By automatically scaling clusters up or down in response to changing workload requirements, the Cluster Autoscaler helps organizations maintain optimal performance and cost-efficiency.</p><h3>Conclusion:</h3><p>As organizations continue to adopt Kubernetes for deploying and managing containerized applications, the need for AI-driven tools to optimize and enhance Kubernetes deployments becomes increasingly important. The open-source AI tools mentioned in this article offer a range of capabilities for improving scalability, performance, security, and efficiency in Kubernetes environments. By leveraging these tools, organizations can streamline their Kubernetes deployments, improve resource utilization, and accelerate innovation in AI-powered applications</p><p>Enjoy it! 🍻 That’s It; we are done…</p><blockquote><em>For hassle-free Cloud Management with DevOps at the center of the process, contact me on </em><a href="https://www.linkedin.com/in/yadavsohan/"><strong><em>Linkedin.com</em></strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f67591e45c70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing and setting Up kubectl on Linux or Ubuntu]]></title>
            <link>https://medium.com/@sohanyadavdevops/installing-and-setting-up-kubectl-on-linux-or-ubuntu-67fbefc616ac?source=rss-77bb3d04caf1------2</link>
            <guid isPermaLink="false">https://medium.com/p/67fbefc616ac</guid>
            <category><![CDATA[setup]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[ubuntu-22-04]]></category>
            <dc:creator><![CDATA[Sohanyadavdevops]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 08:01:17 GMT</pubDate>
            <atom:updated>2024-07-30T08:01:17.123Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wv-wBHD7El5sflx0MR7Org.png" /></figure><p><strong><em>What is Kubernetes?</em></strong></p><p><a href="https://kubernetes.io/">Kubernetes</a> is an open-source project that has become one of the most popular container orchestration tools around; it allows you to deploy and manage multi-container applications at scale.</p><p><strong><em>Kubernetes advantages</em></strong></p><p>1. Kubernetes simplifies management of storage, secrets, and other application-related resources</p><p>2. Kubernetes manages app health, replication, load balancing, and hardware resource allocation for you</p><p>3. Kubernetes applications can run in hybrid cloud and multi-cloud environments</p><h3>What is kubectl?</h3><p>kubectlis the Kubernetes-specific command-line tool that lets you communicate and control Kubernetes clusters. Whether you’re creating, managing, or deleting resources on your Kubernetes platform, Kubectl is an essential tool.</p><p><strong><em>Why do you need kubectl?</em></strong></p><p>kubectlis the most common way to make HTTP requests to the Kubernetes API, and it’s used to run Kubernetes operations, deploy containerized applications, inspect and manage the resources in your cluster, as well as perform monitoring tasks and view the logs of the system.</p><h3>Installing kubectl on Linux :</h3><pre>curl -LO &quot;https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*olamHUWjpm4t5vGM.png" /></figure><blockquote><strong><em>NOTE :</em></strong></blockquote><blockquote><em>To download a specific version, replace the </em><em>$(curl -L -s https://dl.k8s.io/release/stable.txt) portion of the command with the specific version.</em></blockquote><blockquote><em>For example, to download version v1.30.1 on Linux, type:</em></blockquote><blockquote><em>curl -LO </em><a href="https://dl.k8s.io/release/v1.30.1/bin/linux/amd64/kubectl"><em>https://dl.k8s.io/release/v1.30.1/bin/linux/amd64/kubectl</em></a></blockquote><p><strong>Step 2</strong>. Validate the binary (optional) Download the kubectl checksum file:</p><pre>curl -LO &quot;https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*jS36sXOdRo1Yb0DY.png" /></figure><p>Validate the kubectl binary against the checksum file:</p><pre>echo &quot;$(cat kubectl.sha256)  kubectl&quot; | sha256sum --check</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*jVOe-Q6NvdU2Gj5U.png" /></figure><p><strong>Step 3.</strong> Install kubectl</p><pre>sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl</pre><blockquote><strong><em>Note:</em></strong></blockquote><blockquote><em>If you do not have root access on the target system, you can still install kubectl to the </em><em>~/.local/bin directory:</em></blockquote><pre>chmod +x kubectl<br>mkdir -p ~/.local/bin<br>mv ./kubectl ~/.local/bin/kubectl<br># and then append (or prepend) ~/.local/bin to $PATH</pre><p><strong>Step 4</strong>. Test to ensure the version you installed is up-to-date:</p><pre>kubectl version --client</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/0*btRGXSkMgzpoJJk_.png" /></figure><p>Or use this for a detailed view of the version:</p><pre>kubectl version --client --output=yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*5MWIDyUSb47yd1mL.png" /></figure><h3>Install using native package management</h3><h3>Installing Kubectl on Ubuntu:</h3><ol><li>Update theapt package index and install the packages needed to use the Kubernetes aptrepository:</li></ol><pre>sudo apt-get update <br>sudo apt-get install -y apt-transport-https ca-certificates curl gnupg</pre><p>2. Download the Google Cloud public signing key:</p><pre>curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg<br>sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg</pre><p>3. Add the appropriate Kubernetes apt repository. If you want to use a Kubernetes version different than v1.30, replace v1.30 with the desired minor version in the command below:</p><pre>echo &#39;deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /&#39; | sudo tee /etc/apt/sources.list.d/kubernetes.list<br>sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list</pre><p>4. Updateapt the package index, then install Kubectl.</p><pre>sudo apt-get update<br>sudo apt-get install -y kubectl</pre><blockquote><strong><em>Note:</em></strong><em> In releases older than Debian 12 and Ubuntu 22.04, </em><em>/etc/apt/keyrings does not exist by default. You can create this directory if you need to, making it world-readable but writeable only by admins.</em></blockquote><h3>Verify kubectl configuration</h3><p>In order for kubectl to find and access a Kubernetes cluster, it needs a <a href="https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/">kubeconfig file</a>, which is created automatically when you create a cluster using kube-up.sh or successfully deploy a Minikube cluster. By default, kubectl configuration is located at ~/.kube/config.</p><p>Check that kubectl is properly configured by getting the cluster state:</p><pre>kubectl cluster-info</pre><p>Enjoy it! 🍻 That’s It; we are done…</p><blockquote>For hassle-free Cloud Management with DevOps at the center of the process, contact me on <a href="https://www.linkedin.com/in/yadavsohan/"><strong>Linkedin.com</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67fbefc616ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>