Prevent user from installing Elastic Stack on clusters without enough resources
As per the documentation https://docs.gitlab.com/ee/user/clusters/applications.html#elastic-stack elastic stack is not supported on clusters containing fewer than 3 nodes or consisting of f1-micro
, g1-small
, n1-standard-1
, or *-highcpu-2
instance types.
Right now if a user tries to install it on a small cluster, there is a hard failure: the installation fails, but the helm release is not deleted. It is very complicated to undo this state outside of scaling up the cluster (needs helm CLI access & gitlab rails prompt access).
We should:
- ensure a failure in installation does not result in a broken cluster
- check before installing that the cluster has the necessary resources available
This should also take into account autoscaling, where the cluster wouldn't have the resources available at installation time, but they would become available over time. In that case I think we shouldn't block installation.
Error output:
Tiller (the Helm server-side component) has been updated to gcr.io/kubernetes-helm/tiller:v2.16.6 .
+ seq 1 30
+ helm version --tls --tls-ca-cert /data/helm/elastic-stack/config/ca.pem --tls-cert /data/helm/elastic-stack/config/cert.pem --tls-key /data/helm/elastic-stack/config/ke
y.pem
Client: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.6", GitCommit:"dd2e5695da88625b190e6b22e9542550ab503a47", GitTreeState:"clean"}
+ s=0
+ break
+ exit 0
+ helm repo add elastic-stack https://charts.gitlab.io
"elastic-stack" has been added to your repositories
+ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "elastic-stack" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete.
+ helm upgrade elastic-stack elastic-stack/elastic-stack --install --atomic --cleanup-on-fail --reset-values --tls --tls-ca-cert /data/helm/elastic-stack/config/ca.pem --
tls-cert /data/helm/elastic-stack/config/cert.pem --tls-key /data/helm/elastic-stack/config/key.pem --version 3.0.0 --set 'rbac.create=true,rbac.enabled=true' --namespace
gitlab-managed-apps -f /data/helm/elastic-stack/config/values.yaml
Release "elastic-stack" does not exist. Installing it now.
INSTALL FAILED
PURGING CHART
Error: release elastic-stack failed: timed out waiting for the condition
Successfully purged a chart!
Error: release elastic-stack failed: timed out waiting for the condition