-
Notifications
You must be signed in to change notification settings - Fork 902
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
fix controller can't restart in helm for dependent secret not found #5305
Conversation
/cc @XiShanYongYe-Chang please help a review |
@chaosi-zju: GitHub didn't allow me to request PR reviews from the following users: please, a, review. Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5305 +/- ##
==========================================
- Coverage 31.06% 30.82% -0.24%
==========================================
Files 639 640 +1
Lines 44343 44414 +71
==========================================
- Hits 13774 13691 -83
- Misses 29573 29744 +171
+ Partials 996 979 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @chaosi-zju, this char lint has failed. |
267c42f
to
1661e5a
Compare
/retest |
Ask @calvin0327 @zhzhuang-zju to help take a review~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM
e678b33
to
ae57f84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I just realized it's a mistake for initcontainer holds the secret of the host cluster.
- I feels a little bit tricky to have a configmap to represent Karmada version, but I don't have a better idea.
Given this patch is an improvement, we can move forward even it is not the idea solution.
This is much better than the solution in #5150. Thanks.
Signed-off-by: chaosi-zju <[email protected]>
@RainbowMango comments fixed. Besides, I have another tangled thing: after this PR merged, you can see now kubectl delete job {{ $name }}-static-resource -n {{ $namespace }} Actually, we can directly set that job However, I am worried that after deleting the file |
Why can't get this file back? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix controller can't restart in helm for dependent secret not found.
In helm installation method, when installing
karmada-controller-manager
, we use ainitContainer
to wait for the ready status ofkarmada-apiserver
, which prevents thekarmada-controller-manager
fromCrashLoopBack
. This feature is introduced in #5010.In order to access host cluster kube-apiserver in
initContainer
, we mounted aservice-account-token
typeSecret
, because the deployment ofkarmada-controller-manager
is definedautomountServiceAccountToken: false
. UnsetautomountServiceAccountToken
is introduced in #2523.However, in #5010, we deleted the
Secret
mentioned above when we finished installation. Actually, we still need this secret after installation finished, otherwisekarmada-controller-manager
can't restart for lack of the mounted secret.Which issue(s) this PR fixes:
Fixes #5233
Special notes for your reviewer:
target installation order in helm after the PR:
etcd
karmada-apiserver
(it has a init-container, it keeps checking etcd connectivity with thecurl
command, waiting for etcd to be ready)Job/karmada-static-resource
, which is used to deploy static resources such as crd (it usekubectl rollout status
command to wait for karmada-apiserver readay), when finished, it writes a configmap to karmada-apiserver.kubectl get
command to wait for above configmap exist, which meansjob/karmada-static-resource
has finished applying current version crds to apiserver)Does this PR introduce a user-facing change?: