Gravity, Terraform and AWS for Kubernetes cluster creation

Hi,

I’m new to Gravity and have not used it yet.

I’m currently trying to build Kubernetes clusters (i.e. the infrastructure) on EC2 (I’m not allowed to use EKS) using Terraform (mandatory) via Jenkins pipelines.

I want a generic way to build, deploy and manage k8s cluster deployments across AWS and on premise via Terraform. I’ve been exploring ways to do this that will also help with on premise deployments e.g. KOPS and Kubespray. Could Gravity be an alternative approach to KOPs and Kubespray?

Thanks,
Sayeed

As discussed on Slack.

Our reference AWS implementation of gravity is available in this repo: https://github.com/gravitational/terraform-gravity It’s not well polished, but we do have customers who have based their deployments off our reference terraform within EC2 (including GovCloud regions). It’s built as terraform modules, with the idea that it can be integrated with your own terraform configuration as imports.

Gravity can definitely be used instead of KOPS or Kubespray, but I don’t know enough about either of those solutions to really contrast the strengths and weaknesses of gravity vs. those particular distributions.

Feel free to reach out to our sales team if you would like a demo (https://gravitational.com/demo/) or assistance with doing a proof of concept.

I’m getting the following error when trying to install the gravity image on the target machine:

[ERROR]: failed to enable /home/ec2-user/gravity/.gravity/gravity-installer.service: Failed to enable unit: Access denied
, error enabling the service

@Sayeed try disabling selinux: setenforce 0 and see if you can proceed.

Can you show the command you use for installation and describe your environment (user, SELinux status, OS distro, etc.)?

Thanks. I’ve set this to 0.

I’ve actually rebuilt the node and I’m using RHEL7.7. I’ve made sure selinux is disabled and no longer get the installer error. However, I am using the following command:

./gravity install --advertise-addr= --token=sayeed --cluster=“devetest” --flavor=“triple” --cloud-provider=generic

The error I now get is: Connecting to installer [ERROR]: context deadline exceeded

The gravity-system.log output:

INFO [PROCESS] Stopping listener 0.0.0.0:61009. mode:installer utils/logginghook.go:56
DEBU [PROC:1] Service is completed and removed. service:gravity.listener utils/logginghook.go:56
WARN Command failed. error:[
ERROR REPORT:
Original Error: trace.NotFoundError install flavor "triple" not found
Stack Trace:
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/config.go:922 github.com/gravitational/gravity/tool/gravity/cli.getFlavor
*
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/config.go:344 github.com/gravitational/gravity/tool/gravity/cli.(InstallConfig).NewInstallerConfig*
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/install.go:138 github.com/gravitational/gravity/tool/gravity/cli.newInstallerConfig**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/install.go:105 github.com/gravitational/gravity/tool/gravity/cli.startInstallFromService**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/install.go:65 github.com/gravitational/gravity/tool/gravity/cli.startInstall**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/run.go:293 github.com/gravitational/gravity/tool/gravity/cli.Execute**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/cli/run.go:79 github.com/gravitational/gravity/tool/gravity/cli.Run**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/main.go:54 main.run**
** /gopath/src/github.com/gravitational/gravity/tool/gravity/main.go:41 main.main**
** /go/src/runtime/proc.go:200 runtime.main**
** /go/src/runtime/asm_amd64.s:1337 runtime.goexit**
User Message: install flavor "triple" not found
] utils/logginghook.go:56

install flavor “triple” not found I assume that the command l parameters I’m using are incorrect?

Found the issue - triple isn’t specified as a flavor in the manifest.