gitops: demo-app manifests + argocd application
This commit is contained in:
commit
4f62aa2bfc
9
README.md
Normal file
9
README.md
Normal 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
29
apps/demo-app.yaml
Normal 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
|
||||
47
manifests/demo-app/deployment.yaml
Normal file
47
manifests/demo-app/deployment.yaml
Normal 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
|
||||
4
manifests/demo-app/namespace.yaml
Normal file
4
manifests/demo-app/namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: demo-app
|
||||
13
manifests/demo-app/service.yaml
Normal file
13
manifests/demo-app/service.yaml
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user