Giter Club home page Giter Club logo

argo-bfs's Introduction

SQUER Brainfood Session | ArgoCD

https://argo-cd.readthedocs.io/en/stable/

This repository contains the presented examples from the SQUER internal Brainfood Session in May 2022. It gives a gentle introduction to ArgoCD and might help getting started with the GitOps approach by providing an environment for playing around and exploring ArgoCD.

Prerequisites

Local Cluster Setup

Execute the following command to create a new k8s (k3d) cluster and install ArgoCD

make bootstrap

Running kubectl get pods -A shows you all the pods running on your newly created cluster. As soon as a pod in namespace argocd starting with the name argocd-server-* is in status Running, you can execute the following command to access the argocd-ui:

make expose-argo

This allows you to access argo at https://localhost:8080 . The username is per default admin and the password can be retrieved via make show-password. You can either use the argo-ui from the browser or the the argocd-cli using the commandline. For using the cli you simply enter argocd login localhost:8080 for authentication.

Create your first ArgoCD Application

You have three options to create a new "Application" in ArgoCD:

  • ArgoCD UI
  • ArgoCD CLI
  • Kubernetes CRD

If you are used to writing k8s yaml files, the possibility of using K8S Custom Ressource Definitions (CRD) avoids technical context switches and learning a new cli, nevertheless provides all the advantages of infrastructure-as-a-code setups.

To create our little hello-world frontend application we simply run kubectl apply -f app.yaml. This creates the ArgoCD CRD "Application" with the name "frontend". From now on, the infrastructure state of our frontend application is defined in the folder frontend in this repository. Whatever kubernetes yaml file we add, this gets automatically applied in our K8S cluster. The syncronisation is triggered via Git-Webhooks, whereas this is not working on our local machines. Therefore we either trigger the sync in the ArgoCD UI or we use the CLI:

argocd app sync frontend

This command tells argo to load the newest changes from the git repo and applies them in the cluster.

However, this is only relevant if we change the yamls after our initial sync. The creation of the ArgoCD aplication triggers the sync as well. So, by running kubectl port-forward svc/helloworld -n frontend 8081:80 we expose our newly created frontend applcation at port 8081 (http://localhost:8081)

argo-bfs's People

Contributors

kremat avatar

Watchers

 avatar David Leitner avatar Ralph Kühnert 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.