k8s
This commit is contained in:
17
k8s/applications/backend/apigateway/autoscaler.yaml
Normal file
17
k8s/applications/backend/apigateway/autoscaler.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: apigateway-hpa-cpu
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-hpa-cpu
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: apigateway-deployment
|
||||
minReplicas: 1
|
||||
maxReplicas: 3
|
||||
targetCPUUtilizationPercentage: 70
|
||||
70
k8s/applications/backend/apigateway/deployment.yaml
Normal file
70
k8s/applications/backend/apigateway/deployment.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: apigateway-deployment
|
||||
annotations:
|
||||
kubernetes.io/change-cause: "Initialized by manifest files."
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-deployment
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-pod
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: apigateway
|
||||
image: egovframe/egovframe-msa-edu-backend-apigateway:latest # TODO
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
env:
|
||||
- name: EUREKA_INSTANCE_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: EUREKA_INSTANCE_HOSTNAME
|
||||
- name: APIGATEWAY_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: APIGATEWAY_HOSTNAME
|
||||
- name: SPRING_CLOUD_CONFIG_URI
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: SPRING_CLOUD_CONFIG_URI
|
||||
- name: RABBITMQ_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: RABBITMQ_HOSTNAME
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 36
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
18
k8s/applications/backend/apigateway/ingress/ingress.yaml
Normal file
18
k8s/applications/backend/apigateway/ingress/ingress.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: apigateway-ingress
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: <백엔드 API 게이트웨이 도메인> # TODO
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
backend:
|
||||
serviceName: apigateway
|
||||
servicePort: 8000
|
||||
18
k8s/applications/backend/apigateway/service.yaml
Normal file
18
k8s/applications/backend/apigateway/service.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: apigateway
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-service
|
||||
spec:
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
selector:
|
||||
env: production
|
||||
tier: backend
|
||||
app: apigateway
|
||||
name: apigateway-pod
|
||||
Reference in New Issue
Block a user