-
Notifications
You must be signed in to change notification settings - Fork 914
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
operator: update operator crd when upgrading chart #4693
operator: update operator crd when upgrading chart #4693
Conversation
Signed-off-by: calvin <wen.chen@daocloud.io>
@chaosi-zju @RainbowMango PTAL, thanks |
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 #4693 +/- ##
==========================================
- Coverage 51.41% 51.41% -0.01%
==========================================
Files 250 250
Lines 24979 24979
==========================================
- Hits 12843 12842 -1
- Misses 11430 11431 +1
Partials 706 706
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/assign @chaosi-zju I wonder if the CRDs can be installed at the first installation? |
I didn't get what does The problem seems to be ---update--- Notes: the |
Hi @calvin0327, let me try to describe my understanding of your PR. Before this PR introduced, if I want to install karmada by operator, I should do following steps: helm install karmada-operator -n karmada-system --create-namespace --dependency-update ./charts/karmada-operator
kubectl apply -f ./charts/karmada-operator/crds/
cat >/tmp/karmada.yaml<<EOF
apiVersion: operator.karmada.io/v1alpha1
kind: Karmada
metadata:
name: karmada
namespace: karmada-system
EOF
kubectl apply -f karmada.yaml After you this PR introduced, I can omit the second step ( |
@chaosi-zju The reason for this pr is because helm does not apply crd resources when upgrading. If the karmada crd resource is updated, we need to update it manually. So we need to use job in helm to do this, so that we can solve the problem that helm does not update crd. this is reference: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations |
yes, helm will install crds at first installation. |
@chaosi-zju any questions? |
/lgtm |
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.
/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 feature
What this PR does / why we need it:
the crd will not be updated when upgrading karmada operator chart.
so, we can support a way, run a job to apply crd resource after installing operator deployment.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
and i have test for this:
$ helm install karmada-operator -n karmada-system --create-namespace ./charts/karmada-operator --dependency-update WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /Users/chenwen/.kube/config WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /Users/chenwen/.kube/config NAME: karmada-operator LAST DEPLOYED: Mon Mar 11 15:44:35 2024 NAMESPACE: karmada-system STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Thank you for installing karmada-operator. Your release is named karmada-operator. To learn more about the release, try: $ helm status karmada-operator -n karmada-system $ helm get all karmada-operator -n karmada-system --- $ kubectl get po -n karmada-system -w NAME READY STATUS RESTARTS AGE karmada-operator-b7cf7f467-rwc9h 0/1 Pending 0 0s karmada-operator-b7cf7f467-rwc9h 0/1 Pending 0 0s karmada-operator-b7cf7f467-rwc9h 0/1 ContainerCreating 0 0s karmada-operator-post-hook-install-crds-2vkn9 0/1 Pending 0 0s karmada-operator-post-hook-install-crds-2vkn9 0/1 Pending 0 0s karmada-operator-post-hook-install-crds-2vkn9 0/1 ContainerCreating 0 0s karmada-operator-b7cf7f467-rwc9h 1/1 Running 0 2s karmada-operator-post-hook-install-crds-2vkn9 1/1 Running 0 1s karmada-operator-post-hook-install-crds-2vkn9 0/1 Completed 0 2s karmada-operator-post-hook-install-crds-2vkn9 0/1 Completed 0 3s karmada-operator-post-hook-install-crds-2vkn9 0/1 Completed 0 4s karmada-operator-post-hook-install-crds-2vkn9 0/1 Completed 0 4s karmada-operator-post-hook-install-crds-2vkn9 0/1 Terminating 0 4s karmada-operator-post-hook-install-crds-2vkn9 0/1 Terminating 0 4s
Does this PR introduce a user-facing change?: