Skip to content

Deploy Applications with ArgoCD GitOps

This guide shows how to use this repo to deploy new workloads through ArgoCD ApplicationSets.

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.yaml
  • apps/my-app/app.yaml
  • apps/my-app/deployment.yaml
  • apps/my-app/service.yaml
  • apps/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-app
path: apps/my-app
namespace: my-app

ArgoCD will create an application named app-my-app from this folder and sync it to the namespace defined in app.yaml.

Expose services through the Tailscale Gateway using an HTTPRoute in the same namespace.

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
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: 80

ArgoCD watches the repo and applies changes via ApplicationSets. Once your changes are pushed, ArgoCD will sync the new app.

Terminal window
kubectl get apps -n argocd

Use this if the app is out of sync or if auto-sync is disabled.

Open the ArgoCD UI, select the application, then click Sync.

Terminal window
argocd app sync <app-name>
argocd app wait <app-name> --health