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

hold startup until ConfigMaps are ready or die #1172

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

ReToCode
Copy link
Member

@ReToCode ReToCode commented Dec 12, 2023

Changes

  • Follow-up for Determine internal-encryption via KIngress  #959 (comment)
  • Wait with startupTranslation until Configmaps are found and valid or die
  • Later changes to the configmaps are handled through the configmap.Watcher
  • If configmaps are not present within 60 seconds, the pod will restart with:

2023/12/12 14:31:07 Timed out waiting for configuration in ConfigMaps: failed to fetch kourier config: configmaps "config-kourier" not found
Exiting.

Fixes #968

/assign @skonto

@knative-prow knative-prow bot requested review from KauzClay and skonto December 12, 2023 13:43
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3a688ad) 81.12% compared to head (24f5d7f) 81.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1172      +/-   ##
==========================================
- Coverage   81.12%   81.04%   -0.08%     
==========================================
  Files          18       18              
  Lines        1462     1456       -6     
==========================================
- Hits         1186     1180       -6     
  Misses        219      219              
  Partials       57       57              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ReToCode
Copy link
Member Author

/retest

func ensureCtxWithConfigOrDie(ctx context.Context) context.Context {
var err error
var cfg *store.Config
if pollErr := wait.PollUntilContextTimeout(ctx, time.Second, 60*time.Second, true, func(context.Context) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to make the timeout configurable just in case someone has a slow env?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm I don't think thats necessary. It is only until all yamls are applied when installing (from kubectl or operator). I don't think that should ever be longer than 60 seconds, and if so, it would just restart the pod and you have another 60s.

Copy link
Contributor

@skonto skonto Dec 13, 2023

Choose a reason for hiding this comment

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

I don't know about what value is good enough tbh, 1m might be enough.
Restarting is an option but probably you don't want people to have to do that in case they have a big slow cluster (api server under pressure), just in case.
I mean that if they know they have a slow cluster they can configure it high enough (eg. via env var) and forget about it, otherwise they will have to monitor it and restart it.
Thinking out loud here.

@skonto
Copy link
Contributor

skonto commented Dec 13, 2023

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2023
Copy link

knative-prow bot commented Dec 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ReToCode, skonto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot merged commit b4f9f7a into knative-extensions:main Dec 13, 2023
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not use FromContextOrDefaults() in translateIngress()
2 participants