karmada icon indicating copy to clipboard operation
karmada copied to clipboard

introduce karmada-apiserver-advertise-address

Open wuyingjun-lucky opened this issue 2 years ago • 5 comments

Signed-off-by: wuyingjun [email protected]

What type of PR is this? /kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes https://github.com/karmada-io/karmada/issues/2537

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmadactl`: Introduced `--karmada-apiserver-advertise-address` flag to specify Karmada APIserver's address to the `init` sub-command.

wuyingjun-lucky avatar Sep 20 '22 08:09 wuyingjun-lucky

/cc @lonelyCZ @prodanlabs

wuyingjun-lucky avatar Sep 20 '22 08:09 wuyingjun-lucky

We might need a release note, thanks @wuyingjun-lucky

RainbowMango avatar Sep 20 '22 12:09 RainbowMango

We might need a release note, thanks @wuyingjun-lucky

done

wuyingjun-lucky avatar Sep 20 '22 13:09 wuyingjun-lucky

updated

env

 kubectl get nodes -o wide
NAME             STATUS   ROLES                  AGE     VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE         KERNEL-VERSION     CONTAINER-RUNTIME
docker-desktop   Ready    control-plane,master   3d21h   v1.22.5   192.168.65.4   <none>        Docker Desktop   5.10.76-linuxkit   docker://20.10.12

result

sudo ./kubectl-karmada init --kube-image-mirror-country=cn --karmada-apiserver-advertise-address=127.0.0.1 --etcd-data=/var/lib/karmada-etcd1 --crds=/Users/wuyingjun/crds.tar.gz
I0923 14:57:13.123267   66741 deploy.go:153] kubeconfig file: /Users/wuyingjun/.kube/config, kubernetes: https://kubernetes.docker.internal:6443
I0923 14:57:13.148289   66741 deploy.go:173] karmada apiserver ip: [127.0.0.1]
I0923 14:57:13.989338   66741 cert.go:229] Generate ca certificate success.
I0923 14:57:14.051814   66741 cert.go:229] Generate karmada certificate success.
I0923 14:57:14.304067   66741 cert.go:229] Generate apiserver certificate success.
I0923 14:57:14.465319   66741 cert.go:229] Generate front-proxy-ca certificate success.
I0923 14:57:14.574830   66741 cert.go:229] Generate front-proxy-client certificate success.
I0923 14:57:14.680122   66741 cert.go:229] Generate etcd-ca certificate success.
I0923 14:57:14.768281   66741 cert.go:229] Generate etcd-server certificate success.
I0923 14:57:14.957544   66741 cert.go:229] Generate etcd-client certificate success.
I0923 14:57:14.957861   66741 deploy.go:268] local crds file name: /Users/wuyingjun/crds.tar.gz
I0923 14:57:14.969462   66741 deploy.go:505] Create karmada kubeconfig success.
I0923 14:57:14.983223   66741 namespace.go:36] Create Namespace 'karmada-system' successfully.
I0923 14:57:15.033027   66741 rbac.go:60] CreateClusterRole karmada-controller-manager success.
I0923 14:57:15.075318   66741 rbac.go:81] CreateClusterRoleBinding karmada-controller-manager success.
I0923 14:57:15.132170   66741 secret.go:78] secret kubeconfig Create successfully.
I0923 14:57:15.379018   66741 secret.go:78] secret etcd-cert Create successfully.
I0923 14:57:15.779851   66741 secret.go:78] secret karmada-cert Create successfully.
I0923 14:57:16.177862   66741 secret.go:78] secret karmada-webhook-cert Create successfully.
I0923 14:57:16.580951   66741 services.go:66] service etcd create successfully.
I0923 14:57:16.581360   66741 deploy.go:324] create etcd StatefulSets
I0923 14:57:16.775827   66741 check.go:98] etcd desired replicaset is 1, currently: 1
I0923 14:57:19.788274   66741 check.go:49] pod: etcd-0 is ready. status: Running
I0923 14:57:19.788296   66741 deploy.go:335] create karmada ApiServer Deployment
I0923 14:57:19.801617   66741 services.go:66] service karmada-apiserver create successfully.
W0923 14:57:22.835020   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:23.840753   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:24.841396   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:25.842002   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:26.841253   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:27.841596   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:28.841688   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:29.840889   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:30.841428   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:31.840479   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:32.841217   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:33.841858   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:34.842269   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:35.841750   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:36.842168   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:37.842660   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:38.841482   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:39.841468   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:40.841957   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:41.843696   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:42.841800   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:43.841647   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:44.840843   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:45.842554   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:46.843406   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:47.842706   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:48.840756   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
W0923 14:57:49.841208   66741 check.go:52] pod: karmada-apiserver-7cb58cf678-r62n7 not ready. status: Running
I0923 14:57:50.841614   66741 check.go:49] pod: karmada-apiserver-7cb58cf678-r62n7 is ready. status: Running
I0923 14:57:50.841649   66741 deploy.go:348] create karmada aggregated apiserver Deployment
I0923 14:57:50.856318   66741 services.go:66] service karmada-aggregated-apiserver create successfully.
I0923 14:57:53.901206   66741 check.go:49] pod: karmada-aggregated-apiserver-6b7f866dd6-jflsl is ready. status: Running
I0923 14:57:53.980452   66741 deploy.go:66] Initialize karmada bases crd resource `/etc/karmada/crds/bases`
I0923 14:57:54.493531   66741 deploy.go:77] Initialize karmada patches crd resource `/etc/karmada/crds/patches`
I0923 14:57:54.806612   66741 deploy.go:89] Create MutatingWebhookConfiguration mutating-config.
I0923 14:57:54.813402   66741 deploy.go:93] Create ValidatingWebhookConfiguration validating-config.
I0923 14:57:54.833047   66741 deploy.go:308] Create APIService 'v1alpha1.cluster.karmada.io'
I0923 14:57:54.844704   66741 check.go:26] Waiting for APIService(v1alpha1.cluster.karmada.io) condition(Available), will try
I0923 14:57:55.855868   66741 rbac.go:60] CreateClusterRole cluster-proxy-admin success.
I0923 14:57:55.863043   66741 rbac.go:81] CreateClusterRoleBinding cluster-proxy-admin success.
I0923 14:57:55.878968   66741 configmap.go:25] ConfigMap kube-public/cluster-info has been created or updated.
I0923 14:57:55.885031   66741 rbac.go:102] Role kube-publickarmada:bootstrap-signer-clusterinfo has been created or updated.
I0923 14:57:55.889953   66741 rbac.go:118] RoleBinding kube-public/karmada:bootstrap-signer-clusterinfo has been created or updated.
I0923 14:57:55.901649   66741 rbac.go:60] CreateClusterRole system:karmada:agent success.
I0923 14:57:55.911165   66741 rbac.go:81] CreateClusterRoleBinding system:karmada:agent success.
I0923 14:57:55.911414   66741 tlsbootstrap.go:32] [bootstrap-token] configured RBAC rules to allow Karmada Agent Bootstrap tokens to post CSRs in order for agent to get long term certificate credentials
I0923 14:57:56.255567   66741 rbac.go:81] CreateClusterRoleBinding karmada:agent-bootstrap success.
I0923 14:57:56.255585   66741 tlsbootstrap.go:46] [bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Karmada Agent Bootstrap Token
I0923 14:57:56.655161   66741 rbac.go:81] CreateClusterRoleBinding karmada:agent-autoapprove-bootstrap success.
I0923 14:57:56.655178   66741 tlsbootstrap.go:60] [bootstrap-token] configured RBAC rules to allow certificate rotation for all agent client certificates in the member cluster
I0923 14:57:57.060364   66741 rbac.go:81] CreateClusterRoleBinding karmada:agent-autoapprove-certificate-rotation success.
I0923 14:57:57.061021   66741 deploy.go:123] Initialize karmada bootstrap token
I0923 14:57:57.071297   66741 deploy.go:368] create karmada kube controller manager Deployment
I0923 14:57:57.085391   66741 services.go:66] service kube-controller-manager create successfully.
I0923 14:58:00.099260   66741 check.go:49] pod: kube-controller-manager-7d47ffb4cd-l5v76 is ready. status: Running
I0923 14:58:00.099279   66741 deploy.go:381] create karmada scheduler Deployment
I0923 14:58:03.117539   66741 check.go:49] pod: karmada-scheduler-6c67b87459-kkc5f is ready. status: Running
I0923 14:58:03.117562   66741 deploy.go:391] create karmada controller manager Deployment
I0923 14:58:06.134042   66741 check.go:49] pod: karmada-controller-manager-7f7b6445db-rnkkz is ready. status: Running
I0923 14:58:06.134070   66741 deploy.go:401] create karmada webhook Deployment
I0923 14:58:06.164152   66741 services.go:66] service karmada-webhook create successfully.
I0923 14:58:09.186970   66741 check.go:49] pod: karmada-webhook-5875d65865-s5csn is ready. status: Running

------------------------------------------------------------------------------------------------------
 █████   ████   █████████   ███████████   ██████   ██████   █████████   ██████████     █████████
░░███   ███░   ███░░░░░███ ░░███░░░░░███ ░░██████ ██████   ███░░░░░███ ░░███░░░░███   ███░░░░░███
 ░███  ███    ░███    ░███  ░███    ░███  ░███░█████░███  ░███    ░███  ░███   ░░███ ░███    ░███
 ░███████     ░███████████  ░██████████   ░███░░███ ░███  ░███████████  ░███    ░███ ░███████████
 ░███░░███    ░███░░░░░███  ░███░░░░░███  ░███ ░░░  ░███  ░███░░░░░███  ░███    ░███ ░███░░░░░███
 ░███ ░░███   ░███    ░███  ░███    ░███  ░███      ░███  ░███    ░███  ░███    ███  ░███    ░███
 █████ ░░████ █████   █████ █████   █████ █████     █████ █████   █████ ██████████   █████   █████
░░░░░   ░░░░ ░░░░░   ░░░░░ ░░░░░   ░░░░░ ░░░░░     ░░░░░ ░░░░░   ░░░░░ ░░░░░░░░░░   ░░░░░   ░░░░░
------------------------------------------------------------------------------------------------------
Karmada is installed successfully.

Register Kubernetes cluster to Karmada control plane.

Register cluster with 'Push' mode

Step 1: Use "kubectl karmada join" command to register the cluster to Karmada control plane. --cluster-kubeconfig is kubeconfig of the member cluster.
(In karmada)~# MEMBER_CLUSTER_NAME=$(cat ~/.kube/config  | grep current-context | sed 's/: /\n/g'| sed '1d')
(In karmada)~# kubectl karmada --kubeconfig /etc/karmada/karmada-apiserver.config  join ${MEMBER_CLUSTER_NAME} --cluster-kubeconfig=$HOME/.kube/config

Step 2: Show members of karmada
(In karmada)~# kubectl  --kubeconfig /etc/karmada/karmada-apiserver.config get clusters


Register cluster with 'Pull' mode

Step 1: Use "kubectl karmada register" command to register the cluster to Karmada control plane. "--cluster-name" is set to cluster of current-context by default.
(In member cluster)~# kubectl karmada register 127.0.0.1:32443 --token cf9paf.sz8bg7a9pk4taubz --discovery-token-ca-cert-hash sha256:56dc1d01140318ba42474a3c7fff8f5209db1df7ad9e6b0e13e4d8f628f80245

Step 2: Show members of karmada
(In karmada)~# kubectl  --kubeconfig /etc/karmada/karmada-apiserver.config get clusters

wuyingjun-lucky avatar Sep 23 '22 07:09 wuyingjun-lucky

@lonelyCZ @carlory Has any progress ?

wuyingjun-lucky avatar Sep 29 '22 01:09 wuyingjun-lucky

/approve Let's do it.

RainbowMango avatar Sep 29 '22 01:09 RainbowMango

[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 avatar Sep 29 '22 01:09 karmada-bot