This is the third and final part of the series on Using Flux, a GitOps Tool, with Amazon Elastic Kubernetes Service (EKS). In the last two articles, we discussed various topics. These include what GitOps is, what Flux is, reviewed the architecture, reviewed the Terraform code used to deploy the AWS resources, and successfully deployed the Terraform Code to AWS. We also installed the GitOps and Flux CLI, examined the "configure.sh" script to configure the Flux Repository, and installed Flux to the Amazon EKS cluster.
In this final and third article, we will cover the following topics.
- Folder Structure of Flux Git Repository
- Weave GitOps - A Flux Web User Interface
- Review the Addons and Applications managed by Flux
- Access the Applications managed by Flux
- Demonstrate how Flux works
- Clean up apps and infrastructure
Folder Structure of Flux Git Repository
Flux provides several ways to structure and organize your repositories. Please click here if you want more information on the various methods.
Let's see how we organized the folder structure. It looks like this.
Each cluster we want to manage is defined in a dedicated directory. In this example, we are using the name "eks-fluxcd-lab". When we bootstrapped and installed Flux to the Amazon EKS Cluster, we specified a path to the cluster configuration. It was "cluster/eks-fluxcd-lab". This directory is where we define the apps and infrastructure we want to be managed by Flux.
As you can see, this allows us to have multiple cluster configurations for Flux to manage. We can keep all of the code in on Git repository.
Below is the folder structure we are using to define what apps and infrastructure we want to be managed by Flux.
One benefit of separating apps from infrastructure is that we can define the order in apps, and infrastructure is reconciled and deployed. In this example, infrastructure is deployed first, then the apps are deployed. This is accomplished by the apps.yaml and infrastructure.yaml files are located in the clusters/eks-flux-lab folder.
In the apps.yaml, the "app-sources" depend on "infra-configs" to be reconciled first.
apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: apps-sources namespace: flux-system spec: dependsOn: - name: infra-configs interval: 10m0s retryInterval: 1m0s timeout: 5m0s sourceRef: kind: GitRepository name: flux-system path: ./k8s/apps/sources prune: true wait: true
Managing Flux
Managing Flux is handled by using the Flux CLI. Flux does not come with any Web or UI interface to manage Flux. Please click here if you would like more information on the Flux CLI.
The following are some commands you can use to manage Flux.
flux get all flux get sources all