Preface

GitOps is not a topic that is hard to understand; you use a Git repository to declaratively define the state of your environments and by doing so, you gain versioning and changes by merge requests, which makes the whole system auditable.

But once you start adopting it and use a tool such as Argo CD, things will start becoming more complex. First, you need to set up Argo CD correctly, keeping in mind things such as observability and high availability. Then, you need to think about the CI/CD pipelines and how the new GitOps repositories will be integrated with them. And there will be organizational challenges: how do you integrate each team into this new setup? Most likely, they had different types of Kubernetes access based on the namespace they were deploying to, so Role-based Access Control (RBAC) took time to be properly configured, and now you need to take into consideration how the existing teams’ access will be transferred to the new GitOps engine.

Of course, there are many resources out there (articles, videos, and courses), but it is not easy to navigate them as they only deal with parts of these topics, and not all of them have a good level of detail.

So, it is not easy to gain an idea of what the overall adoption of Argo CD means.

We wrote this book in order for you to have a guide to understand the steps you need to take to start using Argo CD, to allow you to see the complete picture, from installation to setting up proper access control, and the challenges you will face when running it in production, including advanced scenarios and troubleshooting.

We started with GitOps early at our companies and we both were able to see the journey up close. Initially, we even thought about building our own GitOps operator, (like, how hard can it be?), but after 2-3 weeks of analyzing what we needed to do, we dropped the idea. We faced many challenges, some we handled better, while some took us a lot of time to get right, but we learned from all of them, and this is what we want to share with you. We know that, by using this book, you will be able to accelerate your Argo CD and GitOps adoption.

Who this book is for

If you’re a software developer, DevOps engineer, or SRE who is responsible for building CD pipelines for projects running on Kubernetes and you want to advance in your career, this book is for you. Basic knowledge of Kubernetes, Helm, or Kustomize, and CD pipelines will be useful to get the most out of this book.

What this book covers

Chapter 1, GitOps and Kubernetes, explores how Kubernetes made it possible to introduce the GitOps concept. We will discover its declarative APIs, and see how we can apply resources from files, folders, and, in the end, Git repositories.

Chapter 2, Getting Started with Argo CD, explores the core concepts of Argo CD and its architectural overview and goes through the necessary vocabulary you need to know in order to be able to deep dive into the tool.

Chapter 3, Operating Argo CD, covers installing Argo CD using HA manifests, going through some of the most meaningful configuration options, preparing for disaster recovery, and discovering some relevant metrics being exposed.

Chapter 4, Access Control, discovers how to set up user access and the options for connecting via the CLI, web UI, or a CI/CD pipeline. It goes into detail about RBAC and SSO and the different options to configure them.

Chapter 5, Argo CD Bootstrap K8s Cluster, shows how we can create a Kubernetes cluster using infrastructure as code and then set up the required applications with Argo CD, identifying the security challenges you will encounter when deploying the applications.

Chapter 6, Designing Argo CD Delivery Pipelines, continues (based on the infrastructure setup of the previous chapter) to demonstrate real deployment strategies, including dealing with secrets and getting familiarized with Argo Rollouts.

Chapter 7, Troubleshooting Argo CD, addresses some of the issues you will most likely encounter during installation and your day-to-day work and also takes a look at ways to improve Argo CD performance.

Chapter 8, YAML and Kubernetes Manifests (Parsing and Verification), looks at the tools we can use to validate the YAML manifests we will write, to verify them with the common best practices, check against Kubernetes schemas, or even perform your own extended validations written in Rego.

Chapter 9, Future and Conclusion, deals with the GitOps engine and kubernetes-sigs/cli-utils, how it was factored out from Argo CD or the K8s community, and what the teams are trying to achieve with them – having a set of libraries to provide a set of basic GitOps features.

To get the most out of this book

To run the code from all the chapters, you will need access to a Kubernetes cluster, which can be a local one, with the exception of the HA installation, which requires a cluster with multiple nodes. The tools we will use the most are kubectl, Helm, and Kustomize. In the Kubernetes cluster, we will install Argo CD, and the instructions can be found in Chapter 2, Getting Started with Argo CD for the normal installation or Chapter 3, Operating Argo CD for the HA one.

Software/hardware covered in the book

Operating system requirements

Argo CD v2.1 and v2.2

Windows, macOS, or Linux

For some of the chapters, such as Chapters 3, Operating Argo CD and Chapter 5, Argo CD Bootstrap K8s Cluster we work with AWS EKS clusters, so you will need an AWS account set up and the AWS CLI installed. In Chapter 3, we also mention the eksctl CLI in order to ease the creation of the cluster where we will perform the HA installation, while in Chapter 5, Argo CD Bootstrap k8s Cluster, we recommend using Terraform for the cluster creation.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/ArgoCD-in-Practice. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://packt.link/HfXCL.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Create the new file named argocd-rbac-cm.yaml in the same location where we have argocd-cm.yaml.”

A block of code is set as follows:

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
data:
  accounts.alina: apiKey, login

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

patchesStrategicMerge:
 - patches/argocd-cm.yaml
 - patches/argocd-rbac-cm.yaml

Any command-line input or output is written as follows:

kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “You can use the UI by navigating to the User-Info section.”

Tips or Important Notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com

Share Your Thoughts

Once you’ve read Argo CD in Practice, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781803233321

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.104.120