feat: restructure GitOps for multi-environment deployment
- Add apps/myapp/base with deployment, service, httproute - Add apps/myapp/overlays/staging (1 replica, 128Mi/256Mi, staging hostname) - Add apps/myapp/overlays/production (2 replicas, 256Mi/512Mi, prod hostname) - Remove old apps/sample-webapp structure Structure follows folder-per-environment pattern with Kustomize overlays.
This commit is contained in:
21
apps/myapp/base/deployment.yaml
Normal file
21
apps/myapp/base/deployment.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: myapp
|
||||
labels:
|
||||
app: myapp
|
||||
managed-by: argocd
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: myapp
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: myapp
|
||||
spec:
|
||||
containers:
|
||||
- name: myapp
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- containerPort: 80
|
||||
19
apps/myapp/base/httproute.yaml
Normal file
19
apps/myapp/base/httproute.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: myapp-route
|
||||
labels:
|
||||
app: myapp
|
||||
managed-by: argocd
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: cluster-gateway
|
||||
namespace: traefik-system
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: myapp
|
||||
port: 80
|
||||
7
apps/myapp/base/kustomization.yaml
Normal file
7
apps/myapp/base/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- httproute.yaml
|
||||
13
apps/myapp/base/service.yaml
Normal file
13
apps/myapp/base/service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: myapp
|
||||
labels:
|
||||
app: myapp
|
||||
managed-by: argocd
|
||||
spec:
|
||||
selector:
|
||||
app: myapp
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
Reference in New Issue
Block a user