k8s
This commit is contained in:
17
k8s/applications/backend/board-service/autoscaler.yaml
Normal file
17
k8s/applications/backend/board-service/autoscaler.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: board-service-hpa-cpu
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-hpa-cpu
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: board-service-deployment
|
||||
minReplicas: 1
|
||||
maxReplicas: 3
|
||||
targetCPUUtilizationPercentage: 70
|
||||
99
k8s/applications/backend/board-service/deployment.yaml
Normal file
99
k8s/applications/backend/board-service/deployment.yaml
Normal file
@@ -0,0 +1,99 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: board-service-deployment
|
||||
annotations:
|
||||
kubernetes.io/change-cause: "Initialized by manifest files."
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-deployment
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-pod
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-pod
|
||||
spec:
|
||||
tolerations:
|
||||
- key: pvc
|
||||
operator: Equal
|
||||
value: backend-pvc
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- name: board-service
|
||||
image: egovframe/egovframe-msa-edu-backend-board-service:latest # TODO
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
env:
|
||||
- name: SERVER_PORT
|
||||
value: "80"
|
||||
- name: APP_HOME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: common-configmap
|
||||
key: APP_HOME
|
||||
- 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: MYSQL_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: MYSQL_HOSTNAME
|
||||
- name: ZIPKIN_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: ZIPKIN_HOSTNAME
|
||||
- name: RABBITMQ_HOSTNAME
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: backend-configmap
|
||||
key: RABBITMQ_HOSTNAME
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 36
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
volumeMounts:
|
||||
- name: backend-volume
|
||||
mountPath: /srv/nfs
|
||||
volumes:
|
||||
- name: backend-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: backend-pvc
|
||||
18
k8s/applications/backend/board-service/service.yaml
Normal file
18
k8s/applications/backend/board-service/service.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: board-service
|
||||
labels:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-service
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
selector:
|
||||
env: production
|
||||
tier: backend
|
||||
app: board-service
|
||||
name: board-service-pod
|
||||
Reference in New Issue
Block a user