πŸ“˜ Init Containers in Kubernetes

βœ… κΈ°λ³Έ κ°œλ…

πŸ‘‰ 이런 상황에 μ“°λŠ” 것이 Init Container


βœ… νŠΉμ§•


βœ… 간단 μ˜ˆμ‹œ 1

λ¦¬ν¬μ§€ν† λ¦¬μ—μ„œ μ½”λ“œ λ°›μ•„μ˜€κΈ°

apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
spec:
  containers:
  - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  initContainers:
  - name: init-myservice
    image: busybox
    command: ['sh', '-c', 'git clone <some-repo>']


βœ… 간단 μ˜ˆμ‹œ 2

μ™ΈλΆ€ μ„œλΉ„μŠ€κ°€ 쀀비될 λ•ŒκΉŒμ§€ λŒ€κΈ°