Sha256: 5ebf0f9f8a0a8311d37184b3a7c779915e212569db13b8f3f40d297b92704285
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
require 'sct/command_interface' module Sct class ClusterCommand IS_PUBLIC_COMMAND = true SYNTAX = 'sct cluster up | sct cluster down' SUMMARY = 'Starts or stops the minikube cluster' EXAMPLE = 'sct cluster up | sct cluster down' EXAMPLE_DESCRIPTION = 'Starts or stops the spend cloud cluster' DESCRIPTION = "Sct cluster allows you to start and stop the Spend Cloud minikube cluster" OPTIONS = [] def execute(args, options) return puts "SCT has not been initialized. Run 'sct init' first.".red unless Sct::Config.exists if `uname -a`.match?("Microsoft") minikube = "minikube.exe" else minikube = "minikube" end 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 config use-context minikube") system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')") system("sudo sct hostfile") 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
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sct-0.1.7 | lib/sct/commands/cluster.rb |