Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/v1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ type ClusterExtensionSpec struct {
// a configuration schema the bundle is deemed to not be configurable. More information on how
// to configure bundles can be found in the OLM documentation associated with your current OLM version.
//
// <opcon:experimental>
// +optional
Config *ClusterExtensionConfig `json:"config,omitempty"`

Expand Down
2 changes: 2 additions & 0 deletions applyconfigurations/api/v1/clusterextensionspec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/api-reference/olmv1-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ _Appears in:_
| `serviceAccount` _[ServiceAccountReference](#serviceaccountreference)_ | serviceAccount specifies a ServiceAccount used to perform all interactions with the cluster<br />that are required to manage the extension.<br />The ServiceAccount must be configured with the necessary permissions to perform these interactions.<br />The ServiceAccount must exist in the namespace referenced in the spec.<br />The serviceAccount field is required. | | Required: \{\} <br /> |
| `source` _[SourceConfig](#sourceconfig)_ | source is required and selects the installation source of content for this ClusterExtension.<br />Set the sourceType field to perform the selection.<br />Catalog is currently the only implemented sourceType.<br />Setting sourceType to "Catalog" requires the catalog field to also be defined.<br />Below is a minimal example of a source definition (in yaml):<br />source:<br /> sourceType: Catalog<br /> catalog:<br /> packageName: example-package | | Required: \{\} <br /> |
| `install` _[ClusterExtensionInstallConfig](#clusterextensioninstallconfig)_ | install is optional and configures installation options for the ClusterExtension,<br />such as the pre-flight check configuration. | | Optional: \{\} <br /> |
| `config` _[ClusterExtensionConfig](#clusterextensionconfig)_ | config is optional and specifies bundle-specific configuration.<br />Configuration is bundle-specific and a bundle may provide a configuration schema.<br />When not specified, the default configuration of the resolved bundle is used.<br />config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide<br />a configuration schema the bundle is deemed to not be configurable. More information on how<br />to configure bundles can be found in the OLM documentation associated with your current OLM version. | | Optional: \{\} <br /> |
| `config` _[ClusterExtensionConfig](#clusterextensionconfig)_ | config is optional and specifies bundle-specific configuration.<br />Configuration is bundle-specific and a bundle may provide a configuration schema.<br />When not specified, the default configuration of the resolved bundle is used.<br />config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide<br />a configuration schema the bundle is deemed to not be configurable. More information on how<br />to configure bundles can be found in the OLM documentation associated with your current OLM version.<br /><opcon:experimental> | | Optional: \{\} <br /> |
| `progressDeadlineMinutes` _integer_ | progressDeadlineMinutes is an optional field that defines the maximum period<br />of time in minutes after which an installation should be considered failed and<br />require manual intervention. This functionality is disabled when no value<br />is provided. The minimum period is 10 minutes, and the maximum is 720 minutes (12 hours).<br /><opcon:experimental> | | Maximum: 720 <br />Minimum: 10 <br />Optional: \{\} <br /> |


Expand Down
25 changes: 24 additions & 1 deletion docs/draft/howto/single-ownnamespace-install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Description

!!! note
The `SingleOwnNamespaceInstallSupport` feature-gate is enabled by default. Use this guide to configure bundles that need Single or Own namespace install modes.
This feature is still in *alpha* the `SingleOwnNamespaceInstallSupport` feature-gate must be enabled to make use of it.
See the instructions below on how to enable it.

---

Expand Down Expand Up @@ -30,6 +31,28 @@ include *installModes*.

[![OwnNamespace Install Demo](https://asciinema.org/a/Rxx6WUwAU016bXFDW74XLcM5i.svg)](https://asciinema.org/a/Rxx6WUwAU016bXFDW74XLcM5i)

## Enabling the Feature-Gate

!!! tip

This guide assumes OLMv1 is already installed. If that is not the case,
you can follow the [getting started](../../getting-started/olmv1_getting_started.md) guide to install OLMv1.

---

Patch the `operator-controller` `Deployment` adding `--feature-gates=SingleOwnNamespaceInstallSupport=true` to the
controller container arguments:

```terminal title="Enable SingleOwnNamespaceInstallSupport feature-gate"
kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]'
```

Wait for `Deployment` rollout:

```terminal title="Wait for Deployment rollout"
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager
```

## Configuring the `ClusterExtension`

A `ClusterExtension` can be configured to install bundle in `Single-` or `OwnNamespace` mode through the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ Then you can query the catalog by using `curl` commands and the `jq` CLI tool to
...
```

!!! important
OLM 1.0 supports installing extensions that define webhooks. Targeting a single or specified set of namespaces requires enabling the `SingleOwnNamespaceInstallSupport` feature-gate.

3. Return list of packages which support `AllNamespaces` install mode, do not use webhooks, and where the channel head version uses `olm.csv.metadata` format:

``` terminal
Expand Down
3 changes: 3 additions & 0 deletions docs/tutorials/explore-available-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ Then you can query the catalog by using `curl` commands and the `jq` CLI tool to
...
```

!!! important
OLM 1.0 supports installing extensions that define webhooks. Targeting a single or specified set of namespaces requires enabling the `SingleOwnNamespaceInstallSupport` feature-gate.

3. Return list of packages that support `AllNamespaces` install mode and do not use webhooks:

``` terminal
Expand Down
23 changes: 18 additions & 5 deletions hack/demo/own-namespace-demo-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
set -e
trap 'echo "Demo ran into error"; trap - SIGTERM && kill -- -$$; exit 1' ERR SIGINT SIGTERM EXIT

# install standard CRDs
echo "Install standard CRDs..."
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/standard.yaml"
# install experimental CRDs with config field support
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/experimental.yaml"

# wait for standard CRDs to be available
# wait for experimental CRDs to be available
kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io

# Ensure controller is healthy
# enable 'SingleOwnNamespaceInstallSupport' feature gate
kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]'

# wait for operator-controller to become available
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager

# create install namespace
Expand Down Expand Up @@ -55,6 +57,17 @@ kubectl delete clusterextension argocd-operator --ignore-not-found=true
kubectl delete namespace argocd-system --ignore-not-found=true
kubectl delete clusterrolebinding argocd-installer-crb --ignore-not-found=true

# remove feature gate from deployment
echo "Removing feature gate from operator-controller..."
kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/args", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]' || true
Comment on lines +60 to +62

# restore standard CRDs
echo "Restoring standard CRDs..."
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/base.yaml"

# wait for standard CRDs to be available
kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io

# wait for operator-controller to become available with standard config
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager

Expand Down
23 changes: 18 additions & 5 deletions hack/demo/single-namespace-demo-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
set -e
trap 'echo "Demo ran into error"; trap - SIGTERM && kill -- -$$; exit 1' ERR SIGINT SIGTERM EXIT

# install standard CRDs
echo "Install standard CRDs..."
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/standard.yaml"
# install experimental CRDs with config field support
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/experimental.yaml"

# wait for standard CRDs to be available
# wait for experimental CRDs to be available
kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io

# Ensure controller is healthy
# enable 'SingleOwnNamespaceInstallSupport' feature gate
kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]'

# wait for operator-controller to become available
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager

# create install namespace
Expand Down Expand Up @@ -58,6 +60,17 @@ kubectl delete clusterextension argocd-operator --ignore-not-found=true
kubectl delete namespace argocd-system argocd --ignore-not-found=true
kubectl delete clusterrolebinding argocd-installer-crb --ignore-not-found=true

# remove feature gate from deployment
echo "Removing feature gate from operator-controller..."
kubectl patch deployment -n olmv1-system operator-controller-controller-manager --type='json' -p='[{"op": "remove", "path": "/spec/template/spec/containers/0/args", "value": "--feature-gates=SingleOwnNamespaceInstallSupport=true"}]' || true
Comment on lines +64 to +65

# restore standard CRDs
echo "Restoring standard CRDs..."
kubectl apply -f "$(dirname "${BASH_SOURCE[0]}")/../../manifests/base.yaml"

# wait for standard CRDs to be available
kubectl wait --for condition=established --timeout=60s crd/clusterextensions.olm.operatorframework.io

# wait for operator-controller to become available with standard config
kubectl rollout status -n olmv1-system deployment/operator-controller-controller-manager

Expand Down
1 change: 1 addition & 0 deletions helm/experimental.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ options:
operatorController:
features:
enabled:
- SingleOwnNamespaceInstallSupport
- PreflightPermissions
- HelmChartSupport
- BoxcutterRuntime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,44 +57,6 @@ spec:
description: spec is an optional field that defines the desired state
of the ClusterExtension.
properties:
config:
description: |-
config is optional and specifies bundle-specific configuration.
Configuration is bundle-specific and a bundle may provide a configuration schema.
When not specified, the default configuration of the resolved bundle is used.

config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide
a configuration schema the bundle is deemed to not be configurable. More information on how
to configure bundles can be found in the OLM documentation associated with your current OLM version.
properties:
configType:
description: |-
configType is required and specifies the type of configuration source.

The only allowed value is "Inline".

When set to "Inline", the cluster extension configuration is defined inline within the ClusterExtension resource.
enum:
- Inline
type: string
inline:
description: |-
inline contains JSON or YAML values specified directly in the ClusterExtension.

It is used to specify arbitrary configuration values for the ClusterExtension.
It must be set if configType is 'Inline' and must be a valid JSON/YAML object containing at least one property.
The configuration values are validated at runtime against a JSON schema provided by the bundle.
minProperties: 1
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configType
type: object
x-kubernetes-validations:
- message: inline is required when configType is Inline, and forbidden
otherwise
rule: 'has(self.configType) && self.configType == ''Inline'' ?has(self.inline)
: !has(self.inline)'
install:
description: |-
install is optional and configures installation options for the ClusterExtension,
Expand Down
1 change: 1 addition & 0 deletions helm/tilt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ options:
operatorController:
features:
enabled:
- SingleOwnNamespaceInstallSupport
- PreflightPermissions
- HelmChartSupport
disabled:
Expand Down
4 changes: 2 additions & 2 deletions internal/operator-controller/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ var operatorControllerFeatureGates = map[featuregate.Feature]featuregate.Feature
// registry+v1 cluster extensions with single or own namespaces modes
// i.e. with a single watch namespace.
SingleOwnNamespaceInstallSupport: {
Default: true,
PreRelease: featuregate.GA,
Default: false,
PreRelease: featuregate.Alpha,
LockToDefault: false,
},

Expand Down
1 change: 1 addition & 0 deletions manifests/experimental-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,7 @@ spec:
- --metrics-bind-address=:8443
- --pprof-bind-address=:6060
- --leader-elect
- --feature-gates=SingleOwnNamespaceInstallSupport=true
- --feature-gates=PreflightPermissions=true
- --feature-gates=HelmChartSupport=true
- --feature-gates=BoxcutterRuntime=true
Expand Down
1 change: 1 addition & 0 deletions manifests/experimental.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,7 @@ spec:
- --health-probe-bind-address=:8081
- --metrics-bind-address=:8443
- --leader-elect
- --feature-gates=SingleOwnNamespaceInstallSupport=true
- --feature-gates=PreflightPermissions=true
- --feature-gates=HelmChartSupport=true
- --feature-gates=BoxcutterRuntime=true
Expand Down
38 changes: 0 additions & 38 deletions manifests/standard-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -669,44 +669,6 @@ spec:
description: spec is an optional field that defines the desired state
of the ClusterExtension.
properties:
config:
description: |-
config is optional and specifies bundle-specific configuration.
Configuration is bundle-specific and a bundle may provide a configuration schema.
When not specified, the default configuration of the resolved bundle is used.

config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide
a configuration schema the bundle is deemed to not be configurable. More information on how
to configure bundles can be found in the OLM documentation associated with your current OLM version.
properties:
configType:
description: |-
configType is required and specifies the type of configuration source.

The only allowed value is "Inline".

When set to "Inline", the cluster extension configuration is defined inline within the ClusterExtension resource.
enum:
- Inline
type: string
inline:
description: |-
inline contains JSON or YAML values specified directly in the ClusterExtension.

It is used to specify arbitrary configuration values for the ClusterExtension.
It must be set if configType is 'Inline' and must be a valid JSON/YAML object containing at least one property.
The configuration values are validated at runtime against a JSON schema provided by the bundle.
minProperties: 1
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configType
type: object
x-kubernetes-validations:
- message: inline is required when configType is Inline, and forbidden
otherwise
rule: 'has(self.configType) && self.configType == ''Inline'' ?has(self.inline)
: !has(self.inline)'
install:
description: |-
install is optional and configures installation options for the ClusterExtension,
Expand Down
38 changes: 0 additions & 38 deletions manifests/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -630,44 +630,6 @@ spec:
description: spec is an optional field that defines the desired state
of the ClusterExtension.
properties:
config:
description: |-
config is optional and specifies bundle-specific configuration.
Configuration is bundle-specific and a bundle may provide a configuration schema.
When not specified, the default configuration of the resolved bundle is used.

config is validated against a configuration schema provided by the resolved bundle. If the bundle does not provide
a configuration schema the bundle is deemed to not be configurable. More information on how
to configure bundles can be found in the OLM documentation associated with your current OLM version.
properties:
configType:
description: |-
configType is required and specifies the type of configuration source.

The only allowed value is "Inline".

When set to "Inline", the cluster extension configuration is defined inline within the ClusterExtension resource.
enum:
- Inline
type: string
inline:
description: |-
inline contains JSON or YAML values specified directly in the ClusterExtension.

It is used to specify arbitrary configuration values for the ClusterExtension.
It must be set if configType is 'Inline' and must be a valid JSON/YAML object containing at least one property.
The configuration values are validated at runtime against a JSON schema provided by the bundle.
minProperties: 1
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configType
type: object
x-kubernetes-validations:
- message: inline is required when configType is Inline, and forbidden
otherwise
rule: 'has(self.configType) && self.configType == ''Inline'' ?has(self.inline)
: !has(self.inline)'
install:
description: |-
install is optional and configures installation options for the ClusterExtension,
Expand Down
Loading
Loading