Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] support passing extra args to kind create #362

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/kind_extra_args.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Creates a kind cluster with a registry.
apiVersion: ctlptl.dev/v1alpha1
kind: Cluster
product: kind
registry: ctlptl-registry
kindExtraCreateArguments:
# Example 1: Pass --wait to `kind create cluster` to wait for the control plane to be ready.
- "--wait=2m"
# Example 2: Pass --retain to `kind create cluster` to keep the containers around.
# This is super useful for debugging cluster creation issues.
- "--retain"
# Example 3: Pass --verbosity=3 to `kind create cluster` to get more verbose output.
- # This is also super useful for debugging cluster creation issues
- "--verbosity=3"
3 changes: 3 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type Cluster struct {
// wins over one specified in the Kind config.
KindV1Alpha4Cluster *v1alpha4.Cluster `json:"kindV1Alpha4Cluster,omitempty" yaml:"kindV1Alpha4Cluster,omitempty"`

// Extra command line arguments passed to Kind create CLI. Only applicable to clusters with the product: kind.
KindExtraCreateArguments []string `json:"kindExtraCreateArguments,omitempty" yaml:"kindExtraCreateArguments,omitempty"`

// The Minikube cluster config. Only applicable for clusters with product: minikube.
Minikube *MinikubeCluster `json:"minikube,omitempty" yaml:"minikube,omitempty"`

Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/admin_kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (a *kindAdmin) Create(ctx context.Context, desired *api.Cluster, registry *
return errors.Wrap(err, "creating kind cluster")
}

args = append(args, desired.KindExtraCreateArguments...)
args = append(args, "--config", "-")

iostreams := a.iostreams
Expand Down