diff --git a/kubernetes/fluxcd/README.md b/kubernetes/fluxcd/README.md index 521e24d..2181308 100644 --- a/kubernetes/fluxcd/README.md +++ b/kubernetes/fluxcd/README.md @@ -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
Note that this time our Kubernetes YAML is in the `configs` repo.
This is because our application repo triggers it's CI which will build and push a new image to our cluster
-Flux will then detech the new image tag and update our Kubernetes YAML in our configs repo.
+Flux will then detect the new image tag and update our Kubernetes YAML in our configs repo.
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 diff --git a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy/deployment.yaml b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy/deployment.yaml index 7ca2722..ffcece5 100644 --- a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy/deployment.yaml +++ b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/deploy/deployment.yaml @@ -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: diff --git a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/gitrepository.yaml b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/gitrepository.yaml index 960eb0b..dba1acd 100644 --- a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/gitrepository.yaml +++ b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/gitrepository.yaml @@ -7,6 +7,4 @@ spec: interval: 1m0s ref: branch: fluxcd-2022 - url: https://github.com/marcel-dempers/docker-development-youtube-series - secretRef: - name: example-app-2-github \ No newline at end of file + url: https://github.com/marcel-dempers/docker-development-youtube-series \ No newline at end of file diff --git a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imageupdateautomation.yaml b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imageupdateautomation.yaml index 1772053..14b81f4 100644 --- a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imageupdateautomation.yaml +++ b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/imageupdateautomation.yaml @@ -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 \ No newline at end of file diff --git a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/kustomization.yaml b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/kustomization.yaml index 91e12a5..bcc8c88 100644 --- a/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/kustomization.yaml +++ b/kubernetes/fluxcd/repositories/infra-repo/apps/example-app-2/kustomization.yaml @@ -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