Add projects app base configuration and yc-k8s-test overlay with Kustomization files

This commit is contained in:
emelinda 2026-04-13 11:45:53 +03:00
parent d45263ecea
commit 00708f1853
13 changed files with 91 additions and 102 deletions

View File

@ -1,9 +0,0 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: example-app-config
namespace: example-app
data:
APP_ENV: "production"
LOG_LEVEL: "info"

View File

@ -1,47 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
namespace: example-app
labels:
app.kubernetes.io/name: example-app
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: example-app
template:
metadata:
labels:
app.kubernetes.io/name: example-app
spec:
containers:
- name: example-app
image: nginx:1.27-alpine
ports:
- name: http
containerPort: 80
protocol: TCP
envFrom:
- configMapRef:
name: example-app-config
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10

View File

@ -1,5 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: example-app

View File

@ -1,17 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: example-app
namespace: example-app
labels:
app.kubernetes.io/name: example-app
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: example-app
ports:
- name: http
port: 80
targetPort: http
protocol: TCP

View File

@ -1,10 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./base
patches:
- path: patches/replicas.yaml
target:
kind: Deployment
name: example-app

View File

@ -1,9 +0,0 @@
---
# Переопределения для example-app на кластере contour
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
namespace: example-app
spec:
replicas: 2

View File

@ -0,0 +1,46 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: projects-frontend-static
namespace: projects
labels:
app: projects-frontend-static
spec:
replicas: 2
selector:
matchLabels:
app: projects-frontend-static
template:
metadata:
labels:
app: projects-frontend-static
spec:
containers:
- name: projects-frontend-static
image: cr.yandex/crp3ccidau046kdj8g9q/project-frontend-app:wb_fd49eb19
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /ping
port: 80
initialDelaySeconds: 10
periodSeconds: 60
failureThreshold: 10
readinessProbe:
httpGet:
path: /ping
port: 80
initialDelaySeconds: 10
periodSeconds: 30
failureThreshold: 20
resources:
requests:
cpu: 100m
memory: 100Mi
imagePullSecrets:
- name: regcred

View File

@ -1,9 +1,8 @@
--- ---
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: example-app namespace: projects
resources: resources:
- namespace.yaml - namespace.yaml
- configmap.yaml # - deployment.yaml
- deployment.yaml # - service.yaml
- service.yaml

View File

@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: projects
labels:
istio-injection: enabled

View File

@ -0,0 +1,15 @@
---
apiVersion: v1
kind: Service
metadata:
name: projects-frontend-static-service
namespace: projects
spec:
type: ClusterIP
selector:
app: projects-frontend-static
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP

View File

@ -0,0 +1,10 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
patches: []
# - path: replicas.yaml
# target:
# kind: Deployment
# name: projects-frontend-static

View File

@ -0,0 +1,8 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: projects-frontend-static
namespace: projects
spec:
replicas: 2

View File

@ -6,4 +6,5 @@ resources:
- ./infrastructure - ./infrastructure
# apps # apps
- ../../apps/reviews/yc-k8s-test - ../../apps/reviews/yc-k8s-test
- ../../apps/projects/yc-k8s-test