Giter Club home page Giter Club logo

gitops101's Introduction

GitOps 101

Preparation

Make sure you have a GitHub account set up and visit the trainings environment URL provided in the slide deck.

First, fork this repo and clone it:

git clone https://github.com/USERNAME/gitops101.git 

Set up Flux

Install Flux in the Kubernetes cluster:

cd gitops101

kubectl apply -f ./flux/

Download fluxctl from github.com/fluxcd/flux/releases and make it executable. For example, for Linux:

curl -L -o fluxctl https://github.com/fluxcd/flux/releases/download/1.15.0/fluxctl_linux_amd64
chmod +x fluxctl

Get the Flux operator's public key:

./fluxctl identity

Next, configure your GitHub repo with above public key (under Settings -> Deploy keys).

Now, edit flux/flux-deployment.yaml to change/add:

 --git-url=<GIT URL OF YOUR REPOSITORY>
 --git-path=deploy/kubernetes

And make sure changes are reflected:

kubectl apply -f flux/flux-deployment.yaml

Example flows

Now GitOps away:

cp examples/podinfo-dep.yaml deploy/kubernetes
git add deploy
git commit -m "adds new deployment to cluster"
git push origin master

Wait for some 5min until you see the podinfo deployment and pod:

watch kubectl get pods,deploy

Other things to try:

  • Manually delete a deployment (kubectl delete deploy/podinfo)
  • Scale the podinfo deployment to 3 replicas
  • More via https://github.com/bricef/gitops-tutorial (the tutorial here is a stripped down version of this one)

gitops101's People

Contributors

mhausenblas avatar

Stargazers

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

Watchers

 avatar  avatar  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.