commit 4f62aa2bfcb6bb9a69ae8948b0a5f221f3be262a Author: devops Date: Wed Sep 16 16:05:52 2026 +0000 gitops: demo-app manifests + argocd application diff --git a/README.md b/README.md new file mode 100644 index 0000000..0efa7d5 --- /dev/null +++ b/README.md @@ -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// har module ke k8s manifests +``` diff --git a/apps/demo-app.yaml b/apps/demo-app.yaml new file mode 100644 index 0000000..6b565d1 --- /dev/null +++ b/apps/demo-app.yaml @@ -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 diff --git a/manifests/demo-app/deployment.yaml b/manifests/demo-app/deployment.yaml new file mode 100644 index 0000000..634dfb2 --- /dev/null +++ b/manifests/demo-app/deployment.yaml @@ -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 diff --git a/manifests/demo-app/namespace.yaml b/manifests/demo-app/namespace.yaml new file mode 100644 index 0000000..679127d --- /dev/null +++ b/manifests/demo-app/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: demo-app diff --git a/manifests/demo-app/service.yaml b/manifests/demo-app/service.yaml new file mode 100644 index 0000000..68b1cf5 --- /dev/null +++ b/manifests/demo-app/service.yaml @@ -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