-
Notifications
You must be signed in to change notification settings - Fork 111
Create OLM v1 chart #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Create OLM v1 chart #657
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: v2 | ||
| name: olmv1 | ||
| description: Installs operators or cluster extensions in a declarative, GitOps friendly way using olmv1 | ||
| type: application | ||
| version: 1.0.0 | ||
|
|
||
| home: https://github.com/redhat-cop/helm-charts | ||
| icon: https://raw.githubusercontent.com/operator-framework/olm-docs/ea9cd734aa7a6bf2d24f273322ed9aec3ffcb02a/content/en/images/logo-sm.svg | ||
|
|
||
| keywords: | ||
| - olm | ||
| - olmv1 | ||
| - operators | ||
| - extensions | ||
|
|
||
| maintainers: | ||
| - name: marpears |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # olmv1 | ||
|
|
||
| ## Introduction | ||
|
|
||
| This chart will install operators or cluster extensions in a declarative, GitOps friendly way using OLM v1. | ||
|
|
||
| Please refer to the official OpenShift documentation for more information about how OLM v1 works: https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html-single/extensions/index#extensions-overview | ||
|
|
||
| ## Values | ||
|
|
||
| Here are the values used by this chart | ||
|
|
||
| | Value | Type | Required | Description | | ||
| | ----------------------- | ------- | ----------| ----------------------------------------------------------------------------------------------------------- | | ||
| | name | string | yes | Name for the `ClusterExtension` | | ||
| | namespace | string | yes | Namespace to create resources in | | ||
| | upgradeConstraintPolicy | string | No | Populates `clusterextension.spec.source.catalog.upgradeConstraintPolicy` | | ||
| | version | string | no | Populates `clusterextension.spec.source.catalog.version` | | ||
| | channels | list | no | Populates `clusterextension.spec.source.catalog.channels` | | ||
| | catalogSelector | map | no | Populates `clusterextension.spec.source.catalog.selector` | | ||
| | upgradeConstraintPolicy | string | no | Populates `clusterextension.spec.source.catalog.upgradeConstraintPolicy` | | ||
| | packageName | string | no | Populates `clusterextension.spec.source.catalog.packageName` | | ||
| | clusterRole | string | yes * | Specify a cluster role to assign to the ServiceAccount used to install the operator | | ||
| | rbac | map | yes * | Specify cluster and/or namespace rbac rules to assign to the ServiceAccount used to install the operator | | ||
|
|
||
| \* One of `clusterRole` or `rbac` is required. | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Install cert-manager using selective RBAC rules | ||
|
|
||
| ``` | ||
| - name: openshift-cert-manager-operator | ||
| namespace: openshift-cert-manager-operator | ||
| upgradeConstraintPolicy: CatalogProvided | ||
| packageName: openshift-cert-manager-operator | ||
| version: 1.16.1 | ||
| channels: | ||
| - stable-v1.16 | ||
| rbac: | ||
| cluster: | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions"] | ||
| verbs: ["get", "list", "watch"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["clusterrolebindings"] | ||
| verbs: ["get", "list", "watch"] | ||
| - apiGroups: ["olm.operatorframework.io"] | ||
| resources: ["clusterextensions/finalizers"] | ||
| verbs: ["get", "update", "patch"] | ||
| namespace: | ||
| - apiGroups: [""] | ||
| resources: ["pods"] | ||
| verbs: ["get", "watch", "list"] | ||
| - apiGroups: [""] | ||
| resources: ["serviceaccounts"] | ||
| verbs: ["get", "list", "watch", "create"] | ||
| - apiGroups: [""] | ||
| resources: ["services"] | ||
| verbs: ["get", "list", "watch"] | ||
| - apiGroups: ["apps"] | ||
| resources: ["deployments"] | ||
| verbs: ["get", "list", "watch"] | ||
| ``` | ||
|
|
||
| ### Install cert-manager using the cluster-admin role | ||
|
|
||
| ``` | ||
| - name: openshift-cert-manager-operator | ||
| namespace: openshift-cert-manager-operator | ||
| upgradeConstraintPolicy: CatalogProvided | ||
| packageName: openshift-cert-manager-operator | ||
| version: 1.16.1 | ||
| channels: | ||
| - stable-v1.16 | ||
| clusterRole: cluster-admin | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| extensions: | ||
| - name: openshift-cert-manager-operator | ||
| namespace: openshift-cert-manager-operator | ||
| upgradeConstraintPolicy: CatalogProvided | ||
| packageName: openshift-cert-manager-operator | ||
| version: 1.16.1 | ||
| channels: | ||
| - stable-v1.16 | ||
| rbac: | ||
| cluster: | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions"] | ||
| verbs: ["get", "list", "watch"] | ||
| namespace: | ||
| - apiGroups: [""] | ||
| resources: ["pods"] | ||
| verbs: ["get", "watch", "list"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| {{- range .Values.extensions }} | ||
| --- | ||
| apiVersion: olm.operatorframework.io/v1 | ||
| kind: ClusterExtension | ||
| metadata: | ||
| name: {{ .name }} | ||
| spec: | ||
| namespace: {{ .namespace }} | ||
| serviceAccount: | ||
| name: {{ .packageName }}-installer | ||
| source: | ||
| sourceType: Catalog | ||
| catalog: | ||
| packageName: {{ .packageName }} | ||
| {{- if .catalogSelector }} | ||
| selector: | ||
| {{- toYaml .catalogSelector | nindent 8 }} | ||
| {{- end }} | ||
| {{- if .upgradeConstraintPolicy }} | ||
| upgradeConstraintPolicy: {{ .upgradeConstraintPolicy }} | ||
| {{- end }} | ||
| {{- if .channels }} | ||
| channels: | ||
| {{- range .channels }} | ||
| - {{ . }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if .version }} | ||
| version: {{ .version | toString }} | ||
| {{- end }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| {{- range .Values.extensions }} | ||
| {{- if and .rbac .rbac.cluster }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: {{ .packageName }}-installer | ||
| rules: | ||
| {{ toYaml .rbac.cluster }} | ||
|
|
||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| {{- range .Values.extensions }} | ||
| {{- if and .rbac .rbac.cluster }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ .packageName }}-installer | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ .packageName }}-installer | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ .packageName }}-installer | ||
| namespace: {{ .namespace }} | ||
|
|
||
| {{- end }} | ||
| {{- if .clusterRole }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: {{ .packageName }}-{{ .clusterRole }}-installer | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: {{ .clusterRole }} | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ .packageName }}-installer | ||
| namespace: {{ .namespace }} | ||
| {{- end }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {{- range .Values.extensions }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: {{ .namespace }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| {{- $_ := required ".Values.extensions is required" .Values.extensions }} | ||
| {{- range .Values.extensions }} | ||
| {{- $_ := required "name is required" .name }} | ||
| {{- $_ := required "namespace is required" .namespace }} | ||
| {{- $_ := required "packageName is required" .packageName }} | ||
|
|
||
| {{- $clusterRole := .clusterRole }} | ||
| {{- $rbacRules := .rbac }} | ||
|
|
||
| {{- if not (or $clusterRole $rbacRules) }} | ||
| {{- $_ := required "Either a cluster role or rbac rules must be defined" nil }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| {{- range .Values.extensions }} | ||
| {{- if and .rbac .rbac.namespace }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: {{ .packageName }}-installer | ||
| namespace: {{ .namespace }} | ||
| rules: | ||
| {{ toYaml .rbac.namespace }} | ||
| {{- end }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {{- range .Values.extensions }} | ||
| {{- if and .rbac .rbac.namespace }} | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: {{ .packageName }}-installer | ||
| namespace: {{ .namespace }} | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: {{ .packageName }}-installer | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: {{ .packageName }}-installer | ||
| {{- end }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {{- range .Values.extensions }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: {{ .packageName }}-installer | ||
| namespace: {{ .namespace }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| extensions: | ||
|
|
||
| # Define operator name and namespace (required) | ||
| # - name: openshift-cert-manager-operator | ||
| # namespace: openshift-cert-manager-operator | ||
|
|
||
| # Define the ClusterCatalog selector (optional) | ||
| # catalogSelector: | ||
| # matchLabels: | ||
| # olm.operatorframework.io/openshift-certified-operators | ||
| # matchExpressions: | ||
| # - { key: mykey, operator: In, values: [myvalue] } | ||
| # - { key: mykey1, operator: NotIn, values: [myvalue1] } | ||
|
|
||
| # Define the upgradeConstraintPolicy (optional) | ||
| # upgradeConstraintPolicy: | ||
|
|
||
| # Define the package name (required) | ||
| # packageName: | ||
|
|
||
| # Define the version and list of channels (optional) | ||
| # version: | ||
| # channels: | ||
| # - | ||
|
|
||
| # Define either a cluster role or custom cluster and namespace scoped rbac | ||
| # rules to bind to the service account (required) | ||
| # clusterRole: cluster-admin | ||
| # rbac: | ||
| # cluster: | ||
| # - apiGroups: ["apiextensions.k8s.io"] | ||
| # resources: ["customresourcedefinitions"] | ||
| # verbs: ["get", "list", "watch"] | ||
| # namespace: | ||
| # - apiGroups: [""] | ||
| # resources: ["pods"] | ||
| # verbs: ["get", "watch", "list"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garethahealy can you move this to a
cifolder rather then_test. then the automatic github action testing will pick this up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you want @marpears - as he was the PR raiser :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoooops. sorry. missread that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File moved to a
cifolder