INNER CODE UNIT · Go

start

kcp-dev/kcp · cmd/sharded-test-server/main.go:77

func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numberOfShards int, quiet bool, cacheSyntheticDelay time.Duration, cacheServerConfigPath, externalEtcdServers string) error {
	// We use a shutdown context to know that it's time to gather metrics, before stopping the shards, proxy, etc.
	shutdownCtx, shutdownCancel := context.WithCancel(genericapiserver.SetupSignalContext())
	defer shutdownCancel()

	// This context controls the life of the shards, proxy, etc.
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	// create request header CA and client cert for front-proxy to connect to shards
	requestHeaderCA, _, err := crypto.EnsureCA(
		filepath.Join(workDirPath, ".kcp", "requestheader-ca.crt"),
		filepath.Join(workDirPath, ".kcp", "requestheader-ca.key"),
		filepath.Join(workDirPath, ".kcp", "requestheader-ca-serial.txt"),
		"kcp-front-proxy-requestheader-ca",
		365,
	)
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…