Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Commit

Permalink
[elasticsearch] fix secrets names in examples (elastic#811)
Browse files Browse the repository at this point in the history
Kubernetes doesn't accept `_` characters in resources names.
This commit fix the secrets names in the examples we provide by
replacing `_` by `-`which Kubernetes is accepting.

Source: helm/helm#6477
  • Loading branch information
jmlrt committed Sep 16, 2020
1 parent 4e00f6d commit 17c880f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,16 @@ Create the secret, the key name needs to be the keystore key path. In this
example we will create a secret from a file and from a literal string.

```
kubectl create secret generic encryption_key --from-file=xpack.watcher.encryption_key=./watcher_encryption_key
kubectl create secret generic slack_hook --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
kubectl create secret generic encryption-key --from-file=xpack.watcher.encryption_key=./watcher_encryption_key
kubectl create secret generic slack-hook --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
```

To add these secrets to the keystore:

```
keystore:
- secretName: encryption_key
- secretName: slack_hook
- secretName: encryption-key
- secretName: slack-hook
```

#### Multiple keys
Expand All @@ -309,12 +309,12 @@ All keys in the secret will be added to the keystore. To create the previous
example in one secret you could also do:

```
kubectl create secret generic keystore_secrets --from-file=xpack.watcher.encryption_key=./watcher_encryption_key --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
kubectl create secret generic keystore-secrets --from-file=xpack.watcher.encryption_key=./watcher_encryption_key --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
```

```
keystore:
- secretName: keystore_secrets
- secretName: keystore-secrets
```

#### Custom paths and keys
Expand All @@ -327,15 +327,15 @@ example we will only add the `slack_hook` key from a secret that also has other
keys. Our secret looks like this:

```
kubectl create secret generic slack_secrets --from-literal=slack_channel='#general' --from-literal=slack_hook='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
kubectl create secret generic slack-secrets --from-literal=slack_channel='#general' --from-literal=slack_hook='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
```

We only want to add the `slack_hook` key to the keystore at path
`xpack.notification.slack.account.monitoring.secure_url`:

```
keystore:
- secretName: slack_secrets
- secretName: slack-secrets
items:
- key: slack_hook
path: xpack.notification.slack.account.monitoring.secure_url
Expand Down

0 comments on commit 17c880f

Please sign in to comment.