经典 sidecar(普通容器)
经典 sidecar(普通容器)
containers:
- name: app
image: registry.example.com/app:1.26.0
- name: log-shipper
image: registry.example.com/fluent-bit:2.2
volumeMounts:
- name: logs
mountPath: /var/log/app原生 sidecar 写法
原生 sidecar 写法
initContainers:
- name: proxy
image: registry.example.com/envoy:v1.29
restartPolicy: Always # init 容器设为总是重启 = 原生 sidecar
containers:
- name: app
image: registry.example.com/app:1.26.0原生 sidecar 随主容器一起生命周期管理、可先于主容器启动并最后退出,解决了经典 sidecar 的顺序与退出问题。