{"id":625,"date":"2025-03-26T12:13:02","date_gmt":"2025-03-26T12:13:02","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=625"},"modified":"2025-03-26T12:13:02","modified_gmt":"2025-03-26T12:13:02","slug":"golang-for-devops","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=625","title":{"rendered":"Golang For DevOps: A Complete Guide"},"content":{"rendered":"<p>Coding has become a necessary skill for <a href=\"https:\/\/devopscube.com\/become-devops-engineer\/\" rel=\"noreferrer\">DevOps engineers<\/a>. <\/p>\n<p>Whether in interviews or real-world projects, a <strong>strong DevOps profile<\/strong> requires solid coding skills, especially in product companies.<\/p>\n<p>In this blog, we will look at:<\/p>\n<ol>\n<li>Golang for DevOps<\/li>\n<li>DevOps\/SRE Tooling with Golang<\/li>\n<li>Write Once, Run Anywhere Concept<\/li>\n<li>Golang Learning Resources<\/li>\n<li>Github repository with 8 weeks learning roadmap with projects.<\/li>\n<li>List of Golang DevOps Tasks to Try<\/li>\n<li>Portal for DevOps Golang Jobs (Full-time &amp; Remote)<\/li>\n<li>Golang Stats &amp; Case Studies<\/li>\n<\/ol>\n<p>Lets get started.<\/p>\n<h2 id=\"golang-for-devops\">Golang for DevOps<\/h2>\n<p>When we talk about programming or scripting for DevOps, the primary languages that is&nbsp;<strong>most discussed is <\/strong><a href=\"https:\/\/devopscube.com\/python-for-devops\/\" rel=\"noreferrer\"><strong>Python<\/strong><\/a> and <a href=\"https:\/\/devopscube.com\/linux-shell-scripting-for-devops\/\" rel=\"noreferrer\">shell scripting. <\/a><\/p>\n<p>This is because it is easy to get started with, and you can write many system scripts for automation needs.<\/p>\n<p>However, if you look at the DevOps ecosystem, most of the&nbsp;<strong>popular tools we use today are built around Go.<\/strong><\/p>\n<p><a href=\"https:\/\/devopscube.com\/kubernetes-ingress-tutorial\/\" rel=\"noreferrer\">Kubernetes<\/a>, Terraform, <a href=\"https:\/\/devopscube.com\/what-is-docker\/\" rel=\"noreferrer\">Docker<\/a>, <a href=\"https:\/\/devopscube.com\/create-helm-chart\/\" rel=\"noreferrer\">Helm<\/a>, Istio, and many other CNCF tools are written in Go.<\/p>\n<p>So why is Golang widely used in DevOps tools and cloud-native projects?<\/p>\n<p><strong>Short Answer:<\/strong> Speed, simplicity, and efficiency.<\/p>\n<p>Go was designed to&nbsp;<strong>address Google&#8217;s need for fast compilation<\/strong>&nbsp;(solving C++ build time issues), efficient concurrency (for large-scale distributed systems), and static binaries (for easier cloud deployments).<\/p>\n<p>This made&nbsp;<strong>Go an excellent choice<\/strong>&nbsp;for cloud infrastructure, backend services, and distributed systems, which is why it became the language behind projects like Kubernetes, Docker, and <a href=\"https:\/\/devopscube.com\/prometheus-architecture\/\" rel=\"noreferrer\">Prometheus<\/a>.<\/p>\n<p>Also, many cloud-native projects are developed in Go, making it the preferred language for DevOps tooling.<\/p>\n<p>Additionally, a large number of developers contribute to the ecosystem, leading to more libraries and packages for automation.<\/p>\n<h2 id=\"devopssre-tooling-with-golang\">DevOps\/SRE Tooling With Golang<\/h2>\n<p>As a DevOps Engineer or SRE, what can you build using Golang?<\/p>\n<p>Golang\u2019s standard library supports many common operations, such as handling HTTP requests, file I\/O, JSON and YAML parsing, and more.<\/p>\n<p>Since we often write scripts for day-to-day tasks, Golang is a&nbsp;<strong>great choice for building CLI tools<\/strong>&nbsp;and APIs.<\/p>\n<p>Personally, I have developed a CLI tool in Golang to automate a repetitive task in a project.<\/p>\n<p>You can also&nbsp;<strong>extend Kubernetes using Kubernetes Operators<\/strong>&nbsp;and build extensions, such as custom controllers and admission webhooks.<\/p>\n<p>Additionally, you can create&nbsp;<code>kubectl<\/code>&nbsp;plugins using Golang.<\/p>\n<p>Overall, Go is great for backend systems, networking, and cloud-native applications. Because of this, you can use Golang for DevOps and Site Reliability Engineering to build tools and utilities, thanks to Go&#8217;s performance and the CNCF tooling built around it.<\/p>\n<h2 id=\"write-once-run-anywhere-wora\">Write Once, Run Anywhere (WORA)<\/h2>\n<p><strong>Write once, run anywhere\u201d (<\/strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Write_once,_run_anywhere?ref=devopscube.com\" rel=\"noreferrer\"><strong>WORA<\/strong><\/a><strong>)<\/strong>&nbsp;means that a program can be written once and executed on different platforms without needing modifications.<\/p>\n<p>Go allows developers to compile code for different operating systems and architectures using environment variables (<code>GOOS<\/code>&nbsp;and&nbsp;<code>GOARCH<\/code>).<\/p>\n<p>For example,<\/p>\n<p>If you write a Go program on a&nbsp;<strong>Linux<\/strong>&nbsp;machine, you can compile it for&nbsp;<strong>Windows<\/strong>,&nbsp;<strong>macOS<\/strong>, or even ARM-based devices without having to rewrite the code.<\/p>\n<p>Unlike Python or Java, which require interpreters or virtual machines (JVM) to run, Go compiles everything into a&nbsp;<strong>single binary<\/strong>.<\/p>\n<p>This means you&nbsp;<strong>don\u2019t need to install extra libraries or dependencies<\/strong>&nbsp;on the target system. Just copy the final Golang binary and run it.<\/p>\n<p>This sort of makes Go tools easy to distribute, especially in&nbsp;<strong>cloud environments, CI\/CD pipelines, and containerized applications<\/strong>.<\/p>\n<h2 id=\"golang-learning-resources\">Golang Learning Resources<\/h2>\n<p>So how do you get started with Golang?<\/p>\n<p>Like any other programming language, you need to begin with the basics.<\/p>\n<p>You can start with,<\/p>\n<ol>\n<li><a href=\"https:\/\/go.dev\/learn\/?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">go.dev\/learn<\/a><\/li>\n<li><a href=\"https:\/\/gobyexample.com\/?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">gobyexample.com<\/a><\/li>\n<li><a href=\"https:\/\/www.learn-golang.org\/?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">learn-golang.org<\/a><\/li>\n<\/ol>\n<p>If you are looking for a structured course where you can read and try out Go in the same browser, you can check out the&nbsp;<a href=\"https:\/\/www.educative.io\/courses\/introduction-to-programming-in-go\/variables-inferred-typing?aff=KNLz&#038;ref=devopscube.com\" rel=\"noreferrer\"><strong>Educative Golang course<\/strong><\/a>.<\/p>\n<p>Other than that, you will find&nbsp;<a href=\"https:\/\/oreillymedia.pxf.io\/09PoJP?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">O&#8217;Reilly books<\/a>, many free YouTube videos, and Udemy courses to learn Golang.<\/p>\n<h2 id=\"practical-roadmap-with-learning-tasks\">Practical Roadmap with Learning Tasks<\/h2>\n<p>To maximize your time, you can learn and build projects while on the move. <\/p>\n<p>I\u2019ve also created a GitHub repository with an <strong>8-week learning roadmap<\/strong> and hands-on projects using Go.<\/p>\n<p><strong>Checkout:<\/strong> <a href=\"https:\/\/github.com\/techiescamp\/golang-for-devops\/?ref=devopscube.com\" rel=\"noreferrer\">Golang For DevOps Learning Roadmap<\/a><\/p>\n<h2 id=\"golang-devops-tasks-to-try\">Golang DevOps Tasks To Try<\/h2>\n<p>Once you learn the basics, you need to build apps to strengthen your learning.<\/p>\n<p>The more you build, the better you understand Golang (Concurrency with Goroutines, Error Handling, Structs and Interfaces, HTTP Servers and APIs etc).<\/p>\n<p>You can try the following tasks related to DevOps. With AI you can easily understand and build it if you have the basics strong.<\/p>\n<ol>\n<li>Build a CLI that pings services\/endpoints and reports their status.<\/li>\n<li>Develop a simplified command-line tool that performs common cloud operations<\/li>\n<li>Create a utility that reads and validates YAML\/JSON configuration files before deployemnt.<\/li>\n<li>Develop a simple scheduler that runs tasks at specified intervals<\/li>\n<li>Create an API that exposes system metrics like CPU, memory, and disk usage<\/li>\n<li>Develop a utility that synchronizes files between directories or systems<\/li>\n<li>Build a tool that generates traffic to test application performance<\/li>\n<li>Create a program that parses log files and extracts useful information or statistics<\/li>\n<\/ol>\n<p>Following are some Kubernetes specific Golang tasks.<\/p>\n<ol>\n<li>Create a simple operator that manages a custom resource.<\/li>\n<li>Build a webhook that validates or mutates <a href=\"https:\/\/devopscube.com\/kubernetes-objects-resources\/\" rel=\"noreferrer\">Kubernetes resources <\/a>before they&#8217;re created or updated<\/li>\n<li>Develop a controller that watches specific resources and takes actions when they change<\/li>\n<li>Create a CLI tool that analyzes and visualizes RBAC permissions across your cluster, identifying overprivileged service accounts<\/li>\n<li>Develop a tool that identifies unused service accounts and tokens that should be cleaned up.<\/li>\n<li>Build a CLI that validates security contexts on <a href=\"https:\/\/devopscube.com\/kubernetes-pod\/\" rel=\"noreferrer\">pods and containers <\/a>against your organization&#8217;s security policies.<\/li>\n<li>Create a simple App that handles pod graceful shutdown using SIGTERM.<\/li>\n<\/ol>\n<h2 id=\"portal-for-devops-golang-jobs\">Portal for DevOps Golang Jobs<\/h2>\n<p>I found this interesting portal that lists all the Golang-related jobs.<\/p>\n<p>Interestingly, there are many DevOps-based Golang requirements.<\/p>\n<p><strong>Check it out:&nbsp;<\/strong>&nbsp;<a href=\"https:\/\/www.golangprojects.com\/golang-jobs\/devops?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">golangprojects.com\/golang-jobs\/devops<\/a><\/p>\n<h2 id=\"golang-stats-case-studies\">Golang Stats &amp; Case Studies<\/h2>\n<p>As per&nbsp;<a href=\"https:\/\/go.dev\/blog\/survey2024-h2-results?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">Go Developer Survey 2024<\/a>, almost half of respondents (50%) deploy Go programs to Amazon Web Services followed by on prem servers.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/media.beehiiv.com\/cdn-cgi\/image\/fit=scale-down,format=auto,onerror=redirect,quality=80\/uploads\/asset\/file\/4b9eb260-9aca-4051-bbef-99aef41a8371\/image.png?t=1741172344\" class=\"kg-image\" alt=\"\" loading=\"lazy\" width=\"574\" height=\"347\"><\/figure>\n<p>Netflix adopted Go for parts of its infrastructure that needed extreme performance. By using Go, Netflix achieved the low-latency, high-concurrency service they required without sacrificing developer speed.<\/p>\n<p>Cloudflare heavily relies on&nbsp;<strong>Go<\/strong>&nbsp;for building high-performance, scalable, and secure networking solutions. Many core&nbsp;<strong>Cloudflare services<\/strong>, such as their&nbsp;<strong>reverse proxy, DDoS protection, and firewall rules<\/strong>, are written in Go.<\/p>\n<p>These are just a few examples. Companies like&nbsp;<strong>PayPal<\/strong>,&nbsp;<strong>Riot Games<\/strong>,&nbsp;<strong>Twitch<\/strong>, and&nbsp;<strong>Uber<\/strong>&nbsp;have similarly reported using Go to achieve scalable, reliable systems. You can read all the&nbsp;<a href=\"https:\/\/go.dev\/solutions\/case-studies?utm_source=newsletter.devopscube.com&#038;utm_medium=referral&#038;utm_campaign=golang-for-devops\" rel=\"noopener noreferrer nofollow\">case studies here.<\/a><\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>I highly recommend DevOps engineers to focus on coding (Golang or Python) and start building tools or utilities.<\/p>\n<p>Even if you don\u2019t have the option to do that in a project, work on hobby projects or create open-source utilities.<\/p>\n<p>It will help you in a great way. You can also&nbsp;<strong>contribute to open-source projects<\/strong>&nbsp;written in Go, like Kubernetes or related CNCF tools.<\/p>\n<p>Also, if you&#8217;re aiming for a job in the Platform Engineering domain, having a strong understanding of Golang can be a significant advantage.<\/p>\n<p>If you have any doubts about this blog, drop them in the comments!<\/p>\n<p>Want to Stay Ahead in DevOps &amp; Cloud? Join the Free Newsletter Below.<\/p>\n<p><!--kg-card-begin: html--><br \/>\n <iframe loading=\"lazy\" src=\"https:\/\/embeds.beehiiv.com\/2a495ef4-3de7-4600-8a0d-de5dc968b372\" data-test-id=\"beehiiv-embed\" width=\"100%\" height=\"320\" frameborder=\"0\" scrolling=\"no\" style=\"border-radius: 4px; border: 2px solid #e5e7eb; margin: 0; background-color: transparent;\"><\/iframe><br \/>\n<!--kg-card-end: html--><\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/golang-for-devops\/\" target=\"_blank\" rel=\"noopener noreferrer\">Golang For DevOps: A Complete Guide \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/golang-for-devops\/<\/p>\n","protected":false},"author":1,"featured_media":626,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-625","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=625"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/625\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/626"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}