Skip to content

Instantly share code, notes, and snippets.

@squaremo
Created June 6, 2022 13:27
Show Gist options
  • Save squaremo/01f5414af58baf99799667208cb68436 to your computer and use it in GitHub Desktop.
Save squaremo/01f5414af58baf99799667208cb68436 to your computer and use it in GitHub Desktop.
// Naively create a CRD from a file (from a URL)
"use strict";
const k8s = require("@pulumi/kubernetes");
function installCRDs(name, fileURL) {
return new k8s.yaml.ConfigFile(name, {file: fileURL});
}
exports.crds = installCRDs('pulumi-stack-crd', "https://raw.githubusercontent.com/pulumi/pulumi-kubernetes-operator/master/deploy/crds/pulumi.com_stacks.yaml");

With the successive versions of the program:

  1. Start with a fresh Kubernetes cluster (I reset my Docker Desktop cluster between each experiment)
  2. Create a new stack (so there's no previous state)
  3. Run pulumi up and expect it to create the CRD
  4. Run pulumi up again and expect it to be a no-op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment