Skip to content

Extend Etcd CR to specify additional env/volumes/volumeMounts in the StatefulSet definition#1319

Open
CaptainIRS wants to merge 1 commit intogardener:masterfrom
CaptainIRS:etcd-cr-fields
Open

Extend Etcd CR to specify additional env/volumes/volumeMounts in the StatefulSet definition#1319
CaptainIRS wants to merge 1 commit intogardener:masterfrom
CaptainIRS:etcd-cr-fields

Conversation

@CaptainIRS
Copy link
Copy Markdown
Member

/area usability
/kind enhancement api-change

What this PR does / why we need it:

Adds new optional fields env and volumeMounts to both spec.etcd and spec.backup, and a volumes field to spec in the Etcd CR. These fields allow specifying additional environment variables, volume mounts, and volumes to be added to the etcd and backup-restore containers in the StatefulSet definition. Since volumes are a pod-level concept in Kubernetes, the volumes field is placed at spec.volumes rather than being duplicated under each container section.

This provides more options to customize the StatefulSet spec for use-cases like Gardener's Self-Hosted Shoot Clusters.

Which issue(s) this PR fixes:
Fixes #1317

Checklist:

  • Update documentation in the /docs folder (if applicable)
  • Add tests that cover your changes (if applicable)
    • Unit tests
    • Integration tests
    • E2E tests

Special notes for your reviewer:

  • The additional env vars and volume mounts are appended after controller-managed ones. For env vars on the backup-restore container, controller-generated vars (e.g., POD_NAME, provider credentials) take precedence since they appear first in the slice.
  • Volumes (spec.volumes) are pod-level, matching Kubernetes semantics. They are appended after controller-managed volumes in both the StatefulSet builder and the compaction job.

Release note:

Etcd CR now supports `spec.etcd.{env,volumeMounts}`, `spec.backup.{env,volumeMounts}`, and `spec.volumes` fields to specify additional environment variables, volume mounts, and volumes for the etcd and backup-restore containers in the StatefulSet.

@CaptainIRS CaptainIRS requested a review from a team as a code owner April 1, 2026 09:29
@gardener-prow gardener-prow Bot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. area/usability Usability related kind/enhancement Enhancement, improvement, extension kind/api-change API change with impact on API users size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 1, 2026
@gardener-prow gardener-prow Bot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 1, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ishan16696 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow Bot added the cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. label Apr 2, 2026
@gardener-prow gardener-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 13, 2026
@ishan16696
Copy link
Copy Markdown
Member

@CaptainIRS kindly asking you to rebase this PR on master and resolve the conflicts

@gardener-prow gardener-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2026
Add `env` and `volumeMounts` fields to both `EtcdConfig` and
`BackupSpec`, and a `volumes` field to `EtcdSpec` to allow specifying
additional environment variables, volume mounts, and volumes in the
etcd and backup-restore containers of the StatefulSet definition.

Since volumes are a pod-level concept in Kubernetes, `volumes` is
placed at `spec.volumes` rather than being duplicated under each
container section.

Add validations for new fields
@Shreyas-s14
Copy link
Copy Markdown
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/usability Usability related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend Etcd CR to specify additional env/volumes/volumeMounts in the StatefulSet definition

3 participants