Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhausenblas/gitops101
GitOps 101
https://github.com/mhausenblas/gitops101
gitops
Last synced: 14 days ago
JSON representation
GitOps 101
- Host: GitHub
- URL: https://github.com/mhausenblas/gitops101
- Owner: mhausenblas
- License: apache-2.0
- Created: 2019-11-01T12:04:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-05T09:15:16.000Z (over 5 years ago)
- Last Synced: 2024-11-25T23:42:28.342Z (2 months ago)
- Topics: gitops
- Homepage:
- Size: 13.7 KB
- Stars: 16
- Watchers: 3
- Forks: 86
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```sh
git clone https://github.com/USERNAME/gitops101.git
```## Set up Flux
Install Flux in the Kubernetes cluster:
```sh
cd gitops101kubectl apply -f ./flux/
```Download `fluxctl` from [github.com/fluxcd/flux/releases](https://github.com/fluxcd/flux/releases/tag/1.15.0)
and make it executable. For example, for Linux:```sh
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:
```sh
./fluxctl identity
```Next, configure your GitHub repo with above public key (under Settings -> Deploy keys).
Now, edit `flux/flux-deployment.yaml` to change/add:
```sh
--git-url=
--git-path=deploy/kubernetes
```And make sure changes are reflected:
```sh
kubectl apply -f flux/flux-deployment.yaml
```## Example flows
Now GitOps away:
```sh
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:
```sh
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)