Open creaton60 opened 2 years ago
Pod manifest file example
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx-app
spec:
containers:
- name: nginx-container
images: nginx
ports:
- containerPort: 80
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: gateway
app.kubernetes.io/managed-by: kubectl
name: gateway-env-deploy
spec:
replicas: 10
selector:
matchLabels:
app: gateway
template:
metadata:
labels:
tags.datadoghq.com/env: prod
tags.datadoghq.com/service: gateway
tags.datadoghq.com/version: 1.0.0
app: gateway-prod
spec:
containers:
- env:
image: DOCKER_IMAGE_PLACE_HOLDER:DOCKER_IMAGE_TAG_PLACEHOLDER
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
limits:
cpu: 2000m
memory: 4096Mi
requests:
cpu: 2000m
memory: 4096Mi
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "sleep 2"]
$ kubectl get deployment
$ kubectl get replicaset
이 장에서 다루는 내용
컨테이너를 동작시키기 위한 리소스인 pod, replicaset, deployment, cronjob, job 의 동작
컨테이너를 외부에 공개하기 위한 서비스의 역할과 종류
pod 를 graceful 하게 Deployment 하기 위한 Read / Live Probe
pod 라이프싸이클과 안전한 파드 정지를 위한 preStop
파드가 확보한 로시스를 관리하는 Request & Limit
이 이슈에서 얘기할 내용