8000 GitHub - lukma99/gitops-test-env: gitops-test-env
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lukma99/gitops-test-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitops-test-env

TLDR: This repository creates a local sandbox environment with a kubernetes cluster and Argo CD and showcases various possibilities of managing multiple stages of an application and how to promote new releases.

Table of Contents

Getting started

Prerequisites

Installation Steps

Follow all these steps in the exact order. You wil have to switch between GitHub settings and your locally cloned fork a few times.

In GitHub

On your computer

  • Clone your fork
  • In the root path of the cloned fork, run the following command after adding your GitHub username in it (renames all occurences of the original repository or ghcr to yours):
# IMPORTANT NOTE:
# write your github username here in lowercase (e.g.: your name is FooBar, then type in GH_USER_NAME=foobar)
GH_USER_NAME=<your-github-user-name>
grep -rl --exclude-dir=.git --exclude=Readme.md --exclude=LICENSE lukma99 . | xargs sed -i "s/lukma99/${GH_USER_NAME}/g"
  • Go to .github/renovate.js and manually replace the e-mail-address in gitAuthor with your own GitHub e-mail-address you use for commits. If your GitHub username contains uppercase letters, then also correct the two occurrences of your username in this file. Other than in the script, you must provide you username here as it appears in GitHub with possible uppercase letters.
  • Commit and push these changes.

In GitHub

  • Go to GitHub Actions, allow them to be run, 88B4 and run the job Build and Push Docker Image with the tag 1.0.0 (because all manifests are initially set to this version). Don't worry that after the first run, the job Deployment Pipeline with PRs will start and fail. That is because there is nothing to change in the YAMLs yet, as 1.0.0 is already included in them.

On your computer

  • Make sure port 8080 is not used by anything. If you must use another port, then change it at the top of ./scripts/setup_cluster.sh. Remember that all following links will then also use this port.
  • In the root path of the cloned fork, run ./scripts/setup_cluster.sh. This will install a local k3d cluster with Argo CD ready to use with this project. During the script it will ask you to enter your GitHub Username and previously generated token.
  • Go to http://localhost:8080/argocd. Wait a few minutes for first sync or press Sync now. All applications should be deployed and are accessible with the links from the section Accessing Argo CD and deployed applications.

Argo CD Web-UI after first Refresh:

argo-web-ui.png

One of the deployed example apps (CI-Dev):

example-app.png

Accessing Argo CD and deployed applications

Port can be changed by changing INGRESS_PORT in ./scripts/setup_cluster.sh

Argo CD:

For the deployments, either click on the following links or find them by yourself on the Argo CD UI: Click on the application card -> Click on APP DETAILS -> Click on the link under URLs

Manual Deployment:

CI-Pipeline Deployment:

Image-Updater Deployment:

Dependency-Bot Deployment:

Preview-Environments:

Usage Guides

See individual usage guides for the release promotion mechanisms in the docs folder:

Packages

 
 
 
0