By now, you have probably heard about the initial availability of Kubernetes integration in Spacelift. You can read more about the announcement here and review the documentation.
Spacelift, like many of our customers, utilizes Kubernetes in a variety of ways. Before the integration, we operated Kubernetes or Public worker pools, testing and hosting the Spacelift platform. Now that the Kubernetes integration is initially available, we thought it would be good to provide a simple way for you to provision a Kubernetes cluster on AWS utilizing Terraform with Spacelift.
This blog will guide you through the process of deploying a Terraform based deployment of an EKS cluster with Spacelift. Below is an example of the cloned Terraform repository.
Start by cloning the repository found on GitHub and commit to your respective VCS provider. We made a few changes, but that was only to help with the naming and possible confusion in our dev environment. Otherwise, utilizing the repository as-is will work.
Create EKS Cluster Stack
In Spacelift, click the Add Stack button to create a Stack.
- Select the repository you created in the initial step, as seen in the picture.
For this example, I will keep the default selections.
If you need to modify the configuration, select the arrow next to Show Advanced Options. You can find out more about these options by reading the documentation.
Name the stack and provide any labels or descriptions.
To provision the EKS cluster, this Stack requires integration with AWS.
Navigate to the Settings, Integrations page and select the dropdown arrow to access the following selection screen:
Trigger a Run
To Trigger a Run, select Trigger on the right side of the Stacks view.
Trigger Run Status
After you manually trigger the Run in the Stack view, Spacelift will deploy a runner image, initialize the Cloud Provider, and run a Terraform Plan based upon the contents of the Terraform code.
After a successful planning phase, you can check the log to see the planned changes.
To confirm the Triggered run, click the CONFIRM button at the top of the screen.
The following screen highlights the Finished Run and output from a successful deployment to your Kubernetes cluster.
To review the outputs associated with this EKS cluster deployment, navigate to the outputs page. You can find all pertinent information about this cluster.
You have completed the deployment of an EKS cluster via Terraform with Spacelift!
Accomplish the Mission
Get started on your journey by signing up for a Free Trial and taking it for a spin around the world! Sign-up is as easy as authenticating with the provider of your choice.
Terraform Management Made Easy
Spacelift effectively manages Terraform state, more complex workflows, supports policy as code, programmatic configuration, context sharing, drift detection, resource visualization and includes many more features.