mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
commit
e97d63db55
52
flux/readme.md
Normal file
52
flux/readme.md
Normal 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.*"
|
||||
```
|
@ -1,53 +1,57 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: example-deploy
|
||||
labels:
|
||||
app: example-app
|
||||
annotations:
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example-app
|
||||
replicas: 2
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example-app
|
||||
spec:
|
||||
containers:
|
||||
- name: example-app
|
||||
image: aimvector/python:1.0.0
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: example-deploy
|
||||
labels:
|
||||
app: example-app
|
||||
test: test
|
||||
annotations:
|
||||
fluxcd.io/tag.example-app: semver:~1.0
|
||||
fluxcd.io/automated: 'true'
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example-app
|
||||
replicas: 2
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example-app
|
||||
spec:
|
||||
containers:
|
||||
- name: example-app
|
||||
image: aimvector/python:1.0.4
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
# livenessProbe:
|
||||
# httpGet:
|
||||
# path: /status
|
||||
# port: 5000
|
||||
# initialDelaySeconds: 3
|
||||
# periodSeconds: 3
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
volumeMounts:
|
||||
- name: secret-volume
|
||||
mountPath: /secrets/
|
||||
- name: config-volume
|
||||
mountPath: /configs/
|
||||
volumes:
|
||||
- name: secret-volume
|
||||
secret:
|
||||
secretName: mysecret
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: example-config #name of our configmap object
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
volumeMounts:
|
||||
- name: secret-volume
|
||||
mountPath: /secrets/
|
||||
- name: config-volume
|
||||
mountPath: /configs/
|
||||
volumes:
|
||||
- name: secret-volume
|
||||
secret:
|
||||
secretName: mysecret
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: example-config #name of our configmap object
|
||||
|
Loading…
x
Reference in New Issue
Block a user