Skip to content

feat: add S3 endpoint override for S3-compatible storage#117

Merged
cwrau merged 7 commits into
mainfrom
feat/improve-etcd-backups
May 19, 2026
Merged

feat: add S3 endpoint override for S3-compatible storage#117
cwrau merged 7 commits into
mainfrom
feat/improve-etcd-backups

Conversation

@cwrau
Copy link
Copy Markdown
Member

@cwrau cwrau commented Apr 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 9, 2026 13:45
@cwrau cwrau enabled auto-merge April 9, 2026 13:45
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for S3-compatible storage by adding an Endpoint field to the ETCDBackup specification and enabling path-style S3 access. It also implements a deterministic @daily backup schedule that distributes backup tasks across an 8-hour window based on cluster identity to avoid concurrent resource spikes. Other changes include updating several dependencies, including the cluster namespace in S3 backup keys, and refining vulnerability scanning. Feedback includes a suggestion to simplify a conditional block in the new backup schedule logic and a recommendation to use a more granular endpoint resolver instead of the deprecated WithBaseEndpoint function.

Comment thread pkg/reconcilers/etcd_cluster/backup_schedule.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurability for ETCD S3 backups to support S3-compatible storage by allowing an endpoint override, and introduces deterministic spreading for @daily backup schedules to avoid thundering-herd backup runs across clusters.

Changes:

  • Add spec.etcd.backup.endpoint to the HostedControlPlane API and wire it into the AWS SDK S3 client configuration (base endpoint + path-style addressing).
  • Introduce resolveBackupSchedule to expand @daily into a deterministic, cluster-identity-based cron time window and update reconciler logic/tests accordingly.
  • Update S3 backup key prefixing and refresh several Go dependencies / minor refactors.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
taskfile.yaml Adjusts Grype scan invocation (adds --only-fixed).
pkg/reconcilers/etcd_cluster/s3_client/s3_client.go Adds endpoint override handling, path-style option, and changes S3 key prefixing.
pkg/reconcilers/etcd_cluster/reconciler.go Uses resolveBackupSchedule for schedule parsing/next-run computations.
pkg/reconcilers/etcd_cluster/reconciler_test.go Updates error assertion and adds coverage for @daily schedule spreading behavior.
pkg/reconcilers/etcd_cluster/backup_schedule.go New helper to deterministically resolve schedules (notably @daily).
pkg/reconcilers/etcd_cluster/backup_schedule_test.go New unit tests validating deterministic schedule resolution and window constraints.
pkg/reconcilers/apiserverresources/apiserverresources.go Minor cleanup: inline secret items conversion.
go.mod Bumps AWS SDK, Cilium, OTel, gRPC, k8s libs, controller-runtime, etc.
go.sum Corresponding dependency checksum updates.
api/v1alpha1/zz_generated.deepcopy.go DeepCopy updated for new ETCDBackup.Endpoint field.
api/v1alpha1/hostedcontrolplane_types.go Adds optional ETCDBackup.Endpoint field to the API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/backup_schedule.go
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from 193da89 to 78d8232 Compare April 14, 2026 10:01
Copilot AI review requested due to automatic review settings April 14, 2026 10:22
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from 78d8232 to edc9f91 Compare April 14, 2026 10:22
@cwrau cwrau changed the base branch from main to chore/remove-custom-kubeconfig April 14, 2026 10:23
auto-merge was automatically disabled April 14, 2026 10:23

Merge commits are not allowed on this repository

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

api/v1alpha1/hostedcontrolplane_types.go:79

  • This PR is titled as adding an S3 endpoint override, but it also removes the customKubeconfigs API surface (types, webhook validation, cert generation, and tests). That’s a significant behavior/API change and looks unrelated to S3 endpoint overrides; consider splitting the custom-kubeconfig removal into a separate PR (or updating the PR description/title and documenting the breaking change/migration).
type HostedControlPlaneInlineSpec struct {
	//+kubebuilder:validation:Optional
	Deployment HostedControlPlaneDeployment `json:"deployment,omitempty"`
	//+kubebuilder:validation:Required
	Gateway GatewayReference `json:"gateway"`

	//+kubebuilder:validation:Optional
	KonnectivityClient ScalablePod `json:"konnectivityClient,omitempty"`
	//+kubebuilder:validation:Optional
	KubeProxy KubeProxyComponent `json:"kubeProxy,omitempty"`
	//+kubebuilder:validation:Optional
	CoreDNS ScalablePod `json:"coredns,omitempty"`
	//+kubebuilder:validation:Optional
	ETCD ETCDComponent `json:"etcd,omitempty"`
	// OIDCProviders configures structured JWT/OIDC authentication.
	// The key is the issuer URL. If non-empty, an AuthenticationConfiguration
	// is generated and passed to the API server via --authentication-config.
	//+kubebuilder:validation:Optional
	OIDCProviders map[string]OIDCProvider `json:"oidcProviders,omitempty"`
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/reconcilers/etcd_cluster/reconciler.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Base automatically changed from chore/remove-custom-kubeconfig to main April 15, 2026 14:29
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from 805e6fc to 30ae87a Compare April 16, 2026 08:10
Copilot AI review requested due to automatic review settings April 17, 2026 08:52
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from 30ae87a to b1fa153 Compare April 17, 2026 08:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/reconciler.go
Comment thread pkg/reconcilers/etcd_cluster/reconciler.go Outdated
Comment thread api/v1alpha1/hostedcontrolplane_types.go
Comment thread api/v1alpha1/hostedcontrolplane_types.go
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from b1fa153 to 0825a32 Compare April 20, 2026 10:16
Comment thread api/v1alpha1/hostedcontrolplane_types.go Outdated
@marvinWolff
Copy link
Copy Markdown
Contributor

Not necessarily for this PR, but i think it would be a good idea to export some metrics.

I think alerting on failing etcd-backups would be a good idea, for that we would need metrics.

@cwrau
Copy link
Copy Markdown
Member Author

cwrau commented Apr 23, 2026

Not necessarily for this PR, but i think it would be a good idea to export some metrics.

I think alerting on failing etcd-backups would be a good idea, for that we would need metrics.

This would already be covered by kube-state-metrics

Copilot AI review requested due to automatic review settings April 23, 2026 10:57
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch 2 times, most recently from 9a681f1 to efd2eee Compare April 23, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/reconcilers/etcd_cluster/reconciler.go
Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go Outdated
Comment thread api/v1alpha1/hostedcontrolplane_types.go Outdated
@marvinWolff
Copy link
Copy Markdown
Contributor

@cwrau can you check the pipeline?

Copilot AI review requested due to automatic review settings May 18, 2026 08:13
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from 266780d to e45d429 Compare May 18, 2026 08:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 18 comments.

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Language not supported

Comment thread pkg/reconcilers/etcd_cluster/reconciler.go
Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go Outdated
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
Comment thread pkg/reconcilers/etcd_cluster/reconciler.go Outdated
Comment thread api/v1alpha1/hostedcontrolplane_types.go
Comment thread pkg/reconcilers/etcd_cluster/etcd_client/etcd_client.go
Comment thread pkg/reconcilers/etcd_cluster/s3_client/s3_client.go
marvinWolff
marvinWolff previously approved these changes May 18, 2026
@cwrau cwrau added this pull request to the merge queue May 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 14:55
@cwrau cwrau force-pushed the feat/improve-etcd-backups branch from c2f1681 to 723fcfb Compare May 18, 2026 14:55
@cwrau cwrau enabled auto-merge May 18, 2026 14:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Language not supported

Comment thread api/v1alpha1/hostedcontrolplane_types.go
@cwrau cwrau added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 25af46d May 19, 2026
11 of 12 checks passed
@cwrau cwrau deleted the feat/improve-etcd-backups branch May 19, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants