fluxcd version updates

This commit is contained in:
marcel-dempers 2023-09-26 11:23:50 +10:00
parent 25d04c81c7
commit 0cf869ea7c
5 changed files with 11 additions and 13 deletions

View File

@ -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> 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> 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> 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. If Flux pushed the update to our application repo, it will cause a CI/CD loop.
## add image policy and repository ## add image policy and repository
``` ```
kubectl -n default apply -f repositories/config/apps/example-app-2/gitrepository.yaml kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/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/kustomization.yaml
# see our application # see our application
kubectl get deploy kubectl get deploy
kubectl get pods kubectl get pods
# tell flux about our image update policy # 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 kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imagerepository.yaml
kubectl -n default apply -f repositories/config/apps/example-app-2/imagepolicy.yaml kubectl -n default apply -f kubernetes/fluxcd/repositories/infra-repo/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/imageupdateautomation.yaml
# we will also need to provide authentication for our git repo # 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 flux create secret git example-app-2-github --url https://github.com/marcel-dempers/docker-development-youtube-series --username '' --password '' --namespace default

View File

@ -22,7 +22,7 @@ spec:
spec: spec:
containers: containers:
- name: example-app-2 - 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: ports:
- containerPort: 5000 - containerPort: 5000
volumeMounts: volumeMounts:

View File

@ -7,6 +7,4 @@ spec:
interval: 1m0s interval: 1m0s
ref: ref:
branch: fluxcd-2022 branch: fluxcd-2022
url: https://github.com/marcel-dempers/docker-development-youtube-series url: https://github.com/marcel-dempers/docker-development-youtube-series
secretRef:
name: example-app-2-github

View File

@ -20,5 +20,5 @@ spec:
push: push:
branch: fluxcd-2022 branch: fluxcd-2022
update: 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 strategy: Setters

View File

@ -1,11 +1,11 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
metadata: metadata:
name: example-app-2 name: example-app-2
namespace: default namespace: default
spec: spec:
interval: 15m 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 prune: true
sourceRef: sourceRef:
kind: GitRepository kind: GitRepository