Skip to content

Commit

Permalink
Merge pull request #2046 from replicatedhq/embedded-cri
Browse files Browse the repository at this point in the history
Kubelet and containerd (with runc)
  • Loading branch information
divolgin committed Aug 6, 2021
2 parents b9e9065 + 9583e42 commit 70eaea9
Show file tree
Hide file tree
Showing 9 changed files with 763 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ supportbundle.tar.gz
# for the embed experiment
kubernetes/
kots.db
archives/
archives/
kotsdata/
3 changes: 2 additions & 1 deletion cmd/kots/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ func RunCmd() *cobra.Command {
if err != nil {
panic(err)
}
defaultDataDir := filepath.Join(cwd, "kotsdata")

cmd.Flags().String("data-dir", cwd, "directory to store admin console, kubernetes, and application data in")
cmd.Flags().String("data-dir", defaultDataDir, "directory to store admin console, kubernetes, and application data in")
cmd.Flags().String("shared-password", "", "the shared password to set to authenticate to the admin console")

return cmd
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/antrea.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var antreaManifests string

// note: https://github.com/antrea-io/antrea/releases/download/v0.13.5/antrea.yml

func installAntrea(kubeconfigPath string) error {
func installCNI(kubeconfigPath string) error {
config, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
if err != nil {
return errors.Wrap(err, "build config")
Expand Down
16 changes: 13 additions & 3 deletions pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cluster

import (
"context"
"fmt"

"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/logger"
Expand All @@ -11,8 +12,7 @@ import (
// This function blocks until the cluster control plane has started
func Start(ctx context.Context, slug string, dataDir string) error {
log := ctx.Value("log").(*logger.CLILogger)
log.ActionWithSpinner("Starting cluster")
defer log.FinishSpinner()
log.ActionWithoutSpinner("Starting cluster")

// init tls and misc
// this function is synchronous and blocks until ready
Expand Down Expand Up @@ -43,9 +43,19 @@ func Start(ctx context.Context, slug string, dataDir string) error {
return errors.Wrap(err, "get kubeconfig path")
}

if err := installAntrea(kubeconfigPath); err != nil {
if err := installCNI(kubeconfigPath); err != nil {
return errors.Wrap(err, "install antrea")
}

fmt.Println("starting cri")
if err := startCRI(dataDir); err != nil {
return errors.Wrap(err, "install cri")
}

fmt.Println("starting kubelet")
if err := startKubelet(ctx, dataDir); err != nil {
return errors.Wrap(err, "install kubelet")
}

return nil
}

0 comments on commit 70eaea9

Please sign in to comment.