BookStudyWithChimaek / 2021-Season3

북스터디 시즌3 (2021-09-17 ~ 2021-10-22)
3 stars 1 forks source link

[3장] 쿠버네티스에서 애플리케이션을 동작시키는 구조 #9

Open creaton60 opened 2 years ago

creaton60 commented 2 years ago

이 장에서 다루는 내용

이 이슈에서 얘기할 내용

creaton60 commented 2 years ago

KakaoTalk_Photo_2021-10-08-20-32-24

creaton60 commented 2 years ago

Pod 란?

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

KakaoTalk_Photo_2021-10-08-20-42-38

creaton60 commented 2 years ago

파드 초기화 컨테이너

creaton60 commented 2 years ago
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
creaton60 commented 2 years ago
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
creaton60 commented 2 years ago
lifecycle:
   preStop:
       exec:
          command: ["/bin/sh", "-c", "sleep 2"]
creaton60 commented 2 years ago

Deployment

$ kubectl get deployment

replicaset

$ kubectl get replicaset

스크린샷 2021-10-08 오후 9 14 46
creaton60 commented 2 years ago

describe

creaton60 commented 2 years ago

외부에 공개하기 위한 리소스

service

스크린샷 2021-10-08 오후 9 45 53

스크린샷 2021-10-08 오후 9 46 27

CLB/NLB or ALB

스크린샷 2021-10-08 오후 9 57 03

스크린샷 2021-10-08 오후 9 59 10

ALB ingress controller

aws-eks-alb-ingress-basics

creaton60 commented 2 years ago

레퍼런스

creaton60 commented 2 years ago

Secret & ConfigMap

Read / Liveness Probe

리소스 관리