mirror of
https://github.com/cna-bootcamp/lifesub.git
synced 2025-12-05 23:56:23 +00:00
356 lines
7.3 KiB
Plaintext
356 lines
7.3 KiB
Plaintext
# ConfigMap
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: common-config
|
|
namespace: ${namespace}
|
|
data:
|
|
ALLOWED_ORIGINS: ${allowed_origins}
|
|
JPA_DDL_AUTO: "update"
|
|
JPA_SHOW_SQL: "true"
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: member-config
|
|
namespace: ${namespace}
|
|
data:
|
|
SERVER_PORT: "8081"
|
|
POSTGRES_HOST: "postgres-member-postgresql"
|
|
POSTGRES_PORT: "5432"
|
|
POSTGRES_DB: "member"
|
|
JWT_ACCESS_TOKEN_VALIDITY: "3600000"
|
|
JWT_REFRESH_TOKEN_VALIDITY: "86400000"
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: mysub-config
|
|
namespace: ${namespace}
|
|
data:
|
|
SERVER_PORT: "8082"
|
|
POSTGRES_HOST: "postgres-mysub-postgresql"
|
|
POSTGRES_PORT: "5432"
|
|
POSTGRES_DB: "mysub"
|
|
FEE_LEVEL_COLLECTOR: "50000"
|
|
FEE_LEVEL_ADDICT: "100000"
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: recommend-config
|
|
namespace: ${namespace}
|
|
data:
|
|
SERVER_PORT: "8083"
|
|
POSTGRES_HOST: "postgres-recommend-postgresql"
|
|
POSTGRES_PORT: "5432"
|
|
POSTGRES_DB: "recommend"
|
|
|
|
---
|
|
# Secrets
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: common-secret
|
|
namespace: ${namespace}
|
|
type: Opaque
|
|
stringData:
|
|
JWT_SECRET_KEY: ${jwt_secret_key}
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: database-secret
|
|
namespace: ${namespace}
|
|
type: Opaque
|
|
stringData:
|
|
POSTGRES_USER: ${postgres_user}
|
|
POSTGRES_PASSWORD: ${postgres_password}
|
|
|
|
---
|
|
# Deployments
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: member
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: member
|
|
spec:
|
|
replicas: ${replicas}
|
|
selector:
|
|
matchLabels:
|
|
app: member
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: member
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
containers:
|
|
- name: member
|
|
image: ${member_image_path}
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8081
|
|
resources:
|
|
requests:
|
|
cpu: ${resources_requests_cpu}
|
|
memory: ${resources_requests_memory}
|
|
limits:
|
|
cpu: ${resources_limits_cpu}
|
|
memory: ${resources_limits_memory}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: common-config
|
|
- configMapRef:
|
|
name: member-config
|
|
- secretRef:
|
|
name: common-secret
|
|
- secretRef:
|
|
name: database-secret
|
|
startupProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8081
|
|
failureThreshold: 30
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8081
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /actuator/health/readiness
|
|
port: 8081
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: mysub
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: mysub
|
|
spec:
|
|
replicas: ${replicas}
|
|
selector:
|
|
matchLabels:
|
|
app: mysub
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mysub
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
containers:
|
|
- name: mysub
|
|
image: ${mysub_image_path}
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8082
|
|
resources:
|
|
requests:
|
|
cpu: ${resources_requests_cpu}
|
|
memory: ${resources_requests_memory}
|
|
limits:
|
|
cpu: ${resources_limits_cpu}
|
|
memory: ${resources_limits_memory}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: common-config
|
|
- configMapRef:
|
|
name: mysub-config
|
|
- secretRef:
|
|
name: common-secret
|
|
- secretRef:
|
|
name: database-secret
|
|
startupProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8082
|
|
failureThreshold: 30
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8082
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /actuator/health/readiness
|
|
port: 8082
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: recommend
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: recommend
|
|
spec:
|
|
replicas: ${replicas}
|
|
selector:
|
|
matchLabels:
|
|
app: recommend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: recommend
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
containers:
|
|
- name: recommend
|
|
image: ${recommend_image_path}
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8083
|
|
resources:
|
|
requests:
|
|
cpu: ${resources_requests_cpu}
|
|
memory: ${resources_requests_memory}
|
|
limits:
|
|
cpu: ${resources_limits_cpu}
|
|
memory: ${resources_limits_memory}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: common-config
|
|
- configMapRef:
|
|
name: recommend-config
|
|
- secretRef:
|
|
name: common-secret
|
|
- secretRef:
|
|
name: database-secret
|
|
startupProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8083
|
|
failureThreshold: 30
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8083
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /actuator/health/readiness
|
|
port: 8083
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
|
|
---
|
|
# Services
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: member-service
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: member
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: 8081
|
|
protocol: TCP
|
|
selector:
|
|
app: member
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: mysub-service
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: mysub
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: 8082
|
|
protocol: TCP
|
|
selector:
|
|
app: mysub
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: recommend-service
|
|
namespace: ${namespace}
|
|
labels:
|
|
app: recommend
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 80
|
|
targetPort: 8083
|
|
protocol: TCP
|
|
selector:
|
|
app: recommend
|
|
|
|
---
|
|
# Ingress
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: backend-ingress
|
|
namespace: ${namespace}
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
spec:
|
|
rules:
|
|
- host: ${ingress_host}
|
|
http:
|
|
paths:
|
|
- path: /api/auth
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: member-service
|
|
port:
|
|
number: 80
|
|
- path: /api/mysub
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: mysub-service
|
|
port:
|
|
number: 80
|
|
- path: /api/recommend
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: recommend-service
|
|
port:
|
|
number: 80 |