github.com/operator-framework/operator-lifecycle-manager@v0.30.0/doc/design/subscription-config.md (about) 1 # Subscription Config 2 3 ## Configuring Operators deployed by OLM 4 5 It is possible to configure how OLM deploys an Operator via the `config` field in the [Subscription](https://github.com/operator-framework/olm-book/blob/master/docs/subscriptions.md) object. 6 7 Currently, OLM supports the following configurations: 8 9 ### Env 10 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. 12 13 > Note: Values defined here will overwrite existing environment variables of the same name. 14 15 #### Example 16 17 Increase log verbosity on an Operator's container that utilizes the `ARGS` variable: 18 19 ```yaml 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 32 ### EnvFrom 33 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. 35 36 > Note: Values defined by an Env with a duplicate key will take precedence. 37 38 #### Example 39 40 Inject a license key residing in a Secret to unlock Operator features: 41 42 ```yaml 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 55 ### Volumes 56 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. 58 59 > Note: Volumes defined here will overwrite existing Volumes of the same name. 60 61 ### VolumeMounts 62 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. 64 65 > 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 ```yaml 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 ``` 87 88 ### Tolerations 89 90 The `tolerations` field defines a list of [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) for the Pod created by OLM. 91 92 > Note: Tolerations defined here will be appended to existing Tolerations, if not already present. 93 94 #### Example 95 96 Inject toleration to tolerate all taints. 97 98 ```yaml 99 kind: Subscription 100 metadata: 101 name: my-operator 102 spec: 103 package: etcd 104 channel: alpha 105 config: 106 tolerations: 107 - operator: "Exists" 108 ``` 109 110 ### Resources 111 112 The `resources` field defines [Resource Constraints](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container) for all the containers in the Pod created by OLM. 113 114 > Note: Resource Constraints defined here will overwrite existing resource constraints. 115 116 #### Example 117 118 Inject a request of 0.25 cpu and 64 MiB of memory, and a limit of 0.5 cpu and 128MiB of memory in each container. 119 120 ```yaml 121 kind: Subscription 122 metadata: 123 name: my-operator 124 spec: 125 package: etcd 126 channel: alpha 127 config: 128 resources: 129 requests: 130 memory: "64Mi" 131 cpu: "250m" 132 limits: 133 memory: "128Mi" 134 cpu: "500m" 135 ``` 136 137 ### NodeSelector 138 139 The `nodeSelector` field defines a [NodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) for the Pod created by OLM. 140 141 #### Example 142 143 Inject `nodeSelector` key-values pairs. 144 145 ```yaml 146 kind: Subscription 147 metadata: 148 name: my-operator 149 spec: 150 package: etcd 151 channel: alpha 152 config: 153 nodeSelector: 154 foo: bar 155 ```