In a previous blog post I introduced Automation Webhooks and their uses with Infrastructure-as-Code (IaC) workflows and Red Hat Ansible Automation Platform. In this blog post, I’ll cover how those features can be applied to creating GitOps pipelines, a particular workflow gaining popularity in the cloud-native space, using Ansible and the unique benefits utilizing Ansible provides.
What is GitOps?
Like so many terms that evolve and emerge from the insights and practices of what came before it, finding a definitive meaning to the term “GitOps” is a bit elusive.
GitOps is a workflow whose conceptual roots started with Martin Fowler’s comprehensive Continuous Integration overview in 2006 and descends from Site Reliability Engineering (SRE), DevOps culture and Infrastructure as Code (IaC) patterns. What makes it unique is that GitOps is a prescriptive style of Infrastructure as Code based on the experience and wisdom of what works in deploying and managing large, sophisticated, distributed and cloud-native systems. So you can implement git-centric workflows where you treat infrastructure like it is code, but it doesn’t mean it’s GitOps.
The term GitOps was coined by Alexis Richardson, CEO and Founder of Weaveworks, so a lot of how I’m going to define GitOps here comes directly from Alexis and Weaveworks. This initial blog post that explains the concept puts some baseline ideas out there, but doesn’t provide a concise definition. Depending who you ask you’ll get varying explanations of the term.
After reading and listening to various explanations, I thought this definition was a concise one that captures the essence of the many ways that GitOps has been explained:
[GitOps] works by using Git as a single source of truth for declarative infrastructure and applications.
-- Weaveworks, “Guide To GitOps”
Often you will read immutable architectures, and even more specifically Kubernetes cluster management, as attributes of GitOps. I propose this description is a bit too prescriptive and limiting. You should embrace immutable architectures and Kubernetes in how you deploy applications and services if you can. That certainly makes a GitOps workflow easier to implement effectively, but here we will treat them as suggestions and preferences, not requirements of GitOps. We’ll see why in a bit.
This diagram shows what a typical GitOps workflow looks like from a conceptual level -- automating delivery pipelines to roll out changes to your infrastructure when changes are made in a Git repository.
GitOps has been shown to increase productivity and velocity of deployments and development. Developers can use the tools and workflows they are already familiar with to manage deployments, allowing new developers to get up to speed faster. While Git has traditionally been a developer tool, operations staff benefit from the accumulated knowledge and experience of the Git community and the maturity of its ecosystem. There are a plethora of existing tools out there to make using Git more accessible and easier for those new to it.
Using GitOps brings together deployments and operations with development processes and tooling, providing a consistent means of working in your organization.
With the defined state of your infrastructure under Git version control, complete with a useful audit log of all activity, implementing a GitOps workflow will improve stability and increase reliability. Your organization benefits from being able to track what and when changes happen to help ensure compliance. Git tooling provides stronger security guarantees with its cryptography functions to track these changes and signing to prove its origins. When things go wrong, you can easily revert and roll back to the previous state or rebuild your systems if you need to recover from a disaster.
GitOps the Ansible Way
Previously, we reviewed how you can create Git-centric Infrastructure as Code (IaC) deployment workflows with the Automation Webhooks capabilities in Ansible Tower. GitOps is a more prescriptive workflow of IaC though and conceptually looks something like this diagram.
There are a few things to note about using Red Hat Ansible Automation Platform compared to the typical GitOps pipeline.
Here Ansible Tower replaces the GitOps “agent” (Operator) that runs on a given cluster and pulls in its configuration (state) from Git. Typically these are Kubernetes Operators like Flux or Eunomia.
Ansible Tower can work with Operators running on a Kubernetes cluster for a push/pull sort of approach. Ansible Tower pushes the configuration to the Operators via a Custom Resource (CR) and then the Operator pulls in any container images from the registry and handles whatever setup is necessary. The operators here are made for a specific Kubernetes application or service and are useful outside of a GitOps pipeline rather than one for all configurations and management of the cluster to facilitate GitOps.
Using Ansible also provides the flexibility to apply GitOps workflow principles to systems other than Kubernetes, such as public/private cloud services and networking infrastructure, because you’re not required to use an Operator “agent” on that infrastructure.
Advantages of Using Ansible
There are many tools you can use in your GitOps pipelines; however, Ansible provides some unique advantages that make it ideal for these workflows and extending their use beyond Kubernetes and cloud-native systems.
- GitOps beyond Kubernetes. Like Kubernetes, Ansible is a desired state engine that enables declarative modeling of traditional IT systems without scripting through Ansible Roles and Playbooks. With the k8s module and many others, an Ansible user can manage applications on Kubernetes, on existing IT infrastructure or across both with one simple language.
- Agentless GitOps. Consistent with the Ansible way of doing things, there is no requirement of a specialized GitOps Operator (agent) to facilitate the reconciliation of desired state on your systems.
- Flexibility and Freedom. You also have the flexibility and freedom to use the best tools for your needs and tailor your pipelines more to how you want to work. Ansible excels as IT automation glue.
- Existing Skills & Ecosystem. The same tried and trusted Ansible tooling lets you automate and orchestrate your applications across both new and existing platforms allowing teams to transition without having to learn new skills.
The benefits of using Ansible in this domain doesn’t end here though. There are a lot of benefits for using Ansible in a cloud-native Kubernetes environments.
In Closing
GitOps works by using Git as a single source of truth for declarative infrastructure and applications. It is a workflow whose conceptual roots descend from Site Reliability Engineering, DevOps culture and Infrastructure as Code (IaC) patterns. GitOps is a more prescriptive workflow of IaC based on the experience and wisdom of what works in deploying and managing large sophisticated distributed systems.
Using Red Hat Ansible Automation Platform to implement GitOps pipelines provides unique benefits. Utilizing the Automation Webhook capabilities in Ansible Tower, you can implement agentless GitOps workflows that go beyond just cloud-native systems and manage existing IT infrastructure such as cloud services and networking gear. Using Ansible, enables you to tap into the existing Ansible ecosystem and the flexibility and freedom to use the best tools for how you want to work.
We hope you give GitOps with Ansible a try and see how beneficial and powerful this can be to your organization.
저자 소개
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.