Skip to content

Commit 4d6a1e5

Browse files
Merge pull request #663 from dinhxuanvu/min-kube
Add minimum kube version to CSV & check it against server version
2 parents 23f22b8 + 5ab896d commit 4d6a1e5

File tree

11 files changed

+303
-30
lines changed

11 files changed

+303
-30
lines changed

Documentation/design/building-your-csv.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It’s common for your Operator to use multiple CRDs to link together concepts,
4444
4545
**Name**: The full name of your CRD
4646
47-
The next two sections require more explanation.
47+
The next two sections require more explanation.
4848
4949
**Resources**:
5050
Your CRDs will own one or more types of Kubernetes objects. These are listed in the resources section to inform your end-users of the objects they might need to troubleshoot or how to connect to the application, such as the Service or Ingress rule that exposes a database.
@@ -178,7 +178,7 @@ An APIService is uniquely identified by the group-version it provides and can be
178178

179179
**Kind**: A kind that the APIService is expected to provide.
180180

181-
**DeploymentName**:
181+
**DeploymentName**:
182182
Name of the deployment defined by your CSV that corresponds to your APIService (required for owned APIServices). During the CSV pending phase, the OLM Operator will search your CSV's InstallStrategy for a deployment spec with a matching name, and if not found, will not transition the CSV to the install ready phase.
183183

184184
**Resources**:
@@ -190,8 +190,8 @@ It’s recommended to only list out the objects that are important to a human, n
190190
Essentially the same as for owned CRDs.
191191

192192
### APIService Resource Creation
193-
The Lifecycle Manage is responsible for creating or replacing the Service and APIService resources for each unique owned APIService.
194-
* Service pod selectors are copied from the CSV deployment matching the APIServiceDescription's DeploymentName.
193+
The Lifecycle Manage is responsible for creating or replacing the Service and APIService resources for each unique owned APIService.
194+
* Service pod selectors are copied from the CSV deployment matching the APIServiceDescription's DeploymentName.
195195
* A new CA key/cert pair is generated for for each installation and the base64 encoded CA bundle is embedded in the respective APIService resource.
196196

197197
### APIService Serving Certs
@@ -232,6 +232,8 @@ The metadata section contains general metadata around the name, version and othe
232232

233233
**Description**: A markdown blob that describes the Operator. Important information to include: features, limitations and common use-cases for the Operator. If your Operator manages different types of installs, eg. standalone vs clustered, it is useful to give an overview of how each differs from each other, or which ones are supported for production use.
234234

235+
**MinKubeVersion**: A minimum version of Kubernetes that server is supposed to have so operator(s) can be deployed.
236+
235237
**Labels** (optional): Any key/value pairs used to organize and categorize this CSV object.
236238

237239
**Selectors** (optional): A label selector to identify related resources. Set this to select on current labels applied to this CSV object (if applicable).

deploy/chart/templates/0000_30_02-clusterserviceversion.crd.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ spec:
6060
type: string
6161
description: Human readable description of what the application does
6262

63+
minKubeVersion:
64+
type: string
65+
description: Minimum kubernetes version requirement on the server to deploy operator
66+
6367
keywords:
6468
type: array
6569
description: List of keywords which will be used to discover and categorize app types
@@ -198,7 +202,7 @@ spec:
198202
description: Version of the API resource
199203
kind:
200204
type: string
201-
description: Kind of the API resource
205+
description: Kind of the API resource
202206
apiservicedefinitions:
203207
type: object
204208
properties:

deploy/chart/templates/_packageserver.clusterserviceversion.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
spec:
88
displayName: Package Server
99
description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion.
10+
minKubeVersion: {{ .Values.minKubeVersion }}
1011
keywords: ['packagemanifests', 'olm', 'packages']
1112
maintainers:
1213
- name: Red Hat

deploy/chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ rbacApiVersion: rbac.authorization.k8s.io
22
namespace: operator-lifecycle-manager
33
catalog_namespace: operator-lifecycle-manager
44
operator_namespace: operators
5+
minKubeVersion: 1.11.0
56
imagestream: false
67
debug: false
78
olm:

manifests/0000_30_02-clusterserviceversion.crd.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ spec:
6262
type: string
6363
description: Human readable description of what the application does
6464

65+
minKubeVersion:
66+
type: string
67+
description: Minimum kubernetes version requirement on the server to deploy operator
68+
6569
keywords:
6670
type: array
6771
description: List of keywords which will be used to discover and categorize app types
@@ -200,7 +204,7 @@ spec:
200204
description: Version of the API resource
201205
kind:
202206
type: string
203-
description: Kind of the API resource
207+
description: Kind of the API resource
204208
apiservicedefinitions:
205209
type: object
206210
properties:

pkg/api/apis/operators/v1alpha1/clusterserviceversion_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ type ClusterServiceVersionSpec struct {
133133
CustomResourceDefinitions CustomResourceDefinitions `json:"customresourcedefinitions,omitempty"`
134134
APIServiceDefinitions APIServiceDefinitions `json:"apiservicedefinitions,omitempty"`
135135
NativeAPIs []metav1.GroupVersionKind `json:"nativeAPIs,omitempty"`
136+
MinKubeVersion string `json:"minKubeVersion,omitempty"`
136137
DisplayName string `json:"displayName"`
137138
Description string `json:"description,omitempty"`
138139
Keywords []string `json:"keywords,omitempty"`
@@ -478,3 +479,4 @@ func (csv ClusterServiceVersion) GetOwnedAPIServiceDescriptions() []APIServiceDe
478479

479480
return descs
480481
}
482+

0 commit comments

Comments
 (0)