You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we deploy new images not via terraform but using kubectl:
kubectl -n $APP_NAME set image deployments/api *=$api_image_tag && \
kubectl -n $APP_NAME rollout status -w deployments/api
When we do this the next time we run terraform plan or apply it tries to reset image to the one from terraform config. It's possible to ignore by adding lifecycle block for kubernetes_deployment resource:
lifecycle {
# we change image name during deployment outside of terraform
ignore_changes = [
spec[0].template[0].spec[0].container[0].image,
spec[0].template[0].spec[0].init_container[0].image,
spec[0].template[0].metadata[0].annotations["kubectl.kubernetes.io/restartedAt"]
]
}
If we do it right now it will no longer be possible to update image via terraform config and some app deploy via terraform.
It's not currently possible to make lifecycle dynamic in any way. Here's the issue about the problem: hashicorp/terraform#24188
The text was updated successfully, but these errors were encountered:
Sometimes we deploy new images not via terraform but using
kubectl
:When we do this the next time we run terraform plan or apply it tries to reset image to the one from terraform config. It's possible to ignore by adding lifecycle block for kubernetes_deployment resource:
If we do it right now it will no longer be possible to update image via terraform config and some app deploy via terraform.
It's not currently possible to make
lifecycle
dynamic in any way. Here's the issue about the problem: hashicorp/terraform#24188The text was updated successfully, but these errors were encountered: