Giter Site home page Giter Site logo

capabilities-shim-gitops's Introduction

capabilities-shim-gitops

This repository is used to demonstrate how to effectively adopt Crossplane in GitOps by using a sample application. The sample application is based on another demo project capabilities-shim that I created to prove the technical feasibility of composing variant existing software capabilities using Crossplane to come up with solution that meets user specific needs.

What it covers?

The repository includes:

  • A bunch of well-organized YAML manifests: Represents variant software modules that can be synchronized and deployed by Argo CD to target cluster. This can be taken as a reference for people to evaluate what a GitOps repository can look like when using Crossplane.
  • Documents in docs folder: Discuss best practices, common considerations, and lessons learned that you might experience as well when use Crossplane in GitOps.
  • A shell script: Help you launch a GitOps demo environment in minutes including a KIND cluster with Argo CD installed.

Follow below instructions to luanch the demo environment. After it is up and running, you can explore the repository, follow the documents in docs folder, and experiment to get hands-on experience of using Crossplane in GitOps.

Play with the demo environment

Launch the demo environment

Please fork this repository to your own GitHub account, then follow below steps to launch the GitOps demo environment.

Go to project root folder and run below command to bring up the environment.

./scripts/install.sh up

It can help you launch a KIND cluster with an Argo CD instance installed. Besides that, it will also install all the necessary command line tools that you may need when you experiment with GitOps, e.g.: argocd CLI, kubeseal CLI.

At the end of the install process, it will print all softwares with their versions installed on your demo environment. Such as below:

๐Ÿ‘ Congratulations! The GitOps demo environment is available!
It launched a kind cluster, installed following tools and applitions:
- argocd cli v2.1.5
- kubeseal cli v0.16.0

To access Argo CD UI, open https://localhost:9443 in browser.
- username: admin
- password: ****************

For tools you want to run anywhere, create links in a directory defined in your PATH, e.g:
ln -s -f /root/Code/capabilities-shim-gitops/scripts/.cache/tools/linux_x86_64/kubectl-v1.17.11 /usr/local/bin/kubectl
ln -s -f /root/Code/capabilities-shim-gitops/scripts/.cache/tools/linux_x86_64/kind-v0.11.1 /usr/local/bin/kind
ln -s -f /root/Code/capabilities-shim-gitops/scripts/.cache/tools/linux_x86_64/argocd-v2.1.5 /usr/local/bin/argocd
ln -s -f /root/Code/capabilities-shim-gitops/scripts/.cache/tools/linux_x86_64/kubeseal-v0.16.0 /usr/local/bin/kubeseal

It also prints the Argo CD UI address, the username and password that you can use to login.

Argocd cli login for cli operations

argocd login localhost:9443 --username admin
Proceed insecurely (y/n)? y
Password:

Install everything else using Argo CD

Login to Argo CD from UI, then create an Argo Application using the following values:

Field Value
Application Name shared-apps
Path config/shared
Project default
Sync policy Automatic
Self Heal true
Repository URL https://github.com/morningspace/capabilities-shim-gitops
Revision HEAD
Cluster URL https://kubernetes.default.svc

You can also do the same thing using argocd CL from command line as below:

argocd app create shared-app --repo https://github.com/morningspace/capabilities-shim-gitops.git \
  --path config/shared \
  --dest-namespace default \
  --dest-server https://kubernetes.default.svc

This will install Crossplane with its providers, OLM, Sealed Secrets Controller, etc. to your demo environment.

After everything is up, run below command to generate and update the cluster-config secret encrypted at local by kubeseal for your demo environment, then check it in git. This is required for the Crossplane provider to access to the KIND cluster.

./scripts/install.sh cluster-config
git add environments/dev/env/cluster-config.json
git commit -m "Update cluster-config.json"
git push

Then create an Argo Application that represents the environment from UI using the following values:

Field Value
Application Name dev-env
Path environments/dev/env
Project default
Sync policy Automatic
Self Heal true
Repository URL https://github.com/morningspace/capabilities-shim-gitops
Revision HEAD
Cluster URL https://kubernetes.default.svc

Congratulations! Now you can explore the repository, follow the documents in docs folder, and experiment with this environment to get hands-on experience of using Crossplane in GitOps.

Troubleshooting

When install Argo CD, some pod may fail to install due to ImagePullBackOff error. This is because the image comes from Docker Hub and you do not specify image pull secret. This can be fixed by run below command:

./scripts/install.sh patch-pull-secret

Clean up

Run below command to delete the demo environment completely from your local.

./scripts/install.sh down

capabilities-shim-gitops's People

Contributors

huang-cn avatar morningspace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.