gitops: demo-app manifests + argocd application

This commit is contained in:
devops 2026-09-16 16:05:52 +00:00
commit 4f62aa2bfc
5 changed files with 102 additions and 0 deletions

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# gitops
Cluster me kya chal raha hai - iska **ekmatra** source of truth. Haath se
`kubectl apply` mat karo; yahan commit karo, ArgoCD khud laga dega.
```
apps/ ArgoCD Application manifests (app-of-apps)
manifests/<module>/ har module ke k8s manifests
```

29
apps/demo-app.yaml Normal file
View File

@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: demo-app
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://ns31240276.ip-51-195-4.eu/devops/gitops.git
targetRevision: main
path: manifests/demo-app
destination:
server: https://kubernetes.default.svc
namespace: demo-app
syncPolicy:
# Koi kubectl se chhed de to ArgoCD wapas git wali state laa dega.
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 10s
maxDuration: 3m
factor: 2

View File

@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-app
namespace: demo-app
spec:
replicas: 2
revisionHistoryLimit: 5
selector:
matchLabels:
app: demo-app
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
app: demo-app
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: app
# ye tag pipeline commit karti hai - haath se mat badlo
image: ns31240276.ip-51-195-4.eu:5000/swim/demo-app:12
ports:
- containerPort: 8000
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
requests: { cpu: "50m", memory: "64Mi" }
limits: { cpu: "500m", memory: "256Mi" }
readinessProbe:
httpGet: { path: /health, port: 8000 }
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet: { path: /health, port: 8000 }
initialDelaySeconds: 15
periodSeconds: 20

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: demo-app

View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: demo-app
namespace: demo-app
spec:
type: NodePort
selector:
app: demo-app
ports:
- port: 80
targetPort: 8000
nodePort: 30800