mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
fluxcd version updates
This commit is contained in:
parent
25d04c81c7
commit
0cf869ea7c
@ -253,24 +253,24 @@ docker push aimvector/example-app-2:0.0.1
|
||||
We will need to tell Flux how to manage our image deployment </br>
|
||||
Note that this time our Kubernetes YAML is in the `configs` repo. </br>
|
||||
This is because our application repo triggers it's CI which will build and push a new image to our cluster </br>
|
||||
Flux will then detech the new image tag and update our Kubernetes YAML in our configs repo. </br>
|
||||
Flux will then detect the new image tag and update our Kubernetes YAML in our configs repo. </br>
|
||||
If Flux pushed the update to our application repo, it will cause a CI/CD loop.
|
||||
|
||||
## add image policy and repository
|
||||
|
||||
```
|
||||
|
||||
kubectl -n default apply -f repositories/config/apps/example-app-2/gitrepository.yaml
|
||||
kubectl -n default apply -f repositories/config/apps/example-app-2/kustomization.yaml
|
||||
kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/gitrepository.yaml
|
||||
kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/kustomization.yaml
|
||||
|
||||
# see our application
|
||||
kubectl get deploy
|
||||
kubectl get pods
|
||||
|
||||
# tell flux about our image update policy
|
||||
kubectl -n default apply -f repositories/config/apps/example-app-2/imagerepository.yaml
|
||||
kubectl -n default apply -f repositories/config/apps/example-app-2/imagepolicy.yaml
|
||||
kubectl -n default apply -f repositories/config/apps/example-app-2/imageupdateautomation.yaml
|
||||
kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imagerepository.yaml
|
||||
kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imagepolicy.yaml
|
||||
kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imageupdateautomation.yaml
|
||||
|
||||
# we will also need to provide authentication for our git repo
|
||||
flux create secret git example-app-2-github --url https://github.com/marcel-dempers/docker-development-youtube-series --username '' --password '' --namespace default
|
||||
|
@ -22,7 +22,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: example-app-2
|
||||
image: docker.io/aimvector/example-app-2:0.0.2 # {"$imagepolicy": "default:example-app-2"}
|
||||
image: docker.io/aimvector/example-app-2:0.0.1 # {"$imagepolicy": "default:example-app-2"}
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
volumeMounts:
|
||||
|
@ -8,5 +8,3 @@ spec:
|
||||
ref:
|
||||
branch: fluxcd-2022
|
||||
url: https://github.com/marcel-dempers/docker-development-youtube-series
|
||||
secretRef:
|
||||
name: example-app-2-github
|
@ -20,5 +20,5 @@ spec:
|
||||
push:
|
||||
branch: fluxcd-2022
|
||||
update:
|
||||
path: ./kubernetes/fluxcd/repositories/config/apps/example-app-2/deploy/deployment.yaml
|
||||
path: .kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy/deployment.yaml
|
||||
strategy: Setters
|
@ -1,11 +1,11 @@
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: example-app-2
|
||||
namespace: default
|
||||
spec:
|
||||
interval: 15m
|
||||
path: "./kubernetes/fluxcd/repositories/config/apps/example-app-2/deploy"
|
||||
path: "./kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy"
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
|
Loading…
x
Reference in New Issue
Block a user