Deploying applications
We have successfully configured Argo CD App of Apps, so now we can deploy an environment specific customization for the set of application.
First let's remove the existing Applications so we can replace it:
namespace "assets" deleted
namespace "carts" deleted
namespace "catalog" deleted
namespace "checkout" deleted
namespace "orders" deleted
namespace "other" deleted
namespace "rabbitmq" deleted
namespace "ui" deleted
...
We will then need to create a customization for each application:
.
|-- app-of-apps
| |-- ...
`-- apps-kustomization
|-- assets
| `-- kustomization.yaml
|-- carts
| `-- kustomization.yaml
|-- catalog
| `-- kustomization.yaml
|-- checkout
| `-- kustomization.yaml
|-- orders
| `-- kustomization.yaml
|-- other
| `-- kustomization.yaml
|-- rabbitmq
| `-- kustomization.yaml
`-- ui
|-- deployment-patch.yaml
`-- kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/aws-samples/eks-workshop-v2/manifests/base-application/ui?ref=stable
patches:
- path: deployment-patch.yaml
We define a path to base
Kubernetes manifests for an application, in this case ui
, using resources
. We also define which configuration should be applied to ui
application in EKS cluster using patches
.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui
spec:
replicas: 1
We would like to have 1
replica for ui
application. All other application will use configuration from base
Kubernetes manifests.
Copy files to the Git repository directory:
Your final Git directory should now look like this. You can validate it by running tree ~/environment/argocd
:
|-- app-of-apps
| |-- Chart.yaml
| |-- templates
| | |-- _application.yaml
| | `-- application.yaml
| `-- values.yaml
|-- apps
| ...
`-- apps-kustomization
|-- assets
| `-- kustomization.yaml
|-- carts
| `-- kustomization.yaml
|-- catalog
| `-- kustomization.yaml
|-- checkout
| `-- kustomization.yaml
|-- orders
| `-- kustomization.yaml
|-- other
| `-- kustomization.yaml
|-- rabbitmq
| `-- kustomization.yaml
`-- ui
|-- deployment-patch.yaml
`-- kustomization.yaml
12 directories, 19 files
Push changes to the Git repository:
Click Refresh
and Sync
in ArgoCD UI, use argocd
CLI to Sync
the application or wait until automatic Sync
will be finished:
We've now successfully migrated the all the applications to deploy using Argo CD, and any further changes pushed to the Git repository will be automatically reconciled to EKS cluster.
When Argo CD finish the sync, all our applications will be in Synced
state.
You should also have all the resources related to the ui
application deployed. To verify, run the following commands:
NAME READY UP-TO-DATE AVAILABLE AGE
ui 1/1 1 1 61s
NAME READY STATUS RESTARTS AGE
ui-6d5bb7b95-rjfxd 1/1 Running 0 62s