0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CronJobとIstio同時に使うとPodが永遠に終了しない問題

Posted at

問題

アプリケーションコンテナが意図的にexitすると(特にJobの場合など)、Istioコンテナは実行され続けてしまう。

If an application container intentionally exits (typically from usage in a Job), Istio’s container will still run and keep the pod running indefinitely. This is also a top GitHub issue.

根本解決

k8s 1.29以降のsidecar containers

  1. https://istio.io/latest/blog/2023/native-sidecars/
  2. https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/

Workaround

Using Istio with CronJobs

            command: ["/bin/bash", "-c"]
            args:
              - |
                trap "curl --max-time 2 -s -f -XPOST http://127.0.0.1:15000/quitquitquit" EXIT
                while ! curl -s -f http://127.0.0.1:15020/healthz/ready; do sleep 1; done
                sleep 2
                {{ $.Values.cron.command }}

curl -fsI -X POST http://localhost:15020/quitquitquit が必要

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?