Shipa Blog

Latest updates on our products, plus helpful articles relating to Kubernetes, container security, microservices and more

Automating and Operationalizing Shipa – Shipa Autowire Framework

Shipa in your organization/team can help usher in the next generation of engineering efficiency and developer experience.  Though like any platform, there requires some wiring to bind Shipa to infrastructure. In this modern example, can plug into your IaC strategy in creating Kubernetes clusters then auto-wires all of the needed Shipa pieces at cluster creation time. We are excited to announce that we are building out a repository for these auto-wire frameworks on GitHub which you can take needed pieces and integrate into your automation processes. This example supercharges the initial Terraform 101 integration with Shipa Cloud.  

First Look at the Auto-wiring

Focusing on the Terraform Auto-wiring, the current rendition of the example ingests a kubeconfig file. There is scaffolding in the repository to pick up a newly created EKS cluster for example if you leverage Amazon EKS. 

Shipa Auto-wire Terraform Logical Diagram

The Terraform integration can be easily modified to pick up on a created Kubernetes cluster then wire all of the needed Shipa objects and finally can deploy an image in the example. The auto-wire is simple to run. 

Run the Auto-wire

Running the auto-wire is simple, even if you have not used Terraform heavily in the past. In that use case, you can just pass in your kubeconfig [looks for the default location ~/.kube/config] and the auto-wire will pick up on the current context. To run you will need to download/clone the repository to your machine.  You will need access to the Shipa CLI which will allow you to get a Shipa Token for the integration. 

Shipa Token

curl -s https://storage.googleapis.com/shipa-client/install.sh | bash
shipa target add shipa-cloud target.shipa.cloud --set-current
shipa login
shipa version
Shipa CLI Login

Next, grab your Authentication Token via the Shipa CLI and save it for wiring into a variable file for Terraform.

shipa token show
Shipa Token Show

Your Shipa Token can be wired into <local_repo>/terraform/evn/autowire.tfvars

Terraform

The Terraform pieces will require Terraform installed on your machine and access to the files in the repository. Can download/clone the repository and make any modifications as needed. Can pass a tfvars file to Terraform with certain details. 

tfvars repository

The auto-wire assumes you will be running in Shipa Cloud. You can modify the Shipa Provider host URL to another destination if you have Shipa on-prem.

Shipa TF wiring

Now you are ready to run the example

Terraform Execution

With a few commands, you are ready to install the Terraform Providers and run the auto-wire. Assuming you have a Kubernetes cluster created by Terraform before or your current kubeconfig is pointed to an active Kubernetes cluster. 

terraform init
terraform plan -var-file="env/autowire.tfvars"
terraform apply -var-file="env/autowire.tfvars"
Shipa Auto-Wire TF apply

Type in yes and you are off to the races. 

Shipa Auto-Wire TF Progress

Can validate in the Shipa UI that your items are being created. 

Shipa -> Clusters

Terraform Shipa Created Cluster

Shipa -> Frameworks

Terraform Shipa Created Framework

If deploying the sample WordPress image in your Shipa Application, can navigate to the WordPress URL and see your live image. 

Shipa -> Applications -> tf-created-app -> Endpoint

Shipa Terraform Created Application

Clicking on the Endpoint. 

Shipa Deployed WordPress

Just like that, you have gone from Kubernetes cluster inception to a deployed application with Shipa. 

If you would like to clean up, can run the Terraform Destroy command.

terraform destroy -var-file="env/autowire.tfvars"

Looking to the Future

We are excited about the art of the possible with IaC and Shipa together. We will be putting together a few more examples using different IaCs. In our recent webinar, we showed off a Crossplane version of this. If you want to contribute, feel free to cut a Pull Request with your ideas/providers. We would love to hear what you are doing, feel free to engage us on Slack

Cheers,

-Ravi