Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startup and liveness probe field for Cloud Run service resource #12532

Closed
yanweiguo opened this issue Sep 9, 2022 · 11 comments
Closed

Add startup and liveness probe field for Cloud Run service resource #12532

yanweiguo opened this issue Sep 9, 2022 · 11 comments
Assignees
Milestone

Comments

@yanweiguo
Copy link
Contributor

yanweiguo commented Sep 9, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Adds new fields startup_probe and liveness_probe to google cloud run service resource.

New or Affected Resource(s)

  • google_cloud_run_service

Potential Terraform Configuration

resource "google_cloud_run_service" "service" {
  name     = "my-service"
  location = "us-central1"
  metadata {
    annotations = {
      "run.googleapis.com/launch-stage" = "BETA"
    }
  }

  template {
    spec {
      containers {
        image = "us-docker.pkg.dev/cloudrun/container/hello"
        startup_probe {
          initial_delay_seconds = 0
          timeout_seconds = 1
          period_seconds = 3
          failure_threshold = 1
          tcpSocket {
            port = 8080
          }
        }
      }
    }
  }

  traffic {
    percent         = 100
    latest_revision = true
  }
}

References

@marcusricardoaguiar
Copy link

It would also be good to include the liveness_probe. :)

@yanweiguo yanweiguo changed the title Add startup probe field for Cloud Run service resource Add startup and liveness probe field for Cloud Run service resource Sep 27, 2022
@yanweiguo
Copy link
Contributor Author

It would also be good to include the liveness_probe. :)

Changed the title :)

@darkangel01111991
Copy link

Would love to get this.

Have you found any workaround to setup a startup/liveness probe while avoiding the misalignment between terraform state and the current infra?

Any short term solution would be much appreciated! Thanks a lot!

@Thomasdezeeuw
Copy link

Not sure if this is the correct place to report bugs or if I should open a new issue instead. I noticed that startup_probe is not removed (properly) once added. Steps to reproduces:

  1. Create a Cloud Run service with startup_probe (plan & apply).
  2. Remove the startup_probe config.
  3. Run terraform apply and you'll notice that it doesn't actually remove the startup_probe related configuration.

@yanweiguo
Copy link
Contributor Author

Not sure if this is the correct place to report bugs or if I should open a new issue instead. I noticed that startup_probe is not removed (properly) once added. Steps to reproduces:

  1. Create a Cloud Run service with startup_probe (plan & apply).
  2. Remove the startup_probe config.
  3. Run terraform apply and you'll notice that it doesn't actually remove the startup_probe related configuration.

It's intended behavior as the result of that this field is optional and it has a default value. You can't actually get rid of startup probe.

Before Cloud Run supports a customized startup probe, it always applies a TCP health check for a Cloud Run service deployment although it is not reflected in the API. Cloud Run will capture this default TCP startup probe in the API soon.

@Thomasdezeeuw
Copy link

It's intended behavior as the result of that this field is optional and it has a default value. You can't actually get rid of startup probe.

Before Cloud Run supports a customized startup probe, it always applies a TCP health check for a Cloud Run service deployment although it is not reflected in the API. Cloud Run will capture this default TCP startup probe in the API soon.

I didn't know about this. Is this something worth calling out explicitly in the documentation? I found it a rather annoying gotcha when debugging a startup probe issue.

@EricStG
Copy link

EricStG commented Dec 12, 2022

Probes are now GA (According to https://cloud.google.com/run/docs/release-notes)
Does that make it safe to remove the beta annotations?

@yanweiguo
Copy link
Contributor Author

Probes are now GA (According to https://cloud.google.com/run/docs/release-notes) Does that make it safe to remove the beta annotations?

Yes. Beta launch stage annotation is no longer required.

@cagataygurturk
Copy link
Contributor

This issue should be closed maybe? I have opened #13310 to move the feature to stable provider though.

@yanweiguo
Copy link
Contributor Author

This issue should be closed maybe? I have opened #13310 to move the feature to stable provider though.

Thanks for opening that one.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants