Skip to content

Commit 137e560

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

35 files changed

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

0 commit comments

Comments
 (0)