Taking our Pulumi integration to the next level ⬆️

Mar 22, 2023 4 minute read
Buster Styren
Name
Buster Styren
Twitter
@BusterStyren

What's new? We've added the ability to copy Pulumi manifests in Go, Python or Typescript directly from the UI. We have also made it possible to import your clusters and node pools directly into Pulumi using our "Pulumi Export" button.

Infrastructure-as-code (IaC) is the backbone of any serious cloud deployment. It enables developers to collaborate, review and approve eachothers changes, ensures there's a log of all changes taking place and simplifies the management of resources across multiple cloud vendors.

That's why we're pushing out an even better integration with Pulumi. So you can easily set up Pulumi for provisioning and managing Kubernees infrastructure with us. 🥳

What's the deal with Pulumi?

Pulumi is an IaC platform that lets you define cloud resources using Python, Go, TypeScript, Java, .NET – even YAML – so you don’t have to adopt a domain-specific language like HCL.

The Pulumi Kubernetes Operator is another feature that separates Pulumi from other IaC tools. With the operator it's possible to manage your Pulumi Stack using CRDs inside of Kubernetes.

The operator is configured by pointing it to a git repository, which the operator uses to ensure that the state is kept consistent with version control. With the operator it's extremely easy to set-up a GitOps workflow in Kubernetes.

All in all, Pulumi is a great tool that makes it dead simple to adhere to the best practices for cloud management, which is why we're thrilled to build out support for it!

Copy Pulumi manifests directly from the UI

Configure your Kubernetes cluster in our web UI and use the Copy-button to create Go, Typescript or Python stanzas that can be imported directly into your Pulumi project.

Copy Pulumi manifests from the console

The copy button make it possible to configure your clusters or node pools with the UI while being able to easily shift it over to IaC once you're done. You might call it... configuration-without-reading-the-manual?

Export/Import directly into Pulumi

Use the export button to download a JSON file of your cluster and node pools. Pulumi can read this JSON and import these reasorces directly into Pulumi. This might be useful if you already have clusters set up but want to quickly import them into a new (or existing) Pulumi project.

Copy Pulumi manifests from the console

How to import Symbiosis clusters into Pulumi

First, Create a fresh Pulumi project if you don't already have one. You will be prompted to select a template to start building with, for example python to create an empty python project without any predefined resources.

You will also be prompted to name your project and to create a stack. A stack is a specific environment based on our project. Stacks can be used to create separate environments such as dev, staging or production.

# Select from a template
pulumi new

# Or create a python, go or typescript project directly
pulumi new python

With our project set up we can install the Symbiosis Pulumi plugin:

pulumi plugin install resource symbiosis --server github://api.github.com/symbiosis-cloud

Next, we have to define a value for the API key that Pulumi uses to communicate with the Symbiosis API. An API key can be created under api keys in the UI or through the CLI.

pulumi config set symbiosis:apiKey --secret <api-key>

Download the exported Pulumi resources from the settings tab in web UI. Importing the JSON file into our project:

pulumi import -f <file>

Done! You will be presented with a code snippet that you can copy and paste into your Pulumi code (the correct file will depend on what language you are using) with the correct parameters for your cluster.

Next steps

You can use Pulumi to manage all aspects of deploying your k8s clusters on Symbiosis – check out the full API docs and further examples of how to use the Symbiosis provider on the Pulumi registry.

Have any input, suggestions or feedback? Please reach out to us on Discord or Twitter.

Last Updated Apr 25, 2023
Share this post on Hackernews
Share this post on Reddit
Share this post on Twitter