airy icon indicating copy to clipboard operation
airy copied to clipboard

Remove helm jobs from the CLI

Open ljupcovangelski opened this issue 2 years ago • 3 comments

By decoupling the Airy CLI from Kubernetes, we cannot directly run helm install or helm upgrade.

We should run these jobs from the airy-controller or use the helm binary directly.

Depends on #2754

ljupcovangelski avatar Jan 21 '22 16:01 ljupcovangelski

Decoupling the Airy CLI from Kubernetes means that the process of installing Airy are separated from applying the configuration and interacting with the API. For installing the Airy helm chart, access to Kubernetes is mandatory (otherwise the Kubernetes resources cannot be deployed). Therefore, I propose that we also decouple this process from the CLI altogether. I propose that airy create only initializes the workspace and prints out next steps which the user should execute on his own, in order to install Airy Core on a new or on an existing Kubernetes cluster.

airy create --provider minikube:

  • Checks if Minikube is installed
  • Checks if helm is installed
  • Checks if port 80 is open for the ingress congtroller (we can make it optional in the future for the user to selct his port)
  • Creates the airy.yaml file with the recommended settings for Minikube.
  • Prints out the command for Creating the Minikube cluster [^1].
  • Prints the command for deploying the helm chart [^2].

airy create --provider aws:

  • Checks if terraform is installed
  • Creates the Terraform files in the workspace directory
  • Creates the airy.yaml file with the recommended settings for AWS.
  • Prints a note to add the credentials or profile to airy.tfvars
  • Prints out the command for Creating an AWS EKS cluster with Airy[^3].

airy create --provider generic (or generic/kubernetes/existing, this should be the default option):

  • Check if there is an existing access to Kubernetes and prints the cluster where it will be installed
  • Checks if helm is installed
  • Creates the airy.yaml file with the recommended generic settings for cloud.
  • Prints the command for deploying the helm chart [^2].

[^1]: Command for creating a Minikue cluster: minikube --profile=airy-core start --extra-config=apiserver.service-node-port-range=1-65535 --ports=80:80 --driver=docker --container-runtime=containerd --cpus=4 --memory=7168

[^2]: Commands for deploying Airy Core with Helm: helm repo add airy https://helm.airy.co helm install airy airy/airy --namespace default --values ./airy.yaml

[^3]: Commands to create Airy with Terraform: terraform init terraform apply

ljupcovangelski avatar Jun 02 '22 12:06 ljupcovangelski

I think this is a good solution but I would like to hear what the product team has to say. This looks like a question for them.

AitorAlgorta avatar Jun 02 '22 13:06 AitorAlgorta

This is the way to go. One small DX improvement might be to just output a ./up.sh script or something for minikube.

chrismatix avatar Jun 02 '22 13:06 chrismatix