# etcd-backup addon fails to generate backups if ETCDCTL\_CACERT, ETCDCTL\_CERT and ETCDCTL\_KEY is set i

## Problem

* etcd-backup addon fails to generate backups if ETCDCTLCACERT, ETCDCTL CERT and ETCDCTL\_KEY is set in the cronjob.
* Below environment variables are set in etcd-backup cronjob:

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl -n kube-system get cronjob etcd-backup-with-interval -o yaml |grep -A7 ETCDCTL_CACERT
            - name: ETCDCTL_CACERT
              value: /certs/apiserver/etcd/ca.crt
            - name: ETCDCTL_CERT
              value: /certs/apiserver/etcd/request.crt
            - name: ETCDCTL_KEY
              value: /certs/apiserver/etcd/request.key
```

{% endtab %}
{% endtabs %}

* etcd-backup pods remain in NotReady state:

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl get pod -o wide | grep etcd
etcd-backup-with-interval-27801890-zjghf   1/2     NotReady   0                7m41s   10.164.209.47    10.164.209.47   <none>           <none>
```

{% endtab %}
{% endtabs %}

* db.part files are created in the backup path:

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl logs etcd-backup-with-interval-27801890-zjghf etcd-backup
{"level":"info","ts":1668113401.1358364,"caller":"snapshot/v3_snapshot.go:119","msg":"created temporary db file","path":"/backup/etcd-snapshot-2022-11-10_20:50:01_UTC.db.part"}%
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed Kubernetes - v5.6.1(kubernetes version 1.23)

## Resolution

* Edit the cronjob and remove below 6 environment variables:

{% tabs %}
{% tab title="Javascript" %}

```javascript
# kubectl -n kube-system edit cronjob etcd-backup-with-interval

>> Remove below 6 lines and save the config:
            - name: ETCDCTL_CACERT
              value: /certs/apiserver/etcd/ca.crt
            - name: ETCDCTL_CERT
              value: /certs/apiserver/etcd/request.crt
            - name: ETCDCTL_KEY
              value: /certs/apiserver/etcd/request.key
```

{% endtab %}
{% endtabs %}

* Then check if the backups work.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmk/solutions/etcd-backup-addon-fails-to-generate-backups-if-etcdctl-cacert--e.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
