GitOps-Driven CI/CD on OpenShift with Tekton Pipelines and Quay

Introduction

Welcome to the workshop on implementing GitOps-driven CI/CD on OpenShift using Tekton Pipelines and Quay. This workshop is designed for developers and DevOps engineers with some Kubernetes experience who are interested in leveraging GitOps principles for continuous integration and continuous deployment (CI/CD) on OpenShift.

Target Audience

This workshop is tailored for:

  • Developers: Those who want to understand how to automate their CI/CD pipelines using GitOps principles.

  • DevOps Engineers: Individuals responsible for managing and deploying applications on Kubernetes platforms like OpenShift.

Workshop Outline

1. Introduction to Tekton, GitOps, and OpenShift

  • What is GitOps? GitOps is a set of practices that use Git repositories as the source of truth for defining the desired application state. It emphasizes declarative infrastructure, continuous delivery, and automated deployments.

  • Why GitOps with OpenShift? OpenShift provides a robust platform for GitOps workflows with built-in support for Argo CD and Tekton. It offers a secure and scalable environment for deploying and managing applications.

  • OpenShift GitOps and Argo CD: Argo CD is the GitOps engine in OpenShift, responsible for continuous delivery and automated deployments. It synchronizes the state of the cluster with the desired state defined in Git repositories.

  • Tekton’s Role in GitOps: Tekton is the CI component within the GitOps workflow. It automates the build, test, and delivery stages of the CI/CD process and integrates with Argo CD to trigger deployments based on Git changes.

  • Kubernetes Management Tools:

  • Kustomize: A tool for customizing Kubernetes resource files and managing simple deployments.

  • Helm: A package manager for Kubernetes that uses templating to deploy complex applications.

2. Quay and OpenShift Pipelines

  • Introduction to Quay: Red Hat Quay is a robust container registry that stores, builds, and deploys container images. In the CI/CD pipeline, Quay serves as a central repository for container images, facilitating efficient storage, versioning, and distribution. It also offers features like image vulnerability scanning and mirroring, enhancing security and reliability in the development workflow.

  • Integrating Quay with OpenShift Pipelines: To automate the CI/CD process, integrate Quay with OpenShift Pipelines (based on Tekton). This integration allows pipelines to push newly built images to Quay and trigger subsequent tasks, such as deployments or notifications. For instance, configuring Tekton pipelines to push images to Quay can be achieved by creating a secret with Quay credentials and referencing it in the pipeline tasks.

  • Security Considerations: Securing container images in Quay involves implementing best practices such as enabling image vulnerability scanning, using signed images, and enforcing access controls. Integrating security tools like Sigstore and Tekton Chains can further enhance the security posture by providing image signing and verification capabilities.

  • Hands-on Exercise: Participants will configure Quay integration within their OpenShift Pipelines setup. This includes creating a Quay repository, setting up necessary credentials, and modifying pipeline configurations to push images to Quay. Additionally, participants will implement security measures such as enabling image scanning and signing to ensure the integrity and security of their container images.

3. Tekton Pipelines for GitOps

  • Tekton and GitOps: Understand how Tekton pipelines can trigger deployments based on changes in the Git repository.

  • Building and Pushing Images: Demonstrate how to use Tekton to build container images and push them to Quay, initiating the GitOps deployment process.

  • Tekton and Argo CD Integration: Show how to integrate Tekton with Argo CD for a seamless GitOps workflow.

  • (Hands-on): Participants will modify Tekton pipelines to work with Argo CD and trigger deployments based on Git events.

4. Deploying the Todo App with GitOps

  • Setting up the GitOps Repository: Guide participants through setting up a Git repository with the necessary configuration files for the Todo application.

  • Defining the Desired State: Explain how to define the desired state of the application in Git, including deployments, services, and other resources.

  • Using Argo CD for Deployment: Demonstrate how to use Argo CD to synchronize the application deployment on OpenShift with the Git repository.

  • (Hands-on): Participants will deploy the Todo app using GitOps principles, observing how Argo CD automates the process.

5. Managing and Updating Applications with GitOps

  • Making Changes through Git: Show how to update the application by making changes to the configuration files in the Git repository.

  • Automated Updates with Argo CD: Demonstrate how Argo CD automatically detects changes in the Git repository and deploys the updates to OpenShift.

  • Rollbacks and Version Control: Explain how GitOps facilitates rollbacks and version control for application deployments.

  • (Hands-on): Participants will update the Todo app and practice performing rollbacks using Git and Argo CD.

6. Advanced GitOps Techniques (Optional)

  • Progressive Delivery: Introduce techniques like canary deployments and blue/green deployments using Argo CD.

  • Multi-Environment Deployments: Discuss strategies for managing deployments across different environments (e.g., development, staging, production) with GitOps.

  • Observability and Monitoring: Show how to integrate observability tools for monitoring application health and troubleshooting deployments.

  • (Hands-on): Participants can engage in advanced exercises or demonstrations based on their interests and skill levels.

Next Steps

Resources for further learning: * Documentation link * Product landing page * Video resources * Community forums

Requirements for the Lab Environment

  • Participant hardware and software requirements

  • Recommended browser/access specifications

Credentials for the Console

Your console is available {web_console}[here^].

Administrator login: * User: {admin_user} * Password: {admin_password}

Additional Access Details

Bastion Host Access

ssh root@{bastion_ip}

Additional Environment Access * Environment: {additional_env} * User: {additional_user} * Password: {additional_password}