Skip to main content

Quick Start — Deploy Your First Application

After completing the Getting Started setup, follow this guide to deploy your first application via the DevOpsGenie GitOps pipeline.

What you'll build

A complete deployment pipeline for a containerized application including:

  • Namespace with resource quotas
  • ArgoCD application manifest
  • Kubernetes Deployment and Service
  • Horizontal Pod Autoscaler
  • PodDisruptionBudget

Step 1 — Create a Namespace

DevOpsGenie uses Namespace-as-a-Service. Declare a namespace by creating a YAML file in your GitOps repository:

kubernetes/namespaces/team-payments.yaml
apiVersion: devopsgenie.io/v2
kind: ManagedNamespace
metadata:
name: team-payments
spec:
team: payments
environment: production
resourceQuota:
requests.cpu: "8"
requests.memory: 16Gi
limits.cpu: "16"
limits.memory: 32Gi
count/pods: "50"
networkPolicy: strict
costCenter: "eng-payments"

Commit and push. ArgoCD will reconcile the namespace within 60 seconds.

Step 2 — Write a Deployment Manifest

kubernetes/apps/payments-api.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: payments-api
namespace: team-payments
labels:
app: payments-api
version: v1.2.0
team: payments
spec:
replicas: 3
selector:
matchLabels:
app: payments-api
template:
metadata:
labels:
app: payments-api
version: v1.2.0
spec:
serviceAccountName: payments-api
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 2000
seccompProfile:
type: RuntimeDefault
containers:
- name: api
image: your-ecr-repo/payments-api:v1.2.0
ports:
- containerPort: 8080
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
readinessProbe:
httpGet:
path: /healthz/ready
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /healthz/live
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: payments-db-credentials
key: password

Step 3 — Register an ArgoCD Application

gitops/applications/payments-api.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: payments-api
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: team-payments
source:
repoURL: https://github.com/your-org/gitops
targetRevision: main
path: kubernetes/apps/payments
destination:
server: https://kubernetes.default.svc
namespace: team-payments
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=false
- RespectIgnoreDifferences=true
retry:
limit: 3
backoff:
duration: 5s
factor: 2
maxDuration: 3m

Step 4 — Verify the Deployment

# Check ArgoCD sync status
devopsgenie app status payments-api

# Or use kubectl
kubectl get pods -n team-payments -l app=payments-api
kubectl rollout status deployment/payments-api -n team-payments

Expected output:

NAME                           READY   STATUS    RESTARTS   AGE
payments-api-7d9b8c4f5-2xkpz 1/1 Running 0 45s
payments-api-7d9b8c4f5-8rtqw 1/1 Running 0 45s
payments-api-7d9b8c4f5-vp4nl 1/1 Running 0 44s

Step 5 — Enable Autoscaling

kubernetes/apps/payments-api-hpa.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: payments-api
namespace: team-payments
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: payments-api
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 65
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 70

Next Steps