terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

Heathcheck in every container start

Open mikekuzak opened this issue 3 years ago • 3 comments

Provider: v2.10.0

Hi,

I'm facing the following problem:

Container is being deployed with a health check:

module.docker_rancher.docker_image.image: Creating...
**module.docker_rancher.docker_image.image: Still creating... [10s elapsed]
module.docker_rancher.docker_image.image: Still creating... [20s elapsed]
module.docker_rancher.docker_image.image: Still creating... [30s elapsed]
module.docker_rancher.docker_image.image: Still creating... [40s elapsed]**
module.docker_rancher.docker_image.image: Creation complete after 48s [id=sha256:e02481bb39c88f0352ed7ae1998f2860a4816a8d5c3ba3b397b972849f657e2erancher/rancher:v2.5.4]
module.docker_rancher.docker_container.container: Creating...
module.docker_rancher.docker_container.container: Creation complete after 2s [id=5bb3b502650385aac7906dced9bcabad1853e8dead29a926f2c6f5d74b45e968]
rancher2_bootstrap.admin: Creating...
rancher2_bootstrap.admin: Still creating... [10s elapsed]
rancher2_bootstrap.admin: Still creating... [20s elapsed]
rancher2_bootstrap.admin: Still creating... [30s elapsed]
rancher2_bootstrap.admin: Still creating... [40s elapsed]
rancher2_bootstrap.admin: Still creating... [50s elapsed]
rancher2_bootstrap.admin: Still creating... [1m0s elapsed]
rancher2_bootstrap.admin: Still creating... [1m10s elapsed]
rancher2_bootstrap.admin: Still creating... [1m20s elapsed]
rancher2_bootstrap.admin: Still creating... [1m30s elapsed]
rancher2_bootstrap.admin: Creation complete after 1m35s [id=user-j8hk7]
module.k8s_cluster.rancher2_cluster.cluster-rke: Creating...

now this is all good and nice but if I upgrade the version of the container (v2.5.5) in terraform and rerun it again it doesn't do the health check anymore immediately shows

[id=sha256:a02481bb39c88f0352ed7ae1998f2860a4816a8d5c3ba3b345349f657e2erancher/rancher:v2.5.5]
module.docker_rancher.docker_container.container: Creation complete after 1s  

... API Endpoint unavailable ... 

It doesn't run the health check which is calling this command:

["CMD", "curl", "-sk", "https://localhost/ping"]

This means after the upgrade of the container to a new version the API endpoint is not available yet as it might take > 1min to startup and migrate the version files. The consequence is the terraform script fails. How do I get around this if the check can only run once according to the docu:

" ... is a block within the configuration that can be repeated only once to specify the extra healthcheck configuration for the container."

mikekuzak avatar Jan 20 '21 22:01 mikekuzak

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar Mar 29 '21 10:03 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. If you don't want this issue to be closed, please set the label pinned.

github-actions[bot] avatar Jun 06 '21 10:06 github-actions[bot]

Hi @mikekuzak can you provide a terraform config to reproduce the issue? Thanks :)

mavogel avatar Jun 23 '21 09:06 mavogel