Skip to content

Commit 2c5379c

Browse files
committed
Add installStrategy for addon and upgrade to v1beta1
Signed-off-by: Jian Qiu <[email protected]>
1 parent 6cd5b2b commit 2c5379c

35 files changed

+2979
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ $(call add-crd-gen,workv1,./work/v1,./work/v1,./work/v1)
2929
$(call add-crd-gen,workv1alpha1,./work/v1alpha1,./work/v1alpha1,./work/v1alpha1)
3030
$(call add-crd-gen,operator,./operator/v1,./operator/v1,./operator/v1)
3131
$(call add-crd-gen,addonv1alpha1,./addon/v1alpha1,./addon/v1alpha1,./addon/v1alpha1)
32+
$(call add-crd-gen,addonv1beta1,./addon/v1alpha1 ./addon/v1beta1,./addon/v1beta1,./addon/v1beta1)
3233

3334
RUNTIME ?= podman
3435
RUNTIME_IMAGE_NAME ?= openshift-api-generator
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: clustermanagementaddons.addon.open-cluster-management.io
5+
spec:
6+
group: addon.open-cluster-management.io
7+
names:
8+
kind: ClusterManagementAddOn
9+
listKind: ClusterManagementAddOnList
10+
plural: clustermanagementaddons
11+
singular: clustermanagementaddon
12+
scope: Cluster
13+
versions:
14+
- additionalPrinterColumns:
15+
- jsonPath: .spec.addOnMeta.displayName
16+
name: DISPLAY NAME
17+
type: string
18+
name: v1beta1
19+
schema:
20+
openAPIV3Schema:
21+
description: ClusterManagementAddOn represents the registration of an add-on to the cluster manager. This resource allows the user to discover which add-on is available for the cluster manager and also provides metadata information about the add-on. This resource also provides a linkage to ManagedClusterAddOn, the name of the ClusterManagementAddOn resource will be used for the namespace-scoped ManagedClusterAddOn resource. ClusterManagementAddOn is a cluster-scoped resource.
22+
type: object
23+
properties:
24+
apiVersion:
25+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
26+
type: string
27+
kind:
28+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
29+
type: string
30+
metadata:
31+
type: object
32+
spec:
33+
description: spec represents a desired configuration for the agent on the cluster management add-on.
34+
type: object
35+
properties:
36+
addOnMeta:
37+
description: addOnMeta is a reference to the metadata information for the add-on.
38+
type: object
39+
properties:
40+
description:
41+
description: description represents the detailed description of the add-on.
42+
type: string
43+
displayName:
44+
description: displayName represents the name of add-on that will be displayed.
45+
type: string
46+
defaultConfigs:
47+
description: defaultConfigs represents a list of default add-on configurations. In scenario where all add-ons have the same configuration. User can override the default configuration by defining the configs in the install strategy for specific clusters.
48+
type: array
49+
items:
50+
type: object
51+
required:
52+
- name
53+
- resource
54+
properties:
55+
group:
56+
description: group of the add-on configuration.
57+
type: string
58+
default: ""
59+
name:
60+
description: name of the add-on configuration.
61+
type: string
62+
minLength: 1
63+
namespace:
64+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
65+
type: string
66+
resource:
67+
description: resource of the add-on configuration.
68+
type: string
69+
minLength: 1
70+
installStrategy:
71+
description: InstallStrategy represents that related ManagedClusterAddOns should be installed on certain clusters.
72+
type: object
73+
properties:
74+
placements:
75+
description: Placements is a list of placement references honored when install strategy type is Placements. All clusters selected by these placements will install the addon If one cluster belongs to multiple placements, it will only apply the strategy defined later in the order. That is to say, The latter strategy overrides the previous one.
76+
type: array
77+
items:
78+
type: object
79+
required:
80+
- name
81+
- namespace
82+
properties:
83+
configs:
84+
description: Configs is the configuration of managedClusterAddon during installation. User can override the configuration by updating the managedClusterAddon directly.
85+
type: array
86+
items:
87+
type: object
88+
required:
89+
- name
90+
- resource
91+
properties:
92+
group:
93+
description: group of the add-on configuration.
94+
type: string
95+
default: ""
96+
name:
97+
description: name of the add-on configuration.
98+
type: string
99+
minLength: 1
100+
namespace:
101+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
102+
type: string
103+
resource:
104+
description: resource of the add-on configuration.
105+
type: string
106+
minLength: 1
107+
name:
108+
description: Name is the name of the placement
109+
type: string
110+
minLength: 1
111+
namespace:
112+
description: Namespace is the namespace of the placement
113+
type: string
114+
minLength: 1
115+
x-kubernetes-list-map-keys:
116+
- namespace
117+
- name
118+
x-kubernetes-list-type: map
119+
type:
120+
description: 'Type is the type of the install strategy, it can be: - Manual: no automatic install - Placements: install to clusters selected by placements.'
121+
type: string
122+
default: Manual
123+
enum:
124+
- Manual
125+
- Placements
126+
status:
127+
description: status represents the current status of cluster management add-on.
128+
type: object
129+
served: true
130+
storage: true
131+
subresources:
132+
status: {}
133+
- additionalPrinterColumns:
134+
- jsonPath: .spec.addOnMeta.displayName
135+
name: DISPLAY NAME
136+
type: string
137+
- jsonPath: .spec.addOnConfiguration.crdName
138+
name: CRD NAME
139+
type: string
140+
name: v1alpha1
141+
schema:
142+
openAPIV3Schema:
143+
description: ClusterManagementAddOn represents the registration of an add-on to the cluster manager. This resource allows the user to discover which add-on is available for the cluster manager and also provides metadata information about the add-on. This resource also provides a linkage to ManagedClusterAddOn, the name of the ClusterManagementAddOn resource will be used for the namespace-scoped ManagedClusterAddOn resource. ClusterManagementAddOn is a cluster-scoped resource.
144+
type: object
145+
properties:
146+
apiVersion:
147+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
148+
type: string
149+
kind:
150+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
151+
type: string
152+
metadata:
153+
type: object
154+
spec:
155+
description: spec represents a desired configuration for the agent on the cluster management add-on.
156+
type: object
157+
properties:
158+
addOnConfiguration:
159+
description: 'Deprecated: Use supportedConfigs filed instead addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration.'
160+
type: object
161+
properties:
162+
crName:
163+
description: crName is the name of the CR used to configure instances of the managed add-on. This field should be configured if add-on CR have a consistent name across the all of the ManagedCluster instaces.
164+
type: string
165+
crdName:
166+
description: crdName is the name of the CRD used to configure instances of the managed add-on. This field should be configured if the add-on have a CRD that controls the configuration of the add-on.
167+
type: string
168+
lastObservedGeneration:
169+
description: lastObservedGeneration is the observed generation of the custom resource for the configuration of the addon.
170+
type: integer
171+
format: int64
172+
addOnMeta:
173+
description: addOnMeta is a reference to the metadata information for the add-on.
174+
type: object
175+
properties:
176+
description:
177+
description: description represents the detailed description of the add-on.
178+
type: string
179+
displayName:
180+
description: displayName represents the name of add-on that will be displayed.
181+
type: string
182+
supportedConfigs:
183+
description: supportedConfigs is a list of configuration types supported by add-on. An empty list means the add-on does not require configurations. The default is an empty list
184+
type: array
185+
items:
186+
description: ConfigMeta represents a collection of metadata information for add-on configuration.
187+
type: object
188+
required:
189+
- resource
190+
properties:
191+
defaultConfig:
192+
description: defaultConfig represents the namespace and name of the default add-on configuration. In scenario where all add-ons have a same configuration.
193+
type: object
194+
required:
195+
- name
196+
properties:
197+
name:
198+
description: name of the add-on configuration.
199+
type: string
200+
minLength: 1
201+
namespace:
202+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
203+
type: string
204+
group:
205+
description: group of the add-on configuration.
206+
type: string
207+
default: ""
208+
resource:
209+
description: resource of the add-on configuration.
210+
type: string
211+
minLength: 1
212+
x-kubernetes-list-map-keys:
213+
- group
214+
- resource
215+
x-kubernetes-list-type: map
216+
status:
217+
description: status represents the current status of cluster management add-on.
218+
type: object
219+
served: true
220+
storage: false
221+
subresources:
222+
status: {}
223+
status:
224+
acceptedNames:
225+
kind: ""
226+
plural: ""
227+
conditions: []
228+
storedVersions: []

0 commit comments

Comments
 (0)