Skip to content

Commit 9c81cc7

Browse files
Merge pull request #1307 from madorn/patch-1
Add some examples for Subscription config feature
2 parents 3ff7ed9 + fc91161 commit 9c81cc7

File tree

1 file changed

+61
-9
lines changed

1 file changed

+61
-9
lines changed

doc/design/subscription-config.md

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,85 @@
22

33
## Configuring Operators deployed by OLM
44

5-
It is possible to configure how OLM deploys an operator via the `config` field in the [subscription](../../pkg/api/apis/operators/subscription_types.go) object.
5+
It is possible to configure how OLM deploys an Operator via the `config` field in the [Subscription](https://github.com/operator-framework/operator-lifecycle-manager/blob/master/doc/install/install.md#subscribe-to-a-package-and-channel) object.
66

7-
Currently, the OLM supports the following configurations:
7+
Currently, OLM supports the following configurations:
88

99
### Env
1010

11-
The `Env` field defines a list of environment variables that must exist in all containers in the `pod` created by OLM.
11+
The `env` field defines a list of [Environment Variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#define-an-environment-variable-for-a-container) that must exist in all containers in the Pod created by OLM.
1212

1313
> Note: Values defined here will overwrite existing environment variables of the same name.
1414
15+
#### Example
16+
17+
Increase log verbosity on an Operator's container that utilizes the `ARGS` variable:
18+
19+
```
20+
kind: Subscription
21+
metadata:
22+
name: prometheus
23+
spec:
24+
package: prometheus
25+
channel: alpha
26+
config:
27+
env:
28+
- name: ARGS
29+
value: "-v=10"
30+
```
31+
1532
### EnvFrom
1633

17-
The `EnvFrom` field defines a list of sources to populate environment variables in the container.
18-
The keys defined within a source must be a C_IDENTIFIER.
19-
All invalid keys will be reported as an event when the container is starting.
20-
When a key exists in multiple sources, the value associated with the last source will take precedence.
34+
The `envFrom` field defines a [list of sources to populate Environment Variables](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables) in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence.
2135

2236
> Note: Values defined by an Env with a duplicate key will take precedence.
2337
38+
#### Example
39+
40+
Inject a license key residing in a Secret to unlock Operator features:
41+
42+
```
43+
kind: Subscription
44+
metadata:
45+
name: my-operator
46+
spec:
47+
package: app-operator
48+
channel: stable
49+
config:
50+
envFrom:
51+
- secretRef:
52+
name: license-secret
53+
```
54+
2455
### Volumes
2556

26-
The `Volumes` field defines a list of [volumes](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist on the `pod` created by OLM.
57+
The `volumes` field defines a list of [Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist on the Pod created by OLM.
2758

2859
> Note: Volumes defined here will overwrite existing Volumes of the same name.
2960
3061
### VolumeMounts
3162

32-
The `VolumeMounts` field defines a list of [volumeMounts](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist in all containers in the `pod` created by OLM. If a `volumeMount` references a `volume` that does not exist, OLM will fail to deploy the operator.
63+
The `volumeMounts` field defines a list of [VolumeMounts](https://kubernetes.io/docs/concepts/storage/volumes/) that must exist in all containers in the Pod created by OLM. If a `volumeMount` references a `volume` that does not exist, OLM will fail to deploy the operator.
3364

3465
> Note: VolumeMounts defined here will overwrite existing VolumeMounts of the same name.
66+
67+
#### Example
68+
69+
Mount a ConfigMap as a Volume that contains configuration information that can change default Operator behavior. Modifications to the content of the ConfigMap should appear within the container's VolumeMount.
70+
71+
```
72+
kind: Subscription
73+
metadata:
74+
name: my-operator
75+
spec:
76+
package: etcd
77+
channel: alpha
78+
config:
79+
volumes:
80+
- name: config-volume
81+
configMap:
82+
name: etcd-operator-config
83+
volumeMounts:
84+
- mountPath: /config
85+
name: config-volume
86+
```

0 commit comments

Comments
 (0)