Commit Graph

68 Commits

Author SHA1 Message Date
Jian Zhu
c4d3d9e90a add e2e for deleting klusterlet when the managed cluster was destroyed (#339)
Signed-off-by: zhujian <jiazhu@redhat.com>
2023-03-31 04:41:18 -04:00
Jian Qiu
d14214ee0b Remove addon enable field (#338)
Use feature gate instead

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2023-03-30 23:47:02 -04:00
Jian Zhu
1b463dde17 check managed cluster connectivity when deleting klusterlet (#337)
* check managed cluster connectivity when deleting klusterlet

Signed-off-by: zhujian <jiazhu@redhat.com>

* check managed cluster connectivity just after building the clients

Signed-off-by: zhujian <jiazhu@redhat.com>

---------

Signed-off-by: zhujian <jiazhu@redhat.com>
2023-03-30 05:27:46 -04:00
DangPeng Liu
547fc1482e fix Implicit memory aliasing in for loop (#335)
Signed-off-by: ldpliu <daliu@redhat.com>
2023-03-28 15:40:09 +02:00
DangPeng Liu
87dc41469c remove old webhook (#330)
Signed-off-by: ldpliu <daliu@redhat.com>
2023-03-02 02:40:43 +01:00
Jian Zhu
5b5c587664 Do not filter applied manifest work by hub host when deleting klusterlet (#321)
Signed-off-by: zhujian <jiazhu@redhat.com>
2023-02-28 10:19:13 +01:00
Jian Zhu
9d7ee1149a regenerate and load hosted secrets when ca changes (#316)
Signed-off-by: zhujian <jiazhu@redhat.com>
2023-02-10 01:00:12 -05:00
Zhiwei Yin
539b6ee334 cleanup return if appliedmainfestWork is notfound (#312)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>

Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2023-01-18 22:06:02 -05:00
Jian Qiu
c3baabeec2 use crd manager to update and clean crds (#297)
* use crd manager to update clean crds

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Update tests

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Rebase crd manager

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* build client builder to make code clearer

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Add ut for crdmanager

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Compare crd spec when update

Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-12-15 20:40:46 -05:00
Jian Zhu
1ab08bd6d7 Make work agent feature gate configurable (#303)
* Make work agent feature gate configurable

Signed-off-by: zhujian <jiazhu@redhat.com>

* Merge registration and work feature gate conditions

Signed-off-by: zhujian <jiazhu@redhat.com>

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-11-27 20:55:43 -05:00
Jian Qiu
e12657c501 Refactor klusterlet (#306)
Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-11-23 08:28:05 -05:00
Jian Qiu
94f17dedd1 Refactor clustermanager controller (#305)
* Refactor clustermanager controller

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Refactor cond update

Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-11-23 04:30:49 -05:00
Jian Qiu
514fff1469 upgrade appliedmanifestwork API (#298)
Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-11-07 08:27:26 -05:00
Jian Zhu
3f119fdefe Fix the paradox description of the klusterlet condition (#290)
Signed-off-by: zhujian <jiazhu@redhat.com>

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-10-30 22:10:14 -04:00
Jian Qiu
fbbb5d9f48 Fix token path in hosted mode (#284)
Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-10-18 02:54:08 -04:00
Jian Zhu
432fac3616 Remove install mode detached (#282)
Signed-off-by: zhujian <jiazhu@redhat.com>

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-10-17 05:43:34 -04:00
Qing Hao
8745a76e6b remove clusterrole/role cleanBeforeApply code added in ocm 0.8.0 (#283)
Signed-off-by: haoqing0110 <qhao@redhat.com>

Signed-off-by: haoqing0110 <qhao@redhat.com>
2022-10-17 02:54:33 -04:00
Jian Zhu
0944f98904 Make work webhook feature gate configurable (#276)
Signed-off-by: zhujian <jiazhu@redhat.com>

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-09-23 08:47:08 +02:00
Jian Qiu
b004bcc614 Apply only when having finalizer (#270)
Signed-off-by: Jian Qiu <jqiu@redhat.com>

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-08-22 10:06:14 -04:00
Jian Zhu
59b5e56fd3 Refactor to split two controllers to handle klusterlet deployment and cleanup (#269)
Signed-off-by: zhujian <jiazhu@redhat.com>

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-08-18 03:31:13 +00:00
Bowen Zhu
79d280ad8a Add HubApiServerHostAlias for registration-agent and work-agent (#258)
Signed-off-by: Bowen Zhu <Promacanthus@gmail.com>

Add HubApiServerHostAlias for registration-agent and work-agent
2022-07-11 04:17:01 +00:00
xuezhaojun
de7ab7ad24 Add controller to sync image pull secret into addon namespaces. (#253)
* add addon-controller

Signed-off-by: xuezhaojun <zxue@redhat.com>

* fix and add testcases

Signed-off-by: xuezhaojun <zxue@redhat.com>

* add test cases

Signed-off-by: xuezhaojun <zxue@redhat.com>

* add permission and change constant name

Signed-off-by: xuezhaojun <zxue@redhat.com>

* change permission

Signed-off-by: xuezhaojun <zxue@redhat.com>

* fix

Signed-off-by: xuezhaojun <zxue@redhat.com>

* add permission into addon-management clusterrole

Signed-off-by: xuezhaojun <zxue@redhat.com>

* split permission part into another PR

Signed-off-by: xuezhaojun <zxue@redhat.com>

* split permission part into another PR

Signed-off-by: xuezhaojun <zxue@redhat.com>

* split permission part into another PR

Signed-off-by: xuezhaojun <zxue@redhat.com>

* change annotation to labels

Signed-off-by: xuezhaojun <zxue@redhat.com>

* rename the pkg name

Signed-off-by: xuezhaojun <zxue@redhat.com>

* rename the pkg name

Signed-off-by: xuezhaojun <zxue@redhat.com>

* Add comments to explain why we keep sync secret in klusterlet-controller

Signed-off-by: xuezhaojun <zxue@redhat.com>
2022-07-08 01:28:14 +00:00
Jian Qiu
a7dd402db8 Use token request to sync sa (#259)
* Use token request to sync sa

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* Upgrade kind

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-07-06 06:09:10 +00:00
Jian Zhu
4b1061dda0 add permisson for registration agent for running addon in hosted mode (#256)
Signed-off-by: zhujian <jiazhu@redhat.com>
2022-07-05 08:20:14 +00:00
Qing Hao
855199ea43 clean resource before apply new (#257)
* clean resource before apply new

Signed-off-by: haoqing0110 <qhao@redhat.com>

* update

Signed-off-by: haoqing0110 <qhao@redhat.com>
2022-07-01 04:59:48 +00:00
Yang Le
91bc2dc7c7 keep appliedmanifestwork & clusterclaim CRDs when unstalling klusterlet (#255)
Signed-off-by: Yang Le <yangle@redhat.com>
2022-06-29 08:52:44 +00:00
Qing Hao
803bfb3748 split work permissions (#252)
* split work permissions

Signed-off-by: haoqing0110 <qhao@redhat.com>

* add more comments

Signed-off-by: haoqing0110 <qhao@redhat.com>
2022-06-28 02:31:44 +00:00
Qing Hao
54452f060a split registration permissions (#250)
* split registration permissions

Signed-off-by: haoqing0110 <qhao@redhat.com>

* more comments

Signed-off-by: haoqing0110 <qhao@redhat.com>
2022-06-27 08:13:31 +00:00
ivanscai
3401c8e4bd support hubRegistrationFeatureGates and spokeRegistrationFeatureGates (#230)
* support RegistrationFeatureGates in ClusterManager and Klusterlet

Signed-off-by: ivan-cai <caijing.cai@alibaba-inc.com>

* update to use DefaultHubRegistrationFeatureGates&DefaultSpokeRegistrationFeatureGates in api repo to check registration variable if valid

Signed-off-by: ivan-cai <caijing.cai@alibaba-inc.com>

* enable addonmanagement and defaultClusterset feature if RegistrationConfiguration is nil

Signed-off-by: ivan-cai <caijing.cai@alibaba-inc.com>

* fix some errors in unit test

Signed-off-by: ivan-cai <caijing.cai@alibaba-inc.com>

* add RegistrationFeatureGates to registration webhook

Signed-off-by: ivan-cai <caijing.cai@alibaba-inc.com>

Co-authored-by: caijing.cai <caijing.cai@alibaba-inc.com>
2022-06-22 06:47:06 +00:00
xuezhaojun
11efeb18b5 Add goci lint. (#243)
* Add goci lint.

Signed-off-by: xuezhaojun <zxue@redhat.com>

* handle errs and remove unused.

Signed-off-by: xuezhaojun <zxue@redhat.com>

* fix fail and remove unused code.

Signed-off-by: xuezhaojun <zxue@redhat.com>
2022-05-10 02:50:42 -04:00
Yang Le
c93f5cefd2 add missing permission on kube v1.11.0 (#234)
Signed-off-by: Yang Le <yangle@redhat.com>
2022-04-08 06:48:17 -04:00
Yang Le
fb61c5d97b set replica to 1 if kube version < v1.14 (#232)
Signed-off-by: Yang Le <yangle@redhat.com>
2022-04-01 22:04:07 -04:00
Yang Le
ebf48bc123 support Klusterlet.Spec.Namespace in hosted mode (#227)
Signed-off-by: Yang Le <yangle@redhat.com>
2022-03-30 05:20:13 -04:00
xuezhaojun
7aa41cda65 Add hosted mode in klusterlet (#220)
Signed-off-by: xuezhaojun <zxue@redhat.com>
2022-03-15 05:03:53 -04:00
Jian Qiu
db866a5891 Upgrade api and library (#217)
* Upgrade api and library

Signed-off-by: Jian Qiu <jqiu@redhat.com>

* update permission for operator

Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-03-14 22:23:53 -04:00
Jian Zhu
78f2de10b1 Add finalizer before creating clients (#216)
Signed-off-by: zhujian <jiazhu@redhat.com>
2022-03-14 10:32:29 -04:00
Jian Zhu
4389af9344 Reduce resource request (#218)
Signed-off-by: zhujian <jiazhu@redhat.com>
2022-03-14 09:08:17 -04:00
Zhiwei Yin
a67f11c21e only set work-agent replica 0 when hub-kubeconfig-secret is missing (#213)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2022-03-10 05:40:06 -05:00
Jian Qiu
156867faf5 Disable leader election when replica is 1 (#193)
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2022-01-18 04:50:05 -05:00
Zhiwei Yin
6814943229 scale up the work agent deployment after the hub-kuebeconfig-secret is created (#184)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2022-01-18 01:36:05 -05:00
Qing Hao
50f1e8410a add addonplacementscore (#187)
* add addonplacementscore

Signed-off-by: haoqing0110 <qhao@redhat.com>

* remove addonplacementscore on spoke

Signed-off-by: haoqing0110 <qhao@redhat.com>
2022-01-11 10:55:09 +01:00
Min Kim
00c6bb1d89 adding an option that skips placeholder hub secret (#185)
Signed-off-by: yue9944882 <291271447@qq.com>
2022-01-10 14:34:50 +01:00
Zhiwei Yin
f7ff0557df get the namespace of klusterlet from helper (#181)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2022-01-10 07:42:50 +01:00
Jian Zhu
dcf93fa3b9 support deploy klusterlet outside of managed cluster (#172)
* support deploy klusterlet outside of managed cluster

Signed-off-by: zhujian <jiazhu@redhat.com>

* create manged cluster kubeconfig by sa syncer

Signed-off-by: zhujian <jiazhu@redhat.com>

* fix CI issues

Signed-off-by: zhujian <jiazhu@redhat.com>

* add unit test

Signed-off-by: zhujian <jiazhu@redhat.com>

* separate the manifests and operations for klusterlet operator

Signed-off-by: zhujian <jiazhu@redhat.com>

* add unit test

Signed-off-by: zhujian <jiazhu@redhat.com>

* add integration test

Signed-off-by: zhujian <jiazhu@redhat.com>

* add e2e test

Signed-off-by: zhujian <jiazhu@redhat.com>

* address code review comments

Signed-off-by: zhujian <jiazhu@redhat.com>

* distinguish the RBAC resource names of managed cluster and management cluster

Signed-off-by: zhujian <jiazhu@redhat.com>

* ensure the klusterlet namespace early

Signed-off-by: zhujian <jiazhu@redhat.com>

* update csv

Signed-off-by: zhujian <jiazhu@redhat.com>
2022-01-04 08:24:14 +01:00
Zhiwei Yin
4ee4d15544 update relatedResources in clusterManager and kluterler (#173)
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2021-12-01 10:43:58 +01:00
Jian Qiu
4e812fed37 Ensure addon namespace and sync secret
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2021-09-13 10:16:55 +08:00
Jian Qiu
0b749401de Remove bindata and update api
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2021-09-09 11:30:06 +08:00
Zhiwei Yin
a9128100fa add nodeSelector and tolerations to deployments
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
2021-09-08 15:58:01 +08:00
huiwq1990
ed751da6e5 change comment
Signed-off-by: huiwq1990 <huiwq1990@163.com>
2021-08-05 13:10:08 +08:00
Jian Qiu
ef338a1b0b Update deps and enable action
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2021-06-21 11:42:45 +08:00