You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README.md to have consistent headings, and remove outdated
information from sections. Add a section referencing the
DevWorkspaceOperatorConfig object.
Signed-off-by: Angel Misevski <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+75-21Lines changed: 75 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,43 @@
4
4
5
5
Dev Workspace operator repository that contains the controller for the DevWorkspace Custom Resource. The Kubernetes API of the DevWorkspace is defined in the https://github.com/devfile/api repository.
6
6
7
-
## DevWorkspace CR
7
+
## Configuration
8
+
9
+
### Global configuration for the DevWorkspace Operator
10
+
11
+
The DevWorkspace Operator installs the DevWorkspaceOperatorConfig custom resource (short name: `dwoc`). To configure global behavior of the DevWorkspace Operator, create a DevWorkspaceOperatorConfig named `devworkspace-operator-config` in the same namespace where the operator is deployed:
12
+
```yaml
13
+
apiVersion: controller.devfile.io/v1alpha1
14
+
kind: DevWorkspaceOperatorConfig
15
+
metadata:
16
+
name: devworkspace-operator-config
17
+
namespace: $OPERATOR_INSTALL_NAMESPACE
18
+
config:
19
+
# Configuration fields
20
+
```
21
+
22
+
To apply a configuration to specific workspaces instead of globally, an existing DevWorkspaceOperatorConfig can be referenced in a DevWorkspace's attributes:
23
+
```yaml
24
+
apiVersion: workspace.devfile.io/v1alpha2
25
+
kind: DevWorkspace
26
+
metadata:
27
+
name: my-devworkspace
28
+
spec:
29
+
template:
30
+
attributes:
31
+
controller.devfile.io/devworkspace-config:
32
+
name: <name of DevWorkspaceOperatorConfig CR>
33
+
namespace: <namespace of DevWorkspaceOperatorConfig CR>
34
+
```
35
+
Configuration specified as above will be merged into the default global configuration, overriding any values present.
36
+
37
+
To see all all configuration options, see `kubectl explain dwoc.config`, `kubectl explain dwoc.config.workspace`, etc.
8
38
9
39
### Additional configuration
10
40
11
-
DevWorkspaces can be configured through DevWorkspace attributes and Kubernetes labels/annotations. For a list of all options available, see [additional documentation](docs/additional-configuration.adoc).
41
+
DevWorkspaces can be further configured through DevWorkspace attributes and Kubernetes labels/annotations. For a list of all options available, see [additional documentation](docs/additional-configuration.adoc).
12
42
13
-
####Restricted Access
43
+
### Restricted Access
14
44
15
45
The `controller.devfile.io/restricted-access` annotation specifies that a DevWorkspace needs additional access control (in addition to RBAC). When a DevWorkspace is created with the `controller.devfile.io/restricted-access` annotation set to `true`, the webhook server will guarantee
16
46
- Only the DevWorkspace Operator ServiceAccount or DevWorkspace creator can modify important fields in the DevWorkspace
@@ -24,24 +54,25 @@ metadata:
24
54
annotations:
25
55
controller.devfile.io/restricted-access: true
26
56
```
27
-
## Prerequisites
57
+
58
+
## Deploying DevWorkspace Operator
59
+
60
+
### Prerequisites
28
61
- go 1.16 or later
29
62
- git
30
63
- sed
31
64
- jq
32
65
- yq (python-yq from https://github.com/kislyuk/yq#installation, other distributions may not work)
33
66
- skopeo (if building the OLM catalogsource)
34
-
- docker
67
+
- podman or docker
35
68
36
69
Note: kustomize `v4.0.5` is required for most tasks. It is downloaded automatically to the `.kustomize` folder in this repo when required. This downloaded version is used regardless of whether or not kustomize is already installed on the system.
37
70
38
-
## Running the controller in a cluster
71
+
### Running the controller in a cluster
39
72
40
-
### With yaml resources
73
+
#### With yaml resources
41
74
42
-
When deployed to Kubernetes, the controller requires [cert-manager](https://cert-manager.io) running in the cluster.
43
-
You can install it using `make install_cert_manager` if you don't run it already.
44
-
The minimum version of cert-manager is `v1.0.4`.
75
+
When installing on Kubernetes clusters, the DevWorkspace Operator requires the [cert-manager](https://cert-manager.io) operator in order to properly serve webhooks. To install the latest version of cert-manager in a cluster, the Makefile rule `install_cert_manager` can be used. The minimum version of cert-manager is `v1.0.4`.
45
76
46
77
The controller can be deployed to a cluster provided you are logged in with cluster-admin credentials:
47
78
@@ -62,17 +93,34 @@ See below for all environment variables used in the makefile.
62
93
> }
63
94
> ```
64
95
65
-
### With OLM
96
+
#### With Operator Lifecycle Manager (OLM)
66
97
67
-
DevWorkspace Operator has bundle and index images which allow to install it with OLM.
68
-
You need to register custom catalog source to make it available on your cluster with help:
DevWorkspace Operator has bundle and index images which enable installation via OLM. To enable installing the DevWorkspace Operator through OLM, it may be necessary to create a CatalogSource in the cluster for this index:
99
+
```yaml
100
+
apiVersion: operators.coreos.com/v1alpha1
101
+
kind: CatalogSource
102
+
metadata:
103
+
name: devworkspace-operator-catalog
104
+
namespace: openshift-marketplace # Namespace for catalogsource, not operator itself
When running locally, only a single namespace is watched; as a result, all devworkspaces have to be deployed to `${NAMESPACE}`
129
-
130
180
### Run controller locally and debug
131
181
Debugging the controller depends on [delve](https://github.com/go-delve/delve) being installed (`go install github.com/go-delve/delve/cmd/dlv@latest`). Note that `$GOPATH/bin` or `$GOBIN` must be added to `$PATH` in order for `make debug` to run correctly.
132
182
133
183
```bash
134
184
make install
185
+
# Wait for webhook server to start
186
+
kubectl rollout status deployment devworkspace-controller-manager -n $NAMESPACE --timeout 90s
187
+
kubectl rollout status deployment devworkspace-webhook-server -n $NAMESPACE --timeout 90s
0 commit comments