CKA (Certified Kubernetes Administrator)/CKA TIP

Multi-container pods

seulseul 2022. 1. 24. 17:35

다중 컨테이너 포드 (multi-container pods)

pod 내의 컨테이너는 수명주기가 같고, 같은 네트워크에 존재하기 때문에 서로를 localhost 로 참조 할수 있으며,

같은 볼륨에 접근할수 있다.

 

pod 정의 파일의 spec 섹션에서 containers 섹션이 배열인 이유가 바로, 멀티컨테이너 pod 를 사용할 수 있게끔 하기 위해서이다.

 

- 아래 YAML 파일은 kode kloud 예제이다.

https://seulseul.tistory.com/22

 

4.Application Lifecycle Management - Multi Container PODs

Application Lifecycle Management 1) Rolling Updates and Rollbacks 2) Commands and Arguments 3) Env Variables 4) Secrets 5) Multi Container PODs 6) Init Containers 01. Identify the number of contain..

seulseul.tistory.com

 

--
apiVersion: v1
kind: Pod
metadata:
  name: app
  namespace: elastic-stack
  labels:
    name: app
spec:
  containers:
  - name: app
    image: kodekloud/event-simulator
    volumeMounts:
    - mountPath: /log
      name: log-volume

  - name: sidecar
    image: kodekloud/filebeat-configured
    volumeMounts:
    - mountPath: /var/log/event-simulator/
      name: log-volume

  volumes:
  - name: log-volume
    hostPath:
      # directory location on host
      path: /var/log/webapp
      # this field is optional
      type: DirectoryOrCreate

 

 

- 멀티컨테이너 일때 로그 

# 컨테이너 지정후 로그 파일 조회
kubectl -n elastic-stack exec -it app -- cat /log/app.log

# 컨테이너 접속
kubectl exec -it app -- sh

bookmark

 

https://matthewpalmer.net/kubernetes-app-developer/articles/multi-container-pod-design-patterns.html

 

Multi-Container Pod Design Patterns - CKAD Course

Multi-Container Pod Design Patterns in Kubernetes Multi-container pods are extremely useful for specific purposes in Kubernetes. While it’s not always necessary to combine multiple containers into a single pod, knowing the right patterns to adopt creates

matthewpalmer.net

https://www.mirantis.com/blog/multi-container-pods-and-container-communication-in-kubernetes/

 

Kubernetes multi-container pods and container communication

See how pods vs containers differ. Learn how sidecar containers help multi-container pods w/ sidecar container examples. Pod to pod communication info.

www.mirantis.com

https://voidmainvoid.tistory.com/145?category=668790 

 

쿠버네티스 로그 아키텍쳐 개요 및 방법

Logging Architecture 로그들은 에러를 디버깅하거나 클러스터의 status에 대해 자세히 알 수 있다. 앞에서 말한 목적때문에 대부분의 애플리케이션들은 standard output으로 로그파일을 남기고 있다. 그러

blog.voidmainvoid.net