Skip to content

Instantly share code, notes, and snippets.

View lblackstone's full-sized avatar

Levi Blackstone lblackstone

View GitHub Profile
@lblackstone
lblackstone / watch.ts
Created August 18, 2020 23:09
Use streamInvoke to watch k8s Event stream
import * as k8s from "@pulumi/kubernetes";
import { streamInvoke } from "@pulumi/pulumi/runtime";
import * as pulumi from "@pulumi/pulumi";
// Install the sealed secret controller.
new k8s.yaml.ConfigFile("sealed-secret-controller", {
file: "https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.12.4/controller.yaml",
})
// Create a SealedSecret.
@lblackstone
lblackstone / configmap-cm-5opqxhna.yaml
Created February 21, 2020 20:52
Rendered Kubernetes YAML from pulumi-kubernetesx program
apiVersion: v1
data:
config: very important data
kind: ConfigMap
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","data":{"config":"very important data"},"kind":"ConfigMap","metadata":{"annotations":{"pulumi.com/autonamed":"true"},"labels":{"app.kubernetes.io/managed-by":"pulumi"},"name":"cm-5opqxhna"}}
pulumi.com/autonamed: "true"
labels:
// Define the application configuration and secrets.
const configs = new kx.ConfigMap("app-config", {
data: { "config": "very important data" }
});
const secrets = new kx.Secret("app-secrets", {
stringData: {
"app-password": new kx.RandomPassword("app-password"),
"database-password": config.databasePassword
}

Keybase proof

I hereby claim:

  • I am lblackstone on github.
  • I am lblackstone (https://keybase.io/lblackstone) on keybase.
  • I have a public key ASDBdtZpFsIe7e8Ra12bb6La3VSqdLe0ehCL99aEds8JpAo

To claim this, I am signing this object:

@lblackstone
lblackstone / Instructions.md
Last active January 11, 2024 00:06
Debugging provider plugin in a live Pulumi program
  1. Install dlv - https://github.com/go-delve/delve/tree/master/Documentation/installation
  2. Compile and link k8s provider with optimizations off - https://github.com/pulumi/pulumi-kubernetes/commit/3681117730a6440d89e697bc6ae46141fb965d8d (make build && make install && yarn link "@pulumi/kubernetes")
  3. Compile pulumi/pulumi with dlv WIP - https://github.com/pulumi/pulumi/commit/50414ca053981af7560b17df72a0251b9ac2ec03 (make build && make install)
  4. Run the dlv WIP pulumi binary (~/go/bin/pulumi up --logtostderr -v4 --logflow)
  5. Connect GoLand remote debugger to localhost:2345

Current Limitations:

  • Only works for k8s provider
  • Attaches to first launched process of the k8s provider