A Kubernetes operator that provides a CI/CD workflow for Pulumi stacks using Kubernetes primitives. To learn more about the Pulumi Kubernetes Operator visit the Pulumi documentation.
Pulumi is an open source infrastructure-as-code tool for creating, deploying, and managing cloud infrastructure in the programming language of your choice. If you are new to Pulumi, please consider visiting the getting started first to familiarize yourself with Pulumi and concepts such as Pulumi stacks and backends.
The Pulumi Kubernetes Operator enables Kubernetes users to create a Pulumi Stack as a first-class Kubernetes API resource, and use the StackController to drive the updates. It allows users to adopt a GitOps workflow for managing their cloud infrastructure using Pulumi. This infrastructure includes Kubernetes resources in addition to over 60 cloud providers including AWS, Azure, and Google Cloud. The operator provides an alternative to Pulumi's other CI/CD integrations such as Github Actions, Gitlab CI, Jenkins etc. See the full list of Pulumi's CI/CD integrations here. Since the Pulumi Kubernetes Operator can be deployed on any Kubernetes cluster, it provides turnkey GitOps functionality for Pulumi users running in self-hosted or restricted settings. The Kubernetes Operator pattern, lends itself nicely to automation scenarios by driving to the specified state and automatically retrying if transient failures are encountered.
The following steps should be completed before using the operator:
Deploy the operator to a Kubernetes cluster.
You can use an existing cluster, or get started by creating a new managed Kubernetes cluster. We will assume that your target Kubernetes cluster is already created and you have configured kubectl
to point to it.
First, download the latest release source code
tar ball and expand it locally.
Install the operator:
kubectl apply -f deploy/yaml
This will deploy the operator to the pulumi-kubernetes-operator
namespace.
First, make sure you have installed Pulumi as described in "Download & install Pulumi".
Use the Pulumi program located in deploy/deploy-operator-yaml
to install the Operator cluster-wide with default settings.
cd deploy/deploy-operator-yaml
pulumi up
A Helm chart is provided in deploy/helm/pulumi-operator
, offering more customization options.
cd deploy/helm/pulumi-operator
helm install pulumi-kubernetes-operator -n pulumi-kubernetes-operator .
The following are examples to create Pulumi Stacks in Kubernetes that are managed and run by the operator.
Check out Create Pulumi Stacks using kubectl
for YAML examples.
Check out Create Pulumi Stacks using Pulumi for Typescript, Python, Go, and .NET examples.
If you'd like to use your own Pulumi Stack, ensure that you have an existing Pulumi program in a git repo, and update the CR with:
project
and/or commit
,stack
name that exists and will be selected, or a new stack that will be created and selected.accessToken
,Detailed documentation on Stack Custom Resource is available here.
Details on metrics emitted by the Pulumi Kubernetes Operator as instructions on getting them to flow to Prometheus are available here.
Check out docs/build.md for more details on building and working with the operator locally.