Deploy Applications with ArgoCD GitOps
Deploy Apps With GitOps
Section titled “Deploy Apps With GitOps”This guide shows how to use this repo to deploy new workloads through ArgoCD ApplicationSets.
Step 1: Add a new app directory
Section titled “Step 1: Add a new app directory”Create a folder under apps/ and include an app.yaml file to define the ArgoCD application settings, plus separate YAML files for each resource.
Example layout:
apps/my-app/namespace.yamlapps/my-app/app.yamlapps/my-app/deployment.yamlapps/my-app/service.yamlapps/my-app/httproute.yaml
If you want automated image updates, also include a kustomization.yaml that lists the resources in the folder.
app.yaml defines the app name, path, and namespace. Example:
name: my-apppath: apps/my-appnamespace: my-appArgoCD will create an application named app-my-app from this folder and sync it to the namespace defined in app.yaml.
Step 2: Use Gateway API for HTTPS
Section titled “Step 2: Use Gateway API for HTTPS”Expose services through the Tailscale Gateway using an HTTPRoute in the same namespace.
apiVersion: gateway.networking.k8s.io/v1kind: HTTPRoutemetadata: name: my-app namespace: my-app annotations: external-dns.alpha.kubernetes.io/expose: "true" external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"spec: parentRefs: - name: tailscale-gateway namespace: tailscale sectionName: https hostnames: - my-app.sudhanva.me rules: - backendRefs: - name: my-app port: 80Step 3: Commit and push
Section titled “Step 3: Commit and push”ArgoCD watches the repo and applies changes via ApplicationSets. Once your changes are pushed, ArgoCD will sync the new app.
Step 4: Verify in ArgoCD
Section titled “Step 4: Verify in ArgoCD”kubectl get apps -n argocdStep 5: Trigger a manual sync
Section titled “Step 5: Trigger a manual sync”Use this if the app is out of sync or if auto-sync is disabled.
Option A: Sync in the UI
Section titled “Option A: Sync in the UI”Open the ArgoCD UI, select the application, then click Sync.
Option B: Sync with CLI
Section titled “Option B: Sync with CLI”argocd app sync <app-name>argocd app wait <app-name> --health