require 'sct/command_interface' module Sct class ClusterCommand IS_PUBLIC_COMMAND = true SYNTAX = 'sct cluster' SUMMARY = 'Starts or stops the minikube cluster' EXAMPLE = 'sct cluster up' EXAMPLE_DESCRIPTION = 'Starts the spend cloud cluster' DESCRIPTION = "Sct cluster allows you to start and stop the Spend Cloud minikube cluster" OPTIONS = [] def initialize end def execute(args, options) case args[0] when "up" system("minikube start") system("minikube ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'") system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')") puts "\nāœ”ļø You can now visit your environment at šŸ‘‰ https://spend-cloud.spend.cloud.local šŸ‘Œ" when "down" system("minikube stop") else puts "Unknown or missing argument. Please run 'sct cluster up' or 'sct cluster down'" end end implements CommandInterface end end