以下のコマンドの実行などで、Podに対応するKubernetes YAMLファイルを一度用意しておけば、 ``` podman generate kube mypod -f=mypod.yaml ``` `replace`オプションを利用した以下のコマンドで1つで、PodとそのContainerの停止から削除、再生成までを一度に行えます。 ``` podman play kube mypod.yaml --replace ``` ## Imageの更新について Kubernetes YAMLファイル内で`imagePullPolicy:`を指定していないlatestタグのImageは、 `replace`を利用した前述のコマンドの実行により、Imageの更新(pull)も併せて行われます。 latest以外のタグのImageが更新された形でPodを再生成したい場合は、 以下のコマンドでImageを更新してから、`replace`を利用した前述のコマンドを実行します。 ``` podman pull example/image:tag ``` ## 参考情報 - https://docs.podman.io/en/latest/markdown/podman-kube-play.1.html#replace - https://github.com/containers/podman/issues/4880 - https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting