Skip to content

Commit

Permalink
#138 Add kong httpbin manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
choisungwook committed Dec 28, 2024
1 parent 94b9471 commit cdf8701
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions common_k8s_manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* [dvwa_webapp](./dvwa_webapp)
* [netshoot debug pod](./netshoot)
* [redis cluster](./redis-cluster/)
* [httpbin](./httpbin/)
2 changes: 2 additions & 0 deletions common_k8s_manifests/httpbin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 개요
* kong httpbin 애플리케이션
40 changes: 40 additions & 0 deletions common_k8s_manifests/httpbin/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpbin
namespace: default
labels:
app: httpbin
spec:
replicas: 1
selector:
matchLabels:
app: httpbin
template:
metadata:
labels:
app: httpbin
spec:
terminationGracePeriodSeconds: 30
containers:
- name: httpbin
image: kong/httpbin:0.2.1
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /status/200
port: 80
initialDelaySeconds: 20
periodSeconds: 5
lifecycle:
preStop:
exec:
command: [ "sh", "-c", "echo 'PreStop Hook: Waiting 15 seconds' && sleep 15" ]
resources:
limits:
cpu: 300m
memory: 128Mi
requests:
cpu: 300m
memory: 128Mi
28 changes: 28 additions & 0 deletions common_k8s_manifests/httpbin/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# AWS ALB Ingress Controller를 사용하여 Ingress 리소스를 생성합니다.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: httpbin
namespace: default
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/target-group-attributes: deregistration_delay.timeout_seconds=60
alb.ingress.kubernetes.io/healthcheck-path: "/status/200" # readinessProbe와 동일한 경로 설정
alb.ingress.kubernetes.io/healthcheck-port: "80" # 컨테이너 포트 설정
alb.ingress.kubernetes.io/healthcheck-interval-seconds: "10" # 헬스체크 주기 (초)
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: "5" # 헬스체크 타임아웃 (초)
alb.ingress.kubernetes.io/healthy-threshold-count: "2" # 헬스 체크 성공 기준 횟수
alb.ingress.kubernetes.io/unhealthy-threshold-count: "2" # 헬스 체크 실패 기준 횟수
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: httpbin
port:
number: 80
15 changes: 15 additions & 0 deletions common_k8s_manifests/httpbin/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: httpbin
namespace: default
labels:
app: httpbin
spec:
selector:
app: httpbin
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP

0 comments on commit cdf8701

Please sign in to comment.