Skip to content

Commit a83e650

Browse files
Merge pull request #2963 from xrstf/remove-syncer
⚠️ Remove TMC/Syncer
2 parents 7f7ab89 + c2b3247 commit a83e650

File tree

319 files changed

+583
-51021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+583
-51021
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 130 deletions
This file was deleted.

.github/workflows/kcp-test-image.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ ldflags:
110110
require-%:
111111
@if ! command -v $* 1> /dev/null 2>&1; then echo "$* not found in ${PATH}"; exit 1; fi
112112

113-
build: WHAT ?= ./cmd/... ./tmc/cmd/...
113+
build: WHAT ?= ./cmd/...
114114
build: require-jq require-go require-git verify-go-versions ## Build the project
115115
GOOS=$(OS) GOARCH=$(ARCH) CGO_ENABLED=0 go build $(BUILDFLAGS) -ldflags="$(LDFLAGS)" -o bin $(WHAT)
116116
ln -sf kubectl-workspace bin/kubectl-workspaces
@@ -119,15 +119,7 @@ build: require-jq require-go require-git verify-go-versions ## Build the project
119119

120120
.PHONY: build-all
121121
build-all:
122-
GOOS=$(OS) GOARCH=$(ARCH) $(MAKE) build WHAT='./cmd/... ./tmc/cmd/...'
123-
124-
.PHONY: build-kind-images
125-
build-kind-images-ko: require-ko
126-
$(eval SYNCER_IMAGE=$(shell KO_DOCKER_REPO=kind.local KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) ko build --platform=linux/$(ARCH) ./cmd/syncer))
127-
$(eval TEST_IMAGE=$(shell KO_DOCKER_REPO=kind.local KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) ko build --platform=linux/$(ARCH) ./test/e2e/fixtures/kcp-test-image))
128-
build-kind-images: build-kind-images-ko
129-
@test -n "$(SYNCER_IMAGE)" && (echo $(SYNCER_IMAGE) pushed to "$(KIND_CLUSTER_NAME)" kind cluster) || (echo Failed to create syncer image and/or to push it to "$(KIND_CLUSTER_NAME)" kind cluster; exit 1)
130-
@test -n "$(TEST_IMAGE)" && (echo $(TEST_IMAGE) pushed to "$(KIND_CLUSTER_NAME)" kind cluster) || (echo Failed to create test image and and/or to push it to "$(KIND_CLUSTER_NAME)" kind cluster; exit 1)
122+
GOOS=$(OS) GOARCH=$(ARCH) $(MAKE) build WHAT='./cmd/...'
131123

132124
install: WHAT ?= ./cmd/...
133125
install: require-jq require-go require-git verify-go-versions ## Install the project
@@ -278,31 +270,6 @@ test-e2e: build-all
278270
UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \
279271
$(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) $(COMPLETE_SUITES_ARG)
280272

281-
.PHONY: test-e2e-shared
282-
ifdef USE_GOTESTSUM
283-
test-e2e-shared: $(GOTESTSUM)
284-
endif
285-
test-e2e-shared: TEST_ARGS ?=
286-
test-e2e-shared: WHAT ?= ./test/e2e...
287-
test-e2e-shared: WORK_DIR ?= .
288-
ifdef ARTIFACT_DIR
289-
test-e2e-shared: LOG_DIR ?= $(ARTIFACT_DIR)/kcp
290-
else
291-
test-e2e-shared: LOG_DIR ?= $(WORK_DIR)/.kcp
292-
endif
293-
test-e2e-shared: require-kind build-all build-kind-images
294-
mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp"
295-
kind get kubeconfig > "$(WORK_DIR)/.kcp/kind.kubeconfig"
296-
rm -f "$(WORK_DIR)/.kcp/ready-to-test"
297-
UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \
298-
./bin/test-server --quiet --log-file-path="$(LOG_DIR)/kcp.log" $(TEST_SERVER_ARGS) 2>&1 & PID=$$! && echo "PID $$PID" && \
299-
trap 'kill -TERM $$PID' TERM INT EXIT && \
300-
while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \
301-
echo 'Starting test(s)' && \
302-
NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \
303-
$(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \
304-
-args --use-default-kcp-server --syncer-image="$(SYNCER_IMAGE)" --kcp-test-image="$(TEST_IMAGE)" --pcluster-kubeconfig="$(abspath $(WORK_DIR)/.kcp/kind.kubeconfig)" $(SUITES_ARG) \
305-
$(if $(value WAIT),|| { echo "Terminated with $$?"; wait "$$PID"; },)
306273

307274
.PHONY: test-e2e-shared-minimal
308275
ifdef USE_GOTESTSUM
@@ -329,35 +296,6 @@ test-e2e-shared-minimal: build-all
329296
-args --use-default-kcp-server $(SUITES_ARG) \
330297
$(if $(value WAIT),|| { echo "Terminated with $$?"; wait "$$PID"; },)
331298

332-
.PHONY: test-e2e-sharded
333-
ifdef USE_GOTESTSUM
334-
test-e2e-sharded: $(GOTESTSUM)
335-
endif
336-
test-e2e-sharded: TEST_ARGS ?=
337-
test-e2e-sharded: WHAT ?= ./test/e2e...
338-
test-e2e-sharded: WORK_DIR ?= .
339-
test-e2e-sharded: SHARDS ?= 2
340-
ifdef ARTIFACT_DIR
341-
test-e2e-sharded: LOG_DIR ?= $(ARTIFACT_DIR)/kcp
342-
else
343-
test-e2e-sharded: LOG_DIR ?= $(WORK_DIR)/.kcp
344-
endif
345-
test-e2e-sharded: require-kind build-all build-kind-images
346-
mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp"
347-
kind get kubeconfig > "$(WORK_DIR)/.kcp/kind.kubeconfig"
348-
rm -f "$(WORK_DIR)/.kcp/ready-to-test"
349-
UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \
350-
./bin/sharded-test-server --quiet --v=2 --log-dir-path="$(LOG_DIR)" --work-dir-path="$(WORK_DIR)" --shard-run-virtual-workspaces=false $(TEST_SERVER_ARGS) --number-of-shards=$(SHARDS) --cache-synthetic-delay=500ms 2>&1 & PID=$$!; echo "PID $$PID" && \
351-
trap 'kill -TERM $$PID' TERM INT EXIT && \
352-
while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \
353-
echo 'Starting test(s)' && \
354-
NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \
355-
$(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \
356-
-args --use-default-kcp-server --shard-kubeconfigs=root=$(PWD)/.kcp-0/admin.kubeconfig$(shell if [ $(SHARDS) -gt 1 ]; then seq 1 $$[$(SHARDS) - 1]; fi | while read n; do echo -n ",shard-$$n=$(PWD)/.kcp-$$n/admin.kubeconfig"; done) \
357-
$(SUITES_ARG) \
358-
--syncer-image="$(SYNCER_IMAGE)" --kcp-test-image="$(TEST_IMAGE)" --pcluster-kubeconfig="$(abspath $(WORK_DIR)/.kcp/kind.kubeconfig)" \
359-
$(if $(value WAIT),|| { echo "Terminated with $$?"; wait "$$PID"; },)
360-
361299
.PHONY: test-e2e-sharded-minimal
362300
ifdef USE_GOTESTSUM
363301
test-e2e-sharded-minimal: $(GOTESTSUM)

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ kcp is a Kubernetes-like control plane focusing on:
77
- A **control plane** for many independent, **isolated** “clusters” known as **workspaces**
88
- Enabling API service providers to **offer APIs centrally** using **multi-tenant operators**
99
- Easy **API consumption** for users in their workspaces
10-
- Flexible **scheduling** of workloads to physical clusters
11-
- **Transparent movement** of workloads among compatible physical clusters
12-
- **Advanced deployment strategies** for scenarios such as affinity/anti-affinity, geographic replication, cross-cloud
13-
replication, etc.
1410

1511
kcp can be a building block for SaaS service providers who need a **massively multi-tenant platform** to offer services
1612
to a large number of fully isolated tenants using Kubernetes-native APIs. The goal is to be useful to cloud
1713
providers as well as enterprise IT departments offering APIs within their company.
1814

15+
**NB:** In May 2023, the kcp project was restructured and components related to workload scheduling (e.g. the syncer) and the transparent multi cluster (tmc) code were removed due to lack of interest/maintainers. Please refer to the [`main-pre-tmc-removal` branch](https://github.com/kcp-dev/kcp/tree/main-pre-tmc-removal) if you are interested in the related code.
16+
1917
## Documentation
2018

2119
Please visit [docs.kcp.io/kcp](https://docs.kcp.io/kcp) for our documentation.

cmd/kcp/kcp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
"github.com/kcp-dev/kcp/pkg/cmd/help"
4343
"github.com/kcp-dev/kcp/pkg/embeddedetcd"
4444
kcpfeatures "github.com/kcp-dev/kcp/pkg/features"
45-
tmcserver "github.com/kcp-dev/kcp/tmc/pkg/server"
45+
"github.com/kcp-dev/kcp/pkg/server"
4646
)
4747

4848
func main() {
@@ -83,7 +83,7 @@ func main() {
8383
}
8484

8585
serverOptions := options.NewOptions(rootDir)
86-
serverOptions.Server.Core.GenericControlPlane.Logs.Verbosity = logsapiv1.VerbosityLevel(2)
86+
serverOptions.Server.GenericControlPlane.Logs.Verbosity = logsapiv1.VerbosityLevel(2)
8787

8888
startCmd := &cobra.Command{
8989
Use: "start",
@@ -105,7 +105,7 @@ func main() {
105105
},
106106
RunE: func(cmd *cobra.Command, args []string) error {
107107
// run as early as possible to avoid races later when some components (e.g. grpc) start early using klog
108-
if err := logsapiv1.ValidateAndApply(serverOptions.Server.Core.GenericControlPlane.Logs, kcpfeatures.DefaultFeatureGate); err != nil {
108+
if err := logsapiv1.ValidateAndApply(serverOptions.Server.GenericControlPlane.Logs, kcpfeatures.DefaultFeatureGate); err != nil {
109109
return err
110110
}
111111

@@ -119,9 +119,9 @@ func main() {
119119
}
120120

121121
logger := klog.FromContext(cmd.Context())
122-
logger.Info("running with selected batteries", "batteries", strings.Join(completed.Server.Core.Extra.BatteriesIncluded, ","))
122+
logger.Info("running with selected batteries", "batteries", strings.Join(completed.Server.Extra.BatteriesIncluded, ","))
123123

124-
config, err := tmcserver.NewConfig(completed.Server)
124+
config, err := server.NewConfig(completed.Server)
125125
if err != nil {
126126
return err
127127
}
@@ -134,13 +134,13 @@ func main() {
134134
ctx := genericapiserver.SetupSignalContext()
135135

136136
// the etcd server must be up before NewServer because storage decorators access it right away
137-
if completedConfig.Core.EmbeddedEtcd.Config != nil {
138-
if err := embeddedetcd.NewServer(completedConfig.Core.EmbeddedEtcd).Run(ctx); err != nil {
137+
if completedConfig.EmbeddedEtcd.Config != nil {
138+
if err := embeddedetcd.NewServer(completedConfig.EmbeddedEtcd).Run(ctx); err != nil {
139139
return err
140140
}
141141
}
142142

143-
s, err := tmcserver.NewServer(completedConfig)
143+
s, err := server.NewServer(completedConfig)
144144
if err != nil {
145145
return err
146146
}

cmd/kcp/options/options.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ import (
2222
cliflag "k8s.io/component-base/cli/flag"
2323

2424
kcpcoreoptions "github.com/kcp-dev/kcp/cmd/kcp-core/options"
25-
tmcserveroptions "github.com/kcp-dev/kcp/tmc/pkg/server/options"
25+
serveroptions "github.com/kcp-dev/kcp/pkg/server/options"
2626
)
2727

2828
type Options struct {
2929
Output io.Writer
3030

3131
Generic kcpcoreoptions.GenericOptions
32-
Server tmcserveroptions.Options
32+
Server serveroptions.Options
3333
Extra ExtraOptions
3434
}
3535

@@ -39,7 +39,7 @@ func NewOptions(rootDir string) *Options {
3939
opts := &Options{
4040
Output: nil,
4141

42-
Server: *tmcserveroptions.NewOptions(rootDir),
42+
Server: *serveroptions.NewOptions(rootDir),
4343
Generic: *kcpcoreoptions.NewGeneric(rootDir),
4444
Extra: ExtraOptions{},
4545
}
@@ -51,7 +51,7 @@ type completedOptions struct {
5151
Output io.Writer
5252

5353
Generic kcpcoreoptions.GenericOptions
54-
Server tmcserveroptions.CompletedOptions
54+
Server serveroptions.CompletedOptions
5555
Extra ExtraOptions
5656
}
5757

cmd/kubectl-kcp/cmd/kubectlKcp.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
bindcmd "github.com/kcp-dev/kcp/pkg/cliplugins/bind/cmd"
3131
claimscmd "github.com/kcp-dev/kcp/pkg/cliplugins/claims/cmd"
3232
crdcmd "github.com/kcp-dev/kcp/pkg/cliplugins/crd/cmd"
33-
workloadcmd "github.com/kcp-dev/kcp/pkg/cliplugins/workload/cmd"
3433
workspacecmd "github.com/kcp-dev/kcp/pkg/cliplugins/workspace/cmd"
3534
"github.com/kcp-dev/kcp/pkg/cmd/help"
3635
)
@@ -72,13 +71,6 @@ func KubectlKcpCommand() *cobra.Command {
7271
}
7372
root.AddCommand(workspaceCmd)
7473

75-
workloadCmd, err := workloadcmd.New(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
76-
if err != nil {
77-
fmt.Fprintf(os.Stderr, "error: %v\n", err)
78-
os.Exit(1)
79-
}
80-
root.AddCommand(workloadCmd)
81-
8274
crdCmd := crdcmd.New(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
8375
root.AddCommand(crdCmd)
8476

0 commit comments

Comments
 (0)