ポッドの再起動
Kubernetes ポッドは、YAML設定で定義された望ましい状態を維持するように設計されています。ポッドのランタイム環境に影響を与える設定に変更が発生すると、Kubernetesはポッドの再起動を開始して、実際の状態が目指すべき状態と一致するようにします。この調整プロセスは、Kubernetesの運用の基本です。
具体的には、AgentConfiguration、AgentConnection、AgentInjectorなどのリソースに対する変更が、これらの再起動のトリガーとなります。これらのリソースは、接続性、設定、組み込みルールなど、ポッドの動作の重要な側面を定義します。これらの設定が更新されると、Kubernetesは現在のポッドの状態と新しい望ましい状態との間の不一致を検出します。
The impact extends to ClusterAgentConnection, ClusterAgentConfiguration, and ClusterAgentInjector too. These cluster-level resources generate AgentConnections, AgentConfigurations, and AgentInjectors within specified namespaces.
ポッドの設定を変更した場合は、直接的であれ関連リソースによる間接的なものであれ、ポッドがクラスタ内で定義された最新の状態を反映することを保証するために再起動が必要になります。これにより、アプリケーション全体の一貫性と信頼性が確保されます。設定の変更によって特に影響を受けるポッドのみが再起動されることを理解することが重要です。例えば、AgentInjectorが特定のラベルセレクタを使用するデプロイを対象とする場合、クラスタ内の全てのポッドではなく、それらの対象となったデプロイ内のポッドのみが再起動されます。
Reduce pod restarts
To have pods lazily update agent versions there are a few options:
Use the latest for the
AgentInjectorversion (the default). This will use the latest agent when a pods starts.Tags for the major and minor versions are published alongside the exact version tag in the docker registry. You can use the major/minor
versionin theAgentInjectorto have pods use the newest agent in that range. For example,2will select the highest 2.x.x version available.If using a custom registry, you can set the
versionon theAgentInjectortolatestand update thelatesttag to point to a new image in the registry.Setting
ClusterAgentInjector.reconcilePolicy: OnCreateorAgentInjector.reconcilePolicy: OnCreatewill patch a workload only when it first becomes matched. After that, the agent-operator leaves the workload alone on settings, version, connection, configuration, or secret drift, and new settings reach pods as they are naturally recreated by deploys, autoscaling, evictions, and node replacement.