Kustomize-based GitOps Repository Setup for SmoothGlue Run Deployments
SmoothGlue utilizes Argo CD to allow developers to declaratively create and update their application deployments using the GitOps paradigm. This guide will help developers create and manage a Git repository to store their application's deployment configuration for consumption by Argo CD.
GitOps facilitates continuous deployment of applications by allowing developers to declaratively write the expected state of their application deployments, which Argo CD then reads and executes. This guide focuses on defining the expected state using Kustomize, but if preferred, developers may also use Helm in their GitOps flow. See the Helm-based GitOps Repository Setup documentation for more details.
Example Repository
SmoothGlue recommends storing the deployment configuration for an application in a separate repository from that application's source code. SmoothGlue Cloud users may fork the Full Stack Ops GitLab repository into their own organization to act as a template; otherwise, users may create the directory structure manually.
base/
├── back-end/
├── deployment.yaml
├── kustomization.yaml
├── secret.yaml
├── service.yaml
└── virtual-service.yaml
├── front-end/
├── deployment.yaml
├── kustomization.yaml
├── service.yaml
└── virtual-service.yaml
├── resources/
└── namespace.yaml
└── kustomization.yaml
dev/
├── kustomization.yaml
└── pull-credentials.json
├── secrets.yaml
See the Full Stack Example Manifests page for the contents of these files.
The aforementioned directory structure has two top-level directories: base
and
dev
. The base
directory contains the basic Kubernetes manifests necessary
to deploy the application, and the dev
directory extends the configuration
defined in the base
directory with the necessary configuration for the
application to run in the dev
environment. When you are ready to deploy to
production, the structure can easily be extended to add in a production
directory to store the production configuration.
Base Kustomization
The base
directory contains three directories and a file:
back-end/
- This example assumes an application architecture with split back-end and front-end deployments. This directory contains the Kubernetes manifests necessary to deploy the application back-end.
front-end/
- This directory contains the Kubernetes manifests necessary to deploy the application back-end.
resources/
- This directory contains Kubernetes resources not associated with either the back-end or front-end specifically.
kustomization.yaml
- This file is the entrypoint for the
base
Kustomization and refers to all the other resources that need to be created.
- This file is the entrypoint for the