etcd-io / etcd-io/etcd-operator
TLS: provisioned server/peer cert secrets are never mounted into the etcd container
- Dominant language
- Go
- Stars
- 164
- Forks
- 72
- Avg merge
- 22h 46m
- Merged PRs (30d)
- 34
Description
### Problem
When `spec.tls` is set, `createOrPatchStatefulSet` adds the `server-secret` and `peer-secret` as pod **Volumes** (`internal/controller/utils.go:195-211`), but the etcd container has no corresponding **VolumeMounts** — the only mount on the container is the data dir, gated on `StorageSpec` (`utils.go:257`). The provisioned certificates are therefore never visible to the etcd process.
This is the first of a short series to wire TLS into the etcd data path (the operator currently provisions cert-manager Certificates but runs etcd in cleartext): **mount certs → emit TLS flags/scheme → give the operator's own client TLS.**
### Proposed change
Add `VolumeMount`s for the server/peer cert secrets (e.g. `/etc/etcd/server-tls/`, `/etc/etcd/peer-tls/`), gated on `spec.tls != nil`. With no TLS flags yet, mounting unused cert files is a safe no-op, so this is independently shippable. Unit test asserts the mounts are present when TLS is set and absent otherwise. PR to follow.
Contributor guide
Research direction
Start in internal/controller/utils.go, especially createOrPatchStatefulSet and the volume handling around lines 195-211 and 257. Trace how spec.tls and the server-secret and peer-secret volumes reach the etcd container, then add a unit test covering TLS and non-TLS StatefulSets. Done means both certificate secrets are mounted only when TLS is configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100