Skip to content

Added support for external etcd in cache-server#3831

Merged
kcp-ci-bot merged 2 commits intokcp-dev:mainfrom
gman0:cachedserver-external-etcd
Feb 10, 2026
Merged

Added support for external etcd in cache-server#3831
kcp-ci-bot merged 2 commits intokcp-dev:mainfrom
gman0:cachedserver-external-etcd

Conversation

@gman0
Copy link
Contributor

@gman0 gman0 commented Feb 10, 2026

Summary

This PR adds etcd flags to cache-server command. It's now possible to point the cache-server to an external etcd cluster:

$ ./bin/cache-server \
  --etcd-servers 127.0.0.1:8379 \
  --etcd-cafile ~/ws/etcd/certs/ca.pem \
  --etcd-certfile ~/ws/etcd/certs/client.pem \
  --etcd-keyfile ~/ws/etcd/certs/client-key.pem

Once running, it can be then referenced from the sharded-test-server like so:

UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \
  ./bin/sharded-test-server \
  --cache-kubeconfig=/home/rvasek/ws/kcp/standalone-cache-server/cache.kubeconfig \
  --quiet \
  --v=2 \
  --log-dir-path="/home/rvasek/ws/kcp/.kcp" \
  --work-dir-path="/home/rvasek/ws/kcp" \
  --shard-run-virtual-workspaces=false \
  --shard-feature-gates=WorkspaceMounts=true,CacheAPIs=true,WorkspaceAuthentication=true \
  --proxy-feature-gates=WorkspaceMounts=true,CacheAPIs=true,WorkspaceAuthentication=true \
  --number-of-shards=2

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #3822

Release Notes

cache-server: added etcd flags
sharded-test-server: added --cache-kubeconfig flag to use an external cache-server

On-behalf-of: @SAP robert.vasek@sap.com
Signed-off-by: Robert Vasek <robert.vasek@clyso.com>
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 10, 2026
Copy link
Member

@ntnn ntnn left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2026
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

DetailsGit tree hash: 22601de6f4db01b1c615b0791f2213d83b5bbdc3

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ntnn

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

The pull request process is described 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

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2026
@ntnn
Copy link
Member

ntnn commented Feb 10, 2026

/test pull-kcp-test-e2e-sharded

flake #3811 :(

@cnvergence
Copy link
Member

@ntnn eh, let's give it another shot then

numberOfShards := flag.Int("number-of-shards", 1, "The number of shards to create. The first created is assumed root.")
cacheSyntheticDelay := flag.Duration("cache-synthetic-delay", 0, "The duration of time the cache server will inject a delay for to all inbound requests.")
quiet := flag.Bool("quiet", false, "Suppress output of the subprocesses")
cacheServerKubeconfig := flag.String("cache-kubeconfig", "", "Path to a kubeconfig of an external cache-server. If empty, a dedicated cache-server is started.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cacheServerKubeconfig := flag.String("cache-kubeconfig", "", "Path to a kubeconfig of an external cache-server. If empty, a dedicated cache-server is started.")
cacheServerKubeconfig := flag.String("cache-kubeconfig", "", "Path to a kubeconfig of an external cache server. If empty, a dedicated cache server is started.")

}

func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numberOfShards int, quiet bool, cacheSyntheticDelay time.Duration) error {
func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numberOfShards int, quiet bool, cacheSyntheticDelay time.Duration, cacheServerConfigPath string) error {
Copy link
Contributor

@neolit123 neolit123 Feb 10, 2026

Choose a reason for hiding this comment

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

Suggested change
func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numberOfShards int, quiet bool, cacheSyntheticDelay time.Duration, cacheServerConfigPath string) error {
func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numberOfShards int, quiet bool, cacheSyntheticDelay time.Duration, cacheServerKubeconfig string) error {

or keep the name the flag variable the same for consistency.

Comment on lines +117 to 118
o.Etcd.AddFlags(fs)
o.EmbeddedEtcd.AddFlags(fs)
Copy link
Contributor

@neolit123 neolit123 Feb 10, 2026

Choose a reason for hiding this comment

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

should the external and local etcd flags be somewhat mutually exclusive?

@kcp-ci-bot kcp-ci-bot merged commit e6c6375 into kcp-dev:main Feb 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: enable using cache-server with external etcd

5 participants