Merge pull request #14 from marcel-dempers/flux-test

Flux
This commit is contained in:
Marcel Dempers 2020-07-08 12:30:40 +00:00 committed by GitHub
commit e97d63db55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 103 additions and 47 deletions

52
flux/readme.md Normal file
View File

@ -0,0 +1,52 @@
# Flux Getting Started Guide
# 1 - Kubernetes
Get a Kubernetes Cluster. In this video, I use Docker for Windows.
If you are new to Kubernetes, checkout my videos [here](https://marceldempers.dev/videos/guides/kubernetes-getting-started)
# 2 - Flux CTL
I used Flux 1.18 which I got from the GitHub [Release Page](https://github.com/fluxcd/flux/releases/tag/1.18.0)
Rename it to `fluxctl.exe` & place it in a folder that is on your `$env:Path` environment variable.
Open a new terminal and try
```
fluxctl
```
# 4 - Installing Flux
Make sure you are pointing to the kubernetes cluster you want to use
```
kubectl config current-context
kubectl get nodes
```
```
kubectl create ns flux
$GHUSER = "marcel-dempers"
fluxctl install `
--git-user=${GHUSER} `
--git-email=${GHUSER}@users.noreply.github.com `
--git-url=git@github.com:${GHUSER}/docker-development-youtube-series `
--git-path=kubernetes/configmaps,kubernetes/secrets,kubernetes/deployments `
--git-branch=flux-test `
--namespace=flux | kubectl apply -f -
kubectl -n flux rollout status deployment/flux
$env:FLUX_FORWARD_NAMESPACE = "flux"
fluxctl list-workloads
fluxctl identity
https://github.com/marcel-dempers/docker-development-youtube-series/settings/keys/new
fluxctl sync
annotations:
fluxcd.io/tag.example-app: semver:~1.0
fluxcd.io/automated: 'true'
fluxctl policy -w default:deployment/example-deploy --tag "example-app=1.0.*"
```

View File

@ -1,10 +1,14 @@
---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: example-deploy name: example-deploy
labels: labels:
app: example-app app: example-app
test: test
annotations: annotations:
fluxcd.io/tag.example-app: semver:~1.0
fluxcd.io/automated: 'true'
spec: spec:
selector: selector:
matchLabels: matchLabels:
@ -22,7 +26,7 @@ spec:
spec: spec:
containers: containers:
- name: example-app - name: example-app
image: aimvector/python:1.0.0 image: aimvector/python:1.0.4
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 5000 - containerPort: 5000