# Adding credentials to helm chart

**URL:** https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420
**Category:** Elasticsearch
**Tags:** slm-snapshot-lifecycle-management
**Created:** [July 23, 2020, 11:43pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420 "2020-07-23T23:43:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [July 23, 2020, 11:43pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/1 "2020-07-23T23:43:54Z")

</div>

On this [page](https://hub.helm.sh/charts/elastic/elasticsearch) the section on adding a snapshot says:

1. Add any required secrets or credentials into an Elasticsearch keystore following the [how to use the keystore](https://github.com/elastic/helm-charts/tree/7.8/elasticsearch/README.md#how-to-use-the-keystore) guide.

But I am confused as to what to name the secret? For example when creating the `gcs.client.default.credentials_file` I get errors about DNS-1123:

```auto
kubectl create secret generic gcs.client.default.credentials_file --from-file=.gcs-key.json
The Secret "gcs.client.default.credentials_file" is invalid: metadata.name: Invalid value: "gcs.client.default.credentials_file": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

```

Can someone point me in the right direction here?

---

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [July 25, 2020, 3:17pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/2 "2020-07-25T15:17:32Z")

</div>

Also, copying and pasting the slack\_hook from the example does not work:

```auto
kubectl create secret generic slack_hook --from-literal=xpack.notification.slack.account.monitoring.secure_url='https://hooks.slack.com/services/asdasdasd/asdasdas/asdasd'
The Secret "slack_hook" is invalid: metadata.name: Invalid value: "slack_hook": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

```

---

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [July 25, 2020, 3:43pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/3 "2020-07-25T15:43:09Z")

</div>

submitting a github issue as this is broken

> <https://github.com/elastic/helm-charts/issues/747>
>
> Chart version:
> Kubernetes version:
> v1.18.6
> Kubernetes provider: E.g. GKE (Google Kubernetes Engine)
> bare-metal
> Helm Version:
> helm version
> Client: &version.Version{SemVer:"v2.16.9", GitCommit:"8ad7037828e5a0fca1009dabe290130da6368e39", GitTreeState:"clean"}
> Server: &version.Version{SemVer:"v2.16.1", GitCommit:"bbdfe5e7803a12bbdf97e94cd847859890cf4050", GitTreeState:"clean"}
> e.g. helm get elasticsearch (replace...

---

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [August 9, 2020, 2:30pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/4 "2020-08-09T14:30:54Z")

</div>

\_bump

---

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [August 18, 2020, 1:18am UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/5 "2020-08-18T01:18:23Z")

</div>

bumpity bump

---

<div class="post-metadata">

### Author: ![joshuacox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshuacox/32/55445_2.png) [@joshuacox](https://discuss.elastic.co/u/joshuacox)
#### Post date: [September 14, 2020, 4:18pm UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/6 "2020-09-14T16:18:53Z")

</div>

bumpity bump bump

---

<div class="post-metadata">

### Author: ![Julien\_MAILLERET](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julien_mailleret/32/45074_2.png) [@Julien\_MAILLERET](https://discuss.elastic.co/u/Julien_MAILLERET)
#### Post date: [September 16, 2020, 8:11am UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/7 "2020-09-16T08:11:00Z")

</div>

Answered in [https://github.com/elastic/helm-charts/issues/747#issuecomment-693247447](https://github.com/elastic/helm-charts/issues/747#issuecomment-693247447)

K8S doesn't accept `_` in secret names.  
[https://github.com/elastic/helm-charts/issues/811](https://github.com/elastic/helm-charts/issues/811) will fix the examples we provide.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 14, 2020, 8:11am UTC](https://discuss.elastic.co/t/adding-credentials-to-helm-chart/242420/8 "2020-10-14T08:11:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
