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

karmada-operator: add init workflow #3102

Merged

Conversation

calvin0327
Copy link

@calvin0327 calvin0327 commented Feb 2, 2023

Signed-off-by: calvin [email protected]

What type of PR is this?
/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:
Part of Fixes #2979

Special notes for your reviewer:
Used workflow to install karmada. We divided the whole installation process into:
PrepareCrds => GenerateCert=> CreateNamespace => UploadKubeconfig => UploadCerts
=> Install Etcd => Apiserver => apply crds => install Component => install module => WaitControlPlane

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 2, 2023
@karmada-bot karmada-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 2, 2023
@calvin0327
Copy link
Author

@lonelyCZ @carlory Do you have any comments on this approach? If there is no comment, I will continue.

go.mod Outdated Show resolved Hide resolved
@RainbowMango
Copy link
Member

Hi @calvin0327 I can't figure out the process now. According to #2979, seems all tasks are now in WIP state.

@calvin0327
Copy link
Author

Hi @calvin0327 I can't figure out the process now. According to #2979, seems all tasks are now in WIP state.

I have discussed with @carlory, and we will install karmada using the latest design, if the community thinks it is ok,
then we will close the previous pr: #2990

@lonelyCZ
Copy link
Member

lonelyCZ commented Feb 3, 2023

The process is same as karmadactl init, I think it is ok for the first version of operator.

@calvin0327
Copy link
Author

😄,we will go on.

@calvin0327 calvin0327 force-pushed the add-operator-init-workflow branch 11 times, most recently from 7c2206d to 52e72d6 Compare February 10, 2023 10:40
@calvin0327 calvin0327 force-pushed the add-operator-init-workflow branch 6 times, most recently from 1adf130 to 854a6cb Compare February 14, 2023 10:27
@calvin0327
Copy link
Author

calvin0327 commented Feb 14, 2023

Here are the test result:

  • deploy a karmada operator:

first, we need create secret of install cluster kubeconfig used by karmada operator, and create karmada operator deployment:

kubectl create secret generic my-kubeconfig --from-file=/Users/chenwen/.kube/config -n karmada-system
kubectl apply -f operator/config/deploy/karmada-operator.yaml

image

  • create karmada cr:
kubectl apply -f operator/config/samples/karmada.yaml
apiVersion: operator.karmada.io/v1alpha1
kind: Karmada
metadata:
  namespace: test
  name: karmada-demo
  • Observe the result:

image

@RainbowMango
Copy link
Member

No worries, please tell us how to run it.

@calvin0327
Copy link
Author

calvin0327 commented Feb 23, 2023

#3102 (comment)

There are demo steps above, I would like to explain if there is anything unclear here.

Copy link
Member

@lonelyCZ lonelyCZ left a comment

Choose a reason for hiding this comment

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

I just tested it in my env that worked fine. It was cool!!

[root@master67 config]# kubectl get pod -A
NAMESPACE        NAME                                                    READY   STATUS    RESTARTS   AGE
karmada-system   karmada-demo-aggregated-apiserver-575df97794-lsk75      1/1     Running   2          47m
karmada-system   karmada-demo-apiserver-6d8fbf4766-z68k9                 1/1     Running   0          47m
karmada-system   karmada-demo-controller-manager-5b86f67954-8t974        1/1     Running   0          47m
karmada-system   karmada-demo-etcd-0                                     1/1     Running   0          47m
karmada-system   karmada-demo-kube-controller-manager-747b44bff6-k4dl5   1/1     Running   0          47m
karmada-system   karmada-demo-scheduler-c8fd7f499-t5nt2                  1/1     Running   0          47m
karmada-system   karmada-demo-webhook-d8c5bb46d-kxkb2                    1/1     Running   0          47m
karmada-system   karmada-operator-845d586cd7-dbks7                       1/1     Running   0          57m

There are some suggestions for the moment, I will continue to review it.

operator/pkg/util/apiclient/idempotency.go Show resolved Hide resolved
operator/pkg/util/apiclient/idempotency.go Outdated Show resolved Hide resolved
operator/pkg/controlplane/apiserver/apiserver.go Outdated Show resolved Hide resolved
operator/pkg/controlplane/apiserver/mainfests.go Outdated Show resolved Hide resolved
@calvin0327 calvin0327 force-pushed the add-operator-init-workflow branch 2 times, most recently from bf7be2c to 325373a Compare February 24, 2023 05:21
operator/pkg/controller/karmada/planner.go Outdated Show resolved Hide resolved
operator/pkg/tasks/init/apiserver.go Outdated Show resolved Hide resolved
operator/pkg/tasks/init/component.go Show resolved Hide resolved
Copy link
Member

@Poor12 Poor12 left a comment

Choose a reason for hiding this comment

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

Some suggestions.

operator/pkg/controller/karmada/planner.go Outdated Show resolved Hide resolved
operator/pkg/init.go Show resolved Hide resolved
operator/pkg/tasks/init/crd.go Show resolved Hide resolved
operator/pkg/tasks/init/cert.go Outdated Show resolved Hide resolved
operator/pkg/tasks/init/upload.go Show resolved Hide resolved
operator/pkg/tasks/init/karmadaresource.go Outdated Show resolved Hide resolved
operator/pkg/tasks/init/component.go Outdated Show resolved Hide resolved
operator/pkg/controlplane/controlplane.go Show resolved Hide resolved
operator/pkg/controlplane/controlplane.go Outdated Show resolved Hide resolved
operator/pkg/controlplane/controlplane.go Outdated Show resolved Hide resolved
@calvin0327 calvin0327 force-pushed the add-operator-init-workflow branch 5 times, most recently from 74bb49d to 85671b8 Compare February 28, 2023 06:26
@calvin0327
Copy link
Author

@Poor12 @lonelyCZ any other comments here?

@Poor12
Copy link
Member

Poor12 commented Feb 28, 2023

/assign
I will test and review ASAP.

operator/config/samples/karmada.yaml Outdated Show resolved Hide resolved
operator/pkg/constants/constants.go Show resolved Hide resolved
operator/pkg/certs/certs.go Show resolved Hide resolved
@lonelyCZ
Copy link
Member

lonelyCZ commented Mar 2, 2023

LGTM, it has achieved a basic init worklow, we can optimize it in the feature.

cc @RainbowMango @Poor12

@Poor12
Copy link
Member

Poor12 commented Mar 2, 2023

/lgtm
It's time to move forward. Thanks @calvin0327 @lonelyCZ

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2023
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2023
@karmada-bot karmada-bot merged commit 17533ac into karmada-io:master Mar 4, 2023
@RainbowMango RainbowMango added this to the v1.6 milestone Jun 27, 2023
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Umbrella] Karmada Operator Plan (First Version)
6 participants