mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-12-27 19:07:28 +00:00
lb heatlcheck update
This commit is contained in:
parent
33f65120ed
commit
ebd7e111e2
4 changed files with 125 additions and 2 deletions
|
|
@ -9,8 +9,8 @@ metadata:
|
|||
alb.ingress.kubernetes.io/target-type: ip
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}]'
|
||||
|
||||
# 헬스체크 설정
|
||||
alb.ingress.kubernetes.io/healthcheck-path: /actuator/health/liveness
|
||||
# 헬스체크 설정 LB전용 HealthCheck
|
||||
alb.ingress.kubernetes.io/healthcheck-path: /healthz-lb
|
||||
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
|
||||
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
|
||||
|
||||
|
|
@ -19,6 +19,14 @@ spec:
|
|||
rules:
|
||||
- http:
|
||||
paths:
|
||||
#LB 헬스체크 전용
|
||||
- path: /healthz-lb
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: lb-health
|
||||
port:
|
||||
number: 80
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
|
|
|
|||
41
k8s/aws/99-lb-healthCheck.yaml
Normal file
41
k8s/aws/99-lb-healthCheck.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: lb-health
|
||||
namespace: petclinic-ns
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: lb-health
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: lb-health
|
||||
spec:
|
||||
containers:
|
||||
- name: echo
|
||||
image: hashicorp/http-echo
|
||||
args:
|
||||
- "-text=OK"
|
||||
ports:
|
||||
- containerPort: 5678
|
||||
resources:
|
||||
requests:
|
||||
cpu: "5m"
|
||||
memory: "16Mi"
|
||||
limits:
|
||||
cpu: "10m"
|
||||
memory: "32Mi"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: lb-health
|
||||
namespace: petclinic-ns
|
||||
spec:
|
||||
selector:
|
||||
app: lb-health
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 5678
|
||||
|
|
@ -1,5 +1,16 @@
|
|||
apiVersion: cloud.google.com/v1
|
||||
kind: BackendConfig
|
||||
metadata:
|
||||
name: lb-health-backendconfig
|
||||
namespace: petclinic-ns
|
||||
spec:
|
||||
healthCheck:
|
||||
type: HTTP
|
||||
requestPath: /healthz-lb
|
||||
port: 80
|
||||
---
|
||||
apiVersion: cloud.google.com/v1
|
||||
kind: BackendConfig
|
||||
metadata:
|
||||
name: petclinic-backendconfig
|
||||
namespace: petclinic-ns
|
||||
|
|
@ -11,6 +22,20 @@ spec:
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: lb-health
|
||||
namespace: petclinic-ns
|
||||
annotations:
|
||||
beta.cloud.google.com/backend-config: '{"default":"lb-health-backendconfig"}'
|
||||
spec:
|
||||
selector:
|
||||
app: lb-health
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 5678
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: petclinic
|
||||
namespace: petclinic-ns
|
||||
|
|
@ -36,6 +61,14 @@ spec:
|
|||
rules:
|
||||
- http:
|
||||
paths:
|
||||
# LB 헬스체크 전용
|
||||
- path: /healthz-lb
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: lb-health
|
||||
port:
|
||||
number: 80
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
|
|
|
|||
41
k8s/gcp/99-lb-healthCheck.yaml
Normal file
41
k8s/gcp/99-lb-healthCheck.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: lb-health
|
||||
namespace: petclinic-ns
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: lb-health
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: lb-health
|
||||
spec:
|
||||
containers:
|
||||
- name: echo
|
||||
image: hashicorp/http-echo
|
||||
args:
|
||||
- "-text=OK"
|
||||
ports:
|
||||
- containerPort: 5678
|
||||
resources:
|
||||
requests:
|
||||
cpu: "5m"
|
||||
memory: "16Mi"
|
||||
limits:
|
||||
cpu: "10m"
|
||||
memory: "32Mi"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: lb-health
|
||||
namespace: petclinic-ns
|
||||
spec:
|
||||
selector:
|
||||
app: lb-health
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 5678
|
||||
Loading…
Add table
Add a link
Reference in a new issue