diff --git a/cmd/kubectl-testkube/commands/install.go b/cmd/kubectl-testkube/commands/install.go index 294a90d154a..f0afcaa4122 100644 --- a/cmd/kubectl-testkube/commands/install.go +++ b/cmd/kubectl-testkube/commands/install.go @@ -1,6 +1,7 @@ package commands import ( + "fmt" "os/exec" "github.com/kubeshop/testkube/pkg/process" @@ -8,9 +9,10 @@ import ( "github.com/spf13/cobra" ) -func init() { - -} +var ( + noDashboard bool + noMinio bool +) func NewInstallCmd() *cobra.Command { var chart, name, namespace string @@ -35,15 +37,24 @@ func NewInstallCmd() *cobra.Command { _, err = process.Execute(helmPath, "repo", "update") ui.ExitOnError("updating helm repositories", err) - out, err := process.Execute(helmPath, "upgrade", "--install", "--create-namespace", "--namespace", namespace, name, chart) + command := []string{"upgrade", "--install", "--create-namespace", "--namespace", namespace} + command = append(command, "--set", fmt.Sprintf("api-server.minio.enabled=%t", !noDashboard)) + command = append(command, "--set", fmt.Sprintf("testkube-dashboard.enabled=%t", !noMinio)) + command = append(command, name, chart) + + out, err := process.Execute(helmPath, command...) + ui.ExitOnError("executing helm install", err) ui.Info("Helm install output", string(out)) - }, } cmd.Flags().StringVar(&chart, "chart", "kubeshop/testkube", "chart name") cmd.Flags().StringVar(&name, "name", "testkube", "installation name") cmd.Flags().StringVar(&namespace, "namespace", "testkube", "namespace where to install") + + cmd.Flags().BoolVar(&noMinio, "no-minio", false, "don't install MinIO") + cmd.Flags().BoolVar(&noDashboard, "no-dashboard", false, "don't install dashboard") + return cmd } diff --git a/docs/installing.md b/docs/installing.md index e9f261a0ae6..15a06a5da27 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -60,27 +60,35 @@ The above command will install the following components in your Kubernetes clust 2. `testkube` namespace 3. CRD for scripts 4. MongoDB -5. Minio - optional +5. Minio - default (can be disabled with `--no-minio` flag if you want to use S3 buckets) +6. Dashboard - default (can be disabled with `--no-dasboard` flag) You can confirm it by running: - -```sh -$ kubectl get all -n testkube -NAME READY STATUS RESTARTS AGE -pod/testkube-api-server-5478577b5b-jnnv6 1/1 Running 0 64s -pod/testkube-mongodb-5d95f44fdd-8wkwh 1/1 Running 0 64s - -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -service/testkube-mongodb ClusterIP 10.43.192.11 27017/TCP 64s -service/testkube-api-server NodePort 10.43.32.229 8088:31868/TCP 64s - -NAME READY UP-TO-DATE AVAILABLE AGE -deployment.apps/testkube-api-server 1/1 1 1 64s -deployment.apps/testkube-mongodb 1/1 1 1 64s - -NAME DESIRED CURRENT READY AGE -replicaset.apps/testkube-api-server-5478577b5b 1 1 1 64s -replicaset.apps/testkube-mongodb-5d95f44fdd 1 1 1 64s +``` +➜ kubectl get all -n testkube +NAME READY STATUS RESTARTS AGE +pod/testkube-dashboard-748cbcbb66-q8zzp 1/1 Running 0 4m51s +pod/testkube-api-server-546777c9f7-7g4kg 1/1 Running 0 4m51s +pod/testkube-mongodb-5d95f44fdd-cxqz6 1/1 Running 0 4m51s +pod/testkube-minio-testkube-64cd475b94-562hz 1/1 Running 0 4m51s + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/testkube-minio-service-testkube NodePort 10.43.121.107 9000:31222/TCP,9090:32002/TCP,9443:32586/TCP 4m51s +service/testkube-api-server NodePort 10.43.66.13 8088:32203/TCP 4m51s +service/testkube-mongodb ClusterIP 10.43.126.230 27017/TCP 4m51s +service/testkube-dashboard NodePort 10.43.136.34 80:31991/TCP 4m51s + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/testkube-dashboard 1/1 1 1 4m51s +deployment.apps/testkube-api-server 1/1 1 1 4m51s +deployment.apps/testkube-mongodb 1/1 1 1 4m51s +deployment.apps/testkube-minio-testkube 1/1 1 1 4m51s + +NAME DESIRED CURRENT READY AGE +replicaset.apps/testkube-dashboard-748cbcbb66 1 1 1 4m51s +replicaset.apps/testkube-api-server-546777c9f7 1 1 1 4m51s +replicaset.apps/testkube-mongodb-5d95f44fdd 1 1 1 4m51s +replicaset.apps/testkube-minio-testkube-64cd475b94 1 1 1 4m51s ``` By default testkube is installed in the `testkube` namespace.