|
1 | 1 | ## Custom Secret Management |
2 | 2 |
|
| 3 | + |
3 | 4 | ### Overview |
4 | 5 |
|
5 | | -The stackstate/stackstate-k8s-agent (starting from version 1.0.79) supports specifying the name of a custom secret that contains the API key and cluster authorization token. This feature is useful for users who wish to manage their own secrets and avoid the automatic creation of secrets by the Helm chart. |
| 6 | +The SUSE Observability Agent supports specifying the name of a custom secret that contains the API key and cluster authorization token. This feature is useful for users who wish to manage their own secrets and avoid the automatic creation of secrets by the Helm chart. |
| 7 | + |
| 8 | +{% hint style="info" %} |
| 9 | +**There was a previous method of specifying this that is now deprecated, see the [deprecated method](./k8s-custom-secrets-setup-deprecated.md) .** |
| 10 | +{% endhint %} |
6 | 11 |
|
7 | 12 | ### Regarding the Helm Chart |
8 | 13 |
|
9 | 14 | #### Configuration Options |
10 | 15 |
|
11 | | -- `stackstate.manageOwnSecrets`: A boolean flag that determines whether the user wishes to manage their own secrets. Default value is `false`. |
12 | | -- `stackstate.customSecretName`: (Optional) Name of the custom secret to be created by the user. Required if `stackstate.manageOwnSecrets` is set to `true`. |
13 | | -- `stackstate.customApiKeySecretKey`: (Optional) Key name for the API key within the custom secret. Required if `stackstate.manageOwnSecrets` is set to `true`. |
14 | | -- `stackstate.customClusterAuthTokenSecretKey`: (Optional) Key name for the cluster authorization token within the custom secret. Required if `stackstate.manageOwnSecrets` is set to `true`. |
| 16 | +- `global.apiKey.fromSecret`: Specify a pre-existing secret name residing in the same namespace which contains an `STS_API_KEY` field containing the api key. |
| 17 | +- `global.clusterAgentAuthToken.fromSecret`: Specify a pre-existing secret name residing in the same namespace which contains an `STS_CLUSTER_AGENT_AUTH_TOKEN` field containing a token for securing connections between the cluster and node agents. |
15 | 18 |
|
16 | 19 | #### Behavior Description |
17 | 20 |
|
18 | | -- **Automatic Secret Creation**: By default, the chart continues to automatically create secrets as before if `stackstate.manageOwnSecrets` is set to `false`. |
19 | | -- **Custom Secret Management**: If `stackstate.manageOwnSecrets` is set to `true`, the chart expects the user to provide the name of the custom secret (`stackstate.customSecretName`) along with the keys for the API key and authorization token (`stackstate.customApiKeySecretKey` and `stackstate.customClusterAuthTokenSecretKey`, respectively). |
| 21 | +- **Automatic Secret Creation**: By default, the chart requires an `stackstate.apiKey` to be specified and will create a secret by itself. The `STS_CLUSTER_AGENT_AUTH_TOKEN` is generated automatically. |
| 22 | +- **Custom Secret Management**: When overriding the `fromSecret` fields, the api key and cluster auth token will be taken from those secrets. |
20 | 23 | - **Implied Omission**: When specifying that you would like to manage your own secrets, the chart will ignore values for `stackstate.apiKey` and `stackstate.cluster.authToken`. |
| 24 | + |
21 | 25 | ### How to Use in values.yaml |
22 | 26 |
|
23 | 27 | 1. **Using Automatic Secret Creation (Default)**: |
24 | 28 | ```yaml |
25 | 29 | stackstate: |
26 | | - manageOwnSecrets: false |
27 | 30 | apiKey: "<your api key>" |
28 | 31 | ``` |
29 | 32 |
|
30 | 33 | 2. **Managing Own Secrets**: |
31 | 34 | ```yaml |
32 | | - stackstate: |
33 | | - manageOwnSecrets: true |
34 | | - customSecretName: my-custom-secret |
35 | | - customApiKeySecretKey: api-key |
36 | | - customClusterAuthTokenSecretKey: auth-token |
| 35 | + global: |
| 36 | + apiKey: |
| 37 | + fromSecret: "name-of-my-api-key-secret" |
| 38 | + clusterAgentAuthToken: |
| 39 | + fromSecret: "name-of-my-cluster-agent-auth-token-secret" |
37 | 40 | ``` |
0 commit comments