GitOps with Flux & Istio - Part 1

June 26, 2024
Paulo Frazao

In today’s rapidly evolving cloud-native ecosystem, managing microservices can be a daunting task. Service meshes like Istio simplify the management of these microservices, providing robust traffic management, security and observability. When combined with GitOps tools like Flux, the deployment and management process becomes even more streamlined, ensuring that your Kubernetes clusters are always in sync with your desired state defined in Git repositories.

This guide will walk you through deploying Istio with Flux, leveraging the power of GitOps for consistent and reliable Kubernetes deployments.

Prerequisites

Before we begin, ensure you have the following:

  1. A Kubernetes cluster (version 1.24 or higher recommended).
  2. kubectl installed and configured to communicate with your cluster.
  3. flux CLI installed.
  4. A Git repository to store your Kubernetes manifests.
  5. istioctl installed for managing Istio installations.

Clone Solo Flux example Repository

Solo.io provides an example GitHub repository that you can use for reference.

Clone/copy the Solo GitHub repository to your own repository.

For more information on how to do this, reference the GitHub documentation.

Step 1: Set Up Flux

1.1 Install Flux CLI

First, install the Flux CLI if you haven’t already:

Or download it directly from the Flux GitHub releases page.


curl -s https://fluxcd.io/install.sh | sudo bash

1.2 Add post build variable substitutions to Kustomization

Prior to bootstrapping Flux into your Kubernetes cluster, modify the cluster_name (line 22) in  postBuild.spec in the ./clusters/cluster1/infrastructure.yaml file to your cluster name.

1.3 Bootstrap Flux

Bootstrap Flux into your Kubernetes cluster and link it with your Git repository. This will set up all the necessary components for Flux to work.

Replace <your-github-username>, <your-repo-name>, and adjust the path as necessary.


flux bootstrap github \
  --owner=<your-github-username> \
  --repository=<your-repo-name> \
  --branch=main \
  --path=./clusters/cluster1 \
  --interval=30s \
  --reconcile=true \
  --personal=true


Step 2: Verify Flux deployment

2.1 Check Flux Pod Status


kubectl get pods -n flux-system

2.2 Check Flux Kustomizations

kubectl get kustomizations –all-namespaces

Step 3: Verify Istio Installation

kubectl get pods -n istio-system

Conclusion

By following these steps, you have successfully deployed Istio using Flux in a Kubernetes cluster. This setup leverages the power of GitOps to ensure that your Istio configuration is always in sync with the declared state in your Git repository, providing a robust and automated way to manage your service mesh.

Flux and Istio together bring the best of both worlds: seamless GitOps practices for continuous deployment and powerful service mesh capabilities for microservices management. This combination enhances the reliability, security, and observability of your Kubernetes deployments, paving the way for more resilient and maintainable infrastructure.

In part 2 of this series, we will be deploying the Istio Ingress Gateway.

Happy deploying!

Cloud connectivity done right