Skip to content

Commit 4679786

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

35 files changed

+3092
-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: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
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+
supportedConfigs:
47+
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
48+
type: array
49+
items:
50+
description: ConfigMeta represents a collection of metadata information for add-on configuration.
51+
type: object
52+
required:
53+
- resource
54+
properties:
55+
defaultConfigs:
56+
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 installStrategy for specific clusters or on certain ManagedClusterAddon.
57+
type: array
58+
items:
59+
type: object
60+
required:
61+
- name
62+
- resource
63+
properties:
64+
group:
65+
description: group of the add-on configuration.
66+
type: string
67+
default: ""
68+
name:
69+
description: name of the add-on configuration.
70+
type: string
71+
minLength: 1
72+
namespace:
73+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
74+
type: string
75+
resource:
76+
description: resource of the add-on configuration.
77+
type: string
78+
minLength: 1
79+
group:
80+
description: group of the add-on configuration.
81+
type: string
82+
default: ""
83+
installStrategy:
84+
description: InstallStrategy represents that related ManagedClusterAddOns should be installed on certain clusters.
85+
type: object
86+
properties:
87+
placements:
88+
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.
89+
type: array
90+
items:
91+
type: object
92+
required:
93+
- name
94+
- namespace
95+
properties:
96+
configs:
97+
description: Configs is the configuration of managedClusterAddon during installation. User can override the configuration by updating the managedClusterAddon directly.
98+
type: array
99+
items:
100+
type: object
101+
required:
102+
- name
103+
- resource
104+
properties:
105+
group:
106+
description: group of the add-on configuration.
107+
type: string
108+
default: ""
109+
name:
110+
description: name of the add-on configuration.
111+
type: string
112+
minLength: 1
113+
namespace:
114+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
115+
type: string
116+
resource:
117+
description: resource of the add-on configuration.
118+
type: string
119+
minLength: 1
120+
name:
121+
description: Name is the name of the placement
122+
type: string
123+
minLength: 1
124+
namespace:
125+
description: Namespace is the namespace of the placement
126+
type: string
127+
minLength: 1
128+
x-kubernetes-list-map-keys:
129+
- namespace
130+
- name
131+
x-kubernetes-list-type: map
132+
type:
133+
description: 'Type is the type of the install strategy, it can be: - Manual: no automatic install - Placements: install to clusters selected by placements.'
134+
type: string
135+
default: Manual
136+
enum:
137+
- Manual
138+
- Placements
139+
resource:
140+
description: resource of the add-on configuration.
141+
type: string
142+
minLength: 1
143+
x-kubernetes-list-map-keys:
144+
- group
145+
- resource
146+
x-kubernetes-list-type: map
147+
status:
148+
description: status represents the current status of cluster management add-on.
149+
type: object
150+
served: true
151+
storage: true
152+
subresources:
153+
status: {}
154+
- additionalPrinterColumns:
155+
- jsonPath: .spec.addOnMeta.displayName
156+
name: DISPLAY NAME
157+
type: string
158+
- jsonPath: .spec.addOnConfiguration.crdName
159+
name: CRD NAME
160+
type: string
161+
name: v1alpha1
162+
schema:
163+
openAPIV3Schema:
164+
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.
165+
type: object
166+
properties:
167+
apiVersion:
168+
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'
169+
type: string
170+
kind:
171+
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'
172+
type: string
173+
metadata:
174+
type: object
175+
spec:
176+
description: spec represents a desired configuration for the agent on the cluster management add-on.
177+
type: object
178+
properties:
179+
addOnConfiguration:
180+
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.'
181+
type: object
182+
properties:
183+
crName:
184+
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.
185+
type: string
186+
crdName:
187+
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.
188+
type: string
189+
lastObservedGeneration:
190+
description: lastObservedGeneration is the observed generation of the custom resource for the configuration of the addon.
191+
type: integer
192+
format: int64
193+
addOnMeta:
194+
description: addOnMeta is a reference to the metadata information for the add-on.
195+
type: object
196+
properties:
197+
description:
198+
description: description represents the detailed description of the add-on.
199+
type: string
200+
displayName:
201+
description: displayName represents the name of add-on that will be displayed.
202+
type: string
203+
supportedConfigs:
204+
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
205+
type: array
206+
items:
207+
description: ConfigMeta represents a collection of metadata information for add-on configuration.
208+
type: object
209+
required:
210+
- resource
211+
properties:
212+
defaultConfig:
213+
description: defaultConfig represents the namespace and name of the default add-on configuration. In scenario where all add-ons have a same configuration.
214+
type: object
215+
required:
216+
- name
217+
properties:
218+
name:
219+
description: name of the add-on configuration.
220+
type: string
221+
minLength: 1
222+
namespace:
223+
description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope.
224+
type: string
225+
group:
226+
description: group of the add-on configuration.
227+
type: string
228+
default: ""
229+
resource:
230+
description: resource of the add-on configuration.
231+
type: string
232+
minLength: 1
233+
x-kubernetes-list-map-keys:
234+
- group
235+
- resource
236+
x-kubernetes-list-type: map
237+
status:
238+
description: status represents the current status of cluster management add-on.
239+
type: object
240+
served: true
241+
storage: false
242+
subresources:
243+
status: {}
244+
status:
245+
acceptedNames:
246+
kind: ""
247+
plural: ""
248+
conditions: []
249+
storedVersions: []

0 commit comments

Comments
 (0)