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
DX-1282 Load secret data to environment variables (#4493)
* Update tyk-stack-chart with example for how to load secret data to environment variables
---------
Co-authored-by: dcs3spp <dcs3spp@users.noreply.github.com>
You can update any value in your local `values.yaml` file and use `-f [filename]` flag to override default values during installation.
101
101
Alternatively, you can use `--set` flag to set it in Tyk installation. See [Using Helm](https://helm.sh/docs/intro/using_helm/) for examples.
102
102
103
-
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}). Additionally, should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
103
+
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}).
104
+
105
+
### Setting Environment Variables
106
+
Should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
104
107
105
108
Example of setting extra environment variable to gateway:
106
109
```yaml
@@ -111,6 +114,32 @@ tyk-gateway:
111
114
value: debug
112
115
```
113
116
117
+
An example is listed below for setting extra [environment variable using ConfigMap data](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data), using gateway:
118
+
```yaml
119
+
tyk-gateway:
120
+
gateway:
121
+
extraEnvs:
122
+
- name: CONFIG_USERNAME
123
+
valueFrom:
124
+
configMapKeyRef:
125
+
name: backend-user
126
+
key: backend-username
127
+
```
128
+
129
+
An example is listed below for setting extra [environment variable using secret data](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data), using gateway:
130
+
```yaml
131
+
tyk-gateway:
132
+
gateway:
133
+
extraEnvs:
134
+
- name: SECRET_USERNAME
135
+
valueFrom:
136
+
secretKeyRef:
137
+
name: backend-user
138
+
key: backend-username
139
+
```
140
+
141
+
In the above example, an extra environment variable `SECRET_USERNAME` will be added to the Gateway container, with a value of `backend-username` associated with the secret `backend-user`. It is useful if you want to access secret data from [Tyk Gateway configuration file (tyk.conf) or API definitions]({{<ref "tyk-configuration-reference/kv-store#how-to-access-the-externally-stored-data">}}).
142
+
114
143
### Set Redis Connection Details (Required)
115
144
116
145
Tyk uses Redis for distributed rate-limiting and token storage. You may use the [Bitnami chart](https://github.com/bitnami/charts/tree/main/bitnami/redis) or Tyk's [simple-redis](https://artifacthub.io/packages/helm/tyk-helm/simple-redis) to install chart for POC purpose.
Copy file name to clipboardExpand all lines: tyk-docs/content/product-stack/tyk-charts/tyk-data-plane-chart.md
+31-11Lines changed: 31 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,11 @@ helm show values tyk-helm/tyk-data-plane > values.yaml
89
89
You can update any value in your local `values.yaml` file and use `-f [filename]` flag to override default values during installation.
90
90
Alternatively, you can use `--set` flag to set it in Tyk installation.
91
91
92
-
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}). Additionally, should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
92
+
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}).
93
+
94
+
95
+
### Setting Environment Variables
96
+
Should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
93
97
94
98
Example of setting extra environment variable to gateway:
95
99
```yaml
@@ -100,6 +104,32 @@ tyk-gateway:
100
104
value: debug
101
105
```
102
106
107
+
An example is listed below for setting extra [environment variable using ConfigMap data](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data), using gateway:
108
+
```yaml
109
+
tyk-gateway:
110
+
gateway:
111
+
extraEnvs:
112
+
- name: CONFIG_USERNAME
113
+
valueFrom:
114
+
configMapKeyRef:
115
+
name: backend-user
116
+
key: backend-username
117
+
```
118
+
119
+
An example is listed below for setting extra [environment variable using secret data](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data), using gateway:
120
+
```yaml
121
+
tyk-gateway:
122
+
gateway:
123
+
extraEnvs:
124
+
- name: SECRET_USERNAME
125
+
valueFrom:
126
+
secretKeyRef:
127
+
name: backend-user
128
+
key: backend-username
129
+
```
130
+
131
+
In the above example, an extra environment variable `SECRET_USERNAME` will be added to the Gateway container, with a value of `backend-username` associated with the secret `backend-user`. It is useful if you want to access secret data from [Tyk Gateway configuration file (tyk.conf) or API definitions]({{<ref "tyk-configuration-reference/kv-store#how-to-access-the-externally-stored-data">}}).
132
+
103
133
### Set Redis Connection Details (Required)
104
134
105
135
Tyk uses Redis for distributed rate-limiting and token storage. You may use the [Bitnami chart](https://github.com/bitnami/charts/tree/main/bitnami/redis) to install or Tyk's `simple-redis` chart for POC purpose.
@@ -356,16 +386,6 @@ Configure the gateways to load APIs with specific tags only by enabling `tyk-gat
356
386
tags: "edge,dc1,product"
357
387
```
358
388
359
-
#### Setting Environment Variable
360
-
361
-
You can add environment variables for Tyk Gateway under `extraEnvs`. This can be used to override any default settings in the chart, e.g.
362
-
363
-
```yaml
364
-
extraEnvs:
365
-
- name: TYK_GW_HASHKEYS
366
-
value: "false"
367
-
```
368
-
369
389
For further details for configuring Tyk Gateway, please consult the [Tyk Gateway Configuration Options]({{<ref "tyk-oss-gateway/configuration">}}) guide.
Copy file name to clipboardExpand all lines: tyk-docs/content/product-stack/tyk-charts/tyk-oss-chart.md
+30-11Lines changed: 30 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,10 @@ helm show values tyk-helm/tyk-oss > values.yaml
77
77
You can update any value in your local `values.yaml` file and use `-f [filename]` flag to override default values during installation.
78
78
Alternatively, you can use `--set` flag to set it in Tyk installation.
79
79
80
-
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}). Additionally, should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
80
+
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}).
81
+
82
+
### Setting Environment Variables
83
+
Should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
81
84
82
85
Example of setting extra environment variable to gateway:
83
86
```yaml
@@ -88,6 +91,32 @@ tyk-gateway:
88
91
value: debug
89
92
```
90
93
94
+
An example is listed below for setting extra [environment variable using ConfigMap data](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data), using gateway:
95
+
```yaml
96
+
tyk-gateway:
97
+
gateway:
98
+
extraEnvs:
99
+
- name: CONFIG_USERNAME
100
+
valueFrom:
101
+
configMapKeyRef:
102
+
name: backend-user
103
+
key: backend-username
104
+
```
105
+
106
+
An example is listed below for setting extra [environment variable using secret data](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data), using gateway:
107
+
```yaml
108
+
tyk-gateway:
109
+
gateway:
110
+
extraEnvs:
111
+
- name: SECRET_USERNAME
112
+
valueFrom:
113
+
secretKeyRef:
114
+
name: backend-user
115
+
key: backend-username
116
+
```
117
+
118
+
In the above example, an extra environment variable `SECRET_USERNAME` will be added to the Gateway container, with a value of `backend-username` associated with the secret `backend-user`. It is useful if you want to access secret data from [Tyk Gateway configuration file (tyk.conf) or API definitions]({{<ref "tyk-configuration-reference/kv-store#how-to-access-the-externally-stored-data">}}).
119
+
91
120
### Set Redis Connection Details (Required)
92
121
93
122
Tyk uses Redis for distributed rate-limiting and token storage. You may use the [Bitnami chart](https://github.com/bitnami/charts/tree/main/bitnami/redis) to install or Tyk's `simple-redis` chart for POC purpose.
@@ -320,16 +349,6 @@ You can configure persistent volume for APIs, Policies, and middlewares using `e
320
349
mountPath: /mnt/tyk-gateway/middleware
321
350
```
322
351
323
-
#### Setting Environment Variables
324
-
325
-
You can add environment variables for Tyk Gateway under `extraEnvs`. This can be used to override any default settings in the chart, e.g.
326
-
327
-
```yaml
328
-
extraEnvs:
329
-
- name: TYK_GW_HASHKEYS
330
-
value: "false"
331
-
```
332
-
333
352
For further details for configuring Tyk Gateway, consult the [Tyk Gateway Configuration Options]({{<ref "tyk-oss-gateway/configuration">}}) guide.
Copy file name to clipboardExpand all lines: tyk-docs/content/product-stack/tyk-charts/tyk-stack-chart.md
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,10 @@ helm show values tyk-helm/tyk-stack > values.yaml
94
94
You can update any value in your local `values.yaml` file and use `-f [filename]` flag to override default values during installation.
95
95
Alternatively, you can use `--set` flag to set it in Tyk installation. See [Using Helm](https://helm.sh/docs/intro/using_helm/) for examples.
96
96
97
-
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}). Additionally, should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
97
+
To configure Tyk components, users can utilize both config files and [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/). Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined [values](https://helm.sh/docs/chart_best_practices/values/). This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the [configuration documentation]({{<ref "tyk-environment-variables">}}).
98
+
99
+
### Setting Environment Variables
100
+
Should any environment variables not be set by the Helm Chart, users can easily add them under the `extraEnvs` section within the charts for further customization. Values set under `extraEnvs` would take precedence over all configurations.
98
101
99
102
Example of setting extra environment variable to gateway:
100
103
```yaml
@@ -105,6 +108,32 @@ tyk-gateway:
105
108
value: debug
106
109
```
107
110
111
+
An example is listed below for setting extra [environment variable using ConfigMap data](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data), using gateway:
112
+
```yaml
113
+
tyk-gateway:
114
+
gateway:
115
+
extraEnvs:
116
+
- name: CONFIG_USERNAME
117
+
valueFrom:
118
+
configMapKeyRef:
119
+
name: backend-user
120
+
key: backend-username
121
+
```
122
+
123
+
An example is listed below for setting extra [environment variable using secret data](https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data), using gateway:
124
+
```yaml
125
+
tyk-gateway:
126
+
gateway:
127
+
extraEnvs:
128
+
- name: SECRET_USERNAME
129
+
valueFrom:
130
+
secretKeyRef:
131
+
name: backend-user
132
+
key: backend-username
133
+
```
134
+
135
+
In the above example, an extra environment variable `SECRET_USERNAME` will be added to the Gateway container, with a value of `backend-username` associated with the secret `backend-user`. It is useful if you want to access secret data from [Tyk Gateway configuration file (tyk.conf) or API definitions]({{<ref "tyk-configuration-reference/kv-store#how-to-access-the-externally-stored-data">}}).
136
+
108
137
### Set Redis Connection Details (Required)
109
138
110
139
Tyk uses Redis for distributed rate-limiting and token storage. You may use the Bitnami chart to install or Tyk's `simple-redis` chart for POC purpose.
0 commit comments