Pulumi-k8s-operator-example - OpenGitOps Compliant Pulumi Kubernetes Operator Example

Pulumi GitOps Example

OpenGitOps Compliant Pulumi Kubernetes Operator Example

Prereqs

You need

For the K8S cluster...

kind create cluster --image=kindest/node:v1.23.3

Note that there is a config in the Pulumi.dev.yaml file that is needed for OpenGitOps compliance.

Install Operator

You need to install the Pulumi Operator. You can do it with Pulumi or via YAML from their repo

rm -rf pulumi-kubernetes-operator
git clone https://github.com/pulumi/pulumi-kubernetes-operator
kubectl apply -f pulumi-kubernetes-operator/deploy/crds
kubectl apply -f pulumi-kubernetes-operator/deploy/yaml
kubectl rollout status deploy/pulumi-kubernetes-operator

Create Stack

Create a stack object in a YAML

Check out the doc for Stack config options

Things you'll need to change in the Stack object.

  • .spec.stack Set this based on your Pulumi account
  • .spec.projectRepo You should probably fork this repo to test this properly
  • .spec.branch If you have a different branch you want to target
apiVersion: v1
kind: Secret
metadata: name: pulumi-api-secret
type: Opaque
stringData:
  accessToken: "<PUT TOKEN HERE>"
---
apiVersion: pulumi.com/v1
kind: Stack
metadata:
  name: nginx-k8s-stack
spec:
  envRefs:
    PULUMI_ACCESS_TOKEN:
      type: Secret
      secret:
        name: pulumi-api-secret
        key: accessToken
  stack: christianh814/quickstart/dev
  projectRepo: https://github.com/christianh814/pulumi-k8s-operator-example
  branch: "refs/heads/main"
  destroyOnFinalize: true
  retryOnUpdateConflict: true
  continueResyncOnCommitMatch: true
  resyncFrequencySeconds: 60
  refresh: true
...

Apply

kubectl apply -f mydevstack.yaml
Owner
Christian Hernandez
Just doing GitOps things over at Red Hat
Christian Hernandez
Similar Resources

Running OpenFaas Pro on Linode K8s (feat. Aiven and Pulumi)

Running OpenFaas Pro on Linode K8s (feat. Aiven and Pulumi) Alex Ellis did a great job, when he wrote a tutorial about Event-driven OpenFaaS with Mana

Apr 26, 2022

Write controller-runtime based k8s controllers that read/write to git, not k8s

Git Backed Controller The basic idea is to write a k8s controller that runs against git and not k8s apiserver. So the controller is reading and writin

Dec 10, 2021

K8s-cinder-csi-plugin - K8s Pod Use Openstack Cinder Volume

k8s-cinder-csi-plugin K8s Pod Use Openstack Cinder Volume openstack volume list

Jul 18, 2022

K8s-go-structs - All k8s API Go structs

k8s-api go types Why? Its nice to have it all in a single package. . |-- pkg |

Jul 17, 2022

The Elastalert Operator is an implementation of a Kubernetes Operator, to easily integrate elastalert with gitops.

Elastalert Operator for Kubernetes The Elastalert Operator is an implementation of a Kubernetes Operator. Getting started Firstly, learn How to use el

Jun 28, 2022

Minecraft-operator - A Kubernetes operator for Minecraft Java Edition servers

Minecraft Operator A Kubernetes operator for dedicated servers of the video game

Dec 15, 2022

Kubernetes Operator Samples using Go, the Operator SDK and OLM

Kubernetes Operator Samples using Go, the Operator SDK and OLM

Kubernetes Operator Patterns and Best Practises This project contains Kubernetes operator samples that demonstrate best practices how to develop opera

Nov 24, 2022

A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Oct 15, 2022

The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the operator-sdk or controller-runtime.

k8s-generic-webhook The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the opera

Nov 24, 2022
Go-gke-pulumi - A simple example that deploys a GKE cluster and an application to the cluster using pulumi

This example deploys a Google Cloud Platform (GCP) Google Kubernetes Engine (GKE) cluster and an application to it

Jan 25, 2022
Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behaviors.

add-operator Basic Kubernetes operator that have multiple versions in CRD. This operator can be used to experiment and understand Operator/CRD behavio

Dec 15, 2021
a k8s operator 、operator-sdk

helloworld-operator a k8s operator 、operator-sdk Operator 参考 https://jicki.cn/kubernetes-operator/ https://learnku.com/articles/60683 https://opensour

Jan 27, 2022
K8s-ingress-health-bot - A K8s Ingress Health Bot is a lightweight application to check the health of the ingress endpoints for a given kubernetes namespace.

k8s-ingress-health-bot A K8s Ingress Health Bot is a lightweight application to check the health of qualified ingress endpoints for a given kubernetes

Jan 2, 2022
Pulumi-tencentcloud - Pulumi provider for tencentcloud

Terraform Bridge Provider Boilerplate This repository contains boilerplate code

Dec 30, 2021
Pulumi-awscontroltower - A Pulumi provider for AWS Control Tower

Terraform Bridge Provider Boilerplate This repository contains boilerplate code

Nov 14, 2022
Pulumi-hcp - A Pulumi provider for interacting with the Hashicorp Cloud Platform

Terraform Bridge Provider Boilerplate This repository contains boilerplate code

Dec 5, 2022
An operator which complements grafana-operator for custom features which are not feasible to be merged into core operator

Grafana Complementary Operator A grafana which complements grafana-operator for custom features which are not feasible to be merged into core operator

Aug 16, 2022
A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s.
A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s.

A Kubernetes Operator, that helps DevOps team accelerate their journey into the cloud and K8s. OAM operator scaffolds all of the code required to create resources across various cloud provides, which includes both K8s and Non-K8s resources

Nov 30, 2021