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

container apps - support for additional settings in container apps probes #27551

Conversation

SpartakusMd
Copy link
Contributor

@SpartakusMd SpartakusMd commented Oct 2, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

The available settings for the configuration of the liveness, readiness and startup probes in Azure Container Apps are lacking a few details.

FYI, There are some defaults for existing probe settings which are different between Azure and Terraform, I left them intact.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

This is a (please select all that apply):

  • Enhancement

Related Issue(s)

Fixes #25457, fixes #24845

Type: pluginsdk.TypeInt,
Optional: true,
Default: 1,
ValidateFunc: validation.IntBetween(1, 1),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be set to anything other than 1?

Type: pluginsdk.TypeInt,
Optional: true,
Default: 1,
ValidateFunc: validation.IntBetween(1, 1),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise here, is there a point in exposing this if it's default is 1 and can only be set to 1 anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it should be exactly 1. I added it as it's present in UI an in ContainerAppReadinessProbeSchema. Should I remove it?
image

Copy link
Member

@stephybun stephybun Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please remove this then (from the Computed schemas as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed where I added it. But kept it in ContainerAppReadinessProbeSchema to not create a breaking change

@SpartakusMd SpartakusMd force-pushed the feature/Support-for-additional-settings-in-container-apps-probes branch from ce30625 to c8002c0 Compare October 24, 2024 10:14
@SpartakusMd SpartakusMd requested review from katbyte and a team as code owners October 24, 2024 10:14
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SpartakusMd, I've kicked off the tests. Would you mind updating the documentation with these changes as well?

@SpartakusMd
Copy link
Contributor Author

@stephybun I have added the docs. Is there anything else?

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good, thanks @SpartakusMd LGTM 👍

@stephybun stephybun merged commit b0ddd5f into hashicorp:main Oct 24, 2024
33 checks passed
@github-actions github-actions bot added this to the v4.7.0 milestone Oct 24, 2024
stephybun added a commit that referenced this pull request Oct 24, 2024
@SpartakusMd
Copy link
Contributor Author

Thank you @stephybun for the time spent!

InitialDelaySeconds: pointer.To(input.InitialDelay),
PeriodSeconds: pointer.To(input.Interval),
TimeoutSeconds: pointer.To(input.Timeout),
FailureThreshold: pointer.To(input.FailureThreshold),
Copy link

@Dmitriyx Dmitriyx Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come there is no success threshold property here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a container app that is failing because I can not set a success_count_threshold to it, it will assign it an empty value.
Since I have a container app that is a public container that accepts ingress, Azure does a health check of the service using startup probe.
Since I can not configure it via terraform, my container always fails until I manually configure it on the UI to have a success threshold count to be 1, which then works fine

Copy link

@Dmitriyx Dmitriyx Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to the issue you are responding too: #25457
startup_probe should also have a success threshold.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added initialy, but removed later in the same PR due to review in c8002c0

It was removed due to the fact that only a single value is accepted and that is 1. You cannot set the value to anything else. I also use this code for our infra and it's working as expected.

The question would be how it worked until now as the option wasn't present there? If it's really needed, I guess you could create a PR with the changes from that commit to add the success threshold property and see if it's merged.

image

Copy link

@Dmitriyx Dmitriyx Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for a quick response, just tested it again and I do not get the same result - somehow success count threshold is not defaulted to 1. Any ideas on what can be done?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could create a new PR with changes from c8002c0 and put the screenshot as an explanation. Are you sure it fails due to the value being empty?

Copy link

@Dmitriyx Dmitriyx Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I am sure - because once I edit the container config on the UI, once I add a success threshold, then the container lives, otherwise it just dies and keeps restarting.

Copy link

@Dmitriyx Dmitriyx Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted to make a PR however I get denied
remote: Permission to hashicorp/terraform-provider-azurerm.git denied to Dmitriyx

I will check what the rules are for making a PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to fork the repo and make changes in the forked repository. Afterwards you can create a PR in Github.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants