Compare commits

..
Author SHA1 Message Date
kasun 6d05f426d0 chore(k8s-apps): update Kubernetes provider to 4.35.0
Deploy k8s Apps / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 42s
Secret Scan / Betterleaks (pull_request) Successful in 6s
2026-11-29 02:10:51 +01:00
claude-bot Bot 0466bd6929 Merge pull request 'Chore: Update Pulumi SDK and dev tools across all stacks' (#68) from chore/update-pulumi-sdk into main
Deploy k8s Infra / Pulumi Preview (push) Skipped
Deploy k8s Apps / Pulumi Preview (push) Skipped
Deploy Monitoring / Pulumi Preview (push) Skipped
Deploy k8s Infra / Pulumi Deploy (push) Successful in 45s
Deploy Monitoring / Pulumi Deploy (push) Successful in 43s
Deploy Proxmox Infra / Pulumi Preview (push) Skipped
Deploy Proxmox Infra / Pulumi Deploy (push) Successful in 51s
Deploy k8s Apps / Pulumi Deploy (push) Successful in 39s
Secret Scan / Betterleaks (push) Successful in 6s
2026-11-29 02:02:25 +01:00
kasun 8f9b6fda24 chore: update Pulumi SDK and dev tools across all stacks
Deploy k8s Apps / Pulumi Deploy (pull_request) Skipped
Deploy Monitoring / Pulumi Deploy (pull_request) Skipped
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Bootstrap / Bootstrap k3s Cluster (pull_request) Skipped
Deploy k8s Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 36s
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 54s
Deploy k8s Bootstrap / Pulumi Preview (pull_request) Successful in 36s
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 42s
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 38s
Secret Scan / Betterleaks (pull_request) Successful in 6s
Clear the critical and high npm audit findings. Keep provider versions
unchanged: @pulumi/kubernetes 4.35.0 makes the k8s-infra preview update
the Longhorn, cert-manager and NFS CSI Helm releases, and it doesn't fix
the remaining moderate findings. Provider updates will be separate.
2026-11-29 01:58:26 +01:00
claude-bot Bot 6ad6007df4 Merge pull request 'Chore: Load remaining stack configs from private repo' (#67) from chore/stack-config-repo into main
Deploy Proxmox Infra / Pulumi Preview (push) Skipped
Deploy k8s Infra / Pulumi Preview (push) Skipped
Deploy Proxmox Infra / Pulumi Deploy (push) Successful in 54s
Deploy k8s Infra / Pulumi Deploy (push) Successful in 49s
Deploy k8s Apps / Pulumi Preview (push) Skipped
Deploy k8s Apps / Pulumi Deploy (push) Successful in 44s
Secret Scan / Betterleaks (push) Successful in 5s
2026-11-29 01:01:06 +01:00
kasun c5e545ef33 docs: describe private stack config repo
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Skipped
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 59s
Deploy k8s Bootstrap / Pulumi Preview (pull_request) Successful in 41s
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 43s
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 42s
Secret Scan / Betterleaks (pull_request) Successful in 6s
Deploy k8s Bootstrap / Bootstrap k3s Cluster (pull_request) Skipped
Deploy k8s Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Deploy (pull_request) Skipped
Deploy Monitoring / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 41s
2026-11-29 00:55:51 +01:00
kasun 9d11189f3d chore: load remaining stack configs from private repo
The monitoring trial deployed without changes, so the other stacks now use the same setup and no longer need base64 config secrets.
2026-11-29 00:37:47 +01:00
claude-bot Bot 5dde0da0d2 Merge pull request 'Chore: Load monitoring stack config from private repo' (#66) from chore/monitoring-config-repo into main
Deploy Monitoring / Pulumi Preview (push) Skipped
Deploy Monitoring / Pulumi Deploy (push) Successful in 49s
Secret Scan / Betterleaks (push) Successful in 6s
2026-11-29 00:28:50 +01:00
kasun d93d1810f1 chore(monitoring): load stack config from private repo
Deploy Proxmox Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Apps / Pulumi Deploy (pull_request) Skipped
Deploy Monitoring / Pulumi Deploy (pull_request) Skipped
Deploy Proxmox Infra / Pulumi Preview (pull_request) Successful in 55s
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 42s
Deploy k8s Apps / Pulumi Preview (pull_request) Successful in 38s
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 49s
Secret Scan / Betterleaks (pull_request) Successful in 5s
Keeps the encrypted config versioned in git instead of copying it into a base64 CI secret after every change. Monitoring goes first as a trial before the other stacks move.
2026-11-29 00:25:10 +01:00
claude-bot Bot cdf033686a Merge pull request 'Enhancement: Protect monitoring resources and allow fresh deploys' (#63) from enhancement/protect-monitoring-resources into main
Deploy Monitoring / Pulumi Preview (push) Skipped
Deploy Monitoring / Pulumi Deploy (push) Successful in 49s
Secret Scan / Betterleaks (push) Successful in 7s
2026-11-23 02:41:49 +01:00
kasun b1aff90ffd enhancement(monitoring): replace import options with protect
Deploy Monitoring / Pulumi Deploy (pull_request) Skipped
Deploy Monitoring / Pulumi Preview (pull_request) Successful in 46s
Secret Scan / Betterleaks (pull_request) Successful in 6s
The import options fail on a fresh cluster, where the namespace and Helm release do not exist yet. Protect both resources instead, and update the rebuild runbook because clearing protected state requires --force.
2026-11-23 02:40:29 +01:00
claude-bot Bot c6aa571a5c Merge pull request 'Docs: Add full cluster rebuild runbook' (#62) from docs/add-cluster-rebuild-runbook into main
Secret Scan / Betterleaks (push) Successful in 6s
2026-11-23 02:34:06 +01:00
kasun ffe976fb16 docs: add full cluster rebuild runbook
Deploy k8s Bootstrap / Bootstrap k3s Cluster (pull_request) Skipped
Deploy k8s Bootstrap / Pulumi Preview (pull_request) Successful in 48s
Secret Scan / Betterleaks (pull_request) Successful in 8s
A normal pulumi up can't rebuild the cluster: bootstrap commands run once, the later stacks' state describes the old cluster, and monitoring's import options fail on a fresh one.
2026-11-23 02:32:39 +01:00
claude-bot Bot 17648b53ae Merge pull request 'Enhancement: Deploy k8s-infra through the control-plane VIP' (#61) from enhancement/k8s-infra-control-plane-vip into main
Deploy k8s Infra / Pulumi Preview (push) Skipped
Deploy k8s Infra / Pulumi Deploy (push) Successful in 48s
Secret Scan / Betterleaks (push) Successful in 6s
2026-11-23 02:22:47 +01:00
kasun 46b6593682 enhancement(k8s-infra): deploy through the control-plane VIP
Deploy k8s Infra / Pulumi Deploy (pull_request) Skipped
Deploy k8s Infra / Pulumi Preview (pull_request) Successful in 46s
Secret Scan / Betterleaks (pull_request) Successful in 5s
Deploys depended on master-1 being up. A fixed clusterIdentifier lets the provider move to the VIP as an update, because Pulumi otherwise treats a new API address as a different cluster and replaces every resource. The identifier was added to the stack state first so this change does not itself trigger a replacement.
2026-11-23 02:21:26 +01:00
claude-bot Bot 52e780f4af Merge pull request 'Enhancement: Deploy monitoring through the control-plane VIP' (#60) from enhancement/monitoring-control-plane-vip into main
Deploy Monitoring / Pulumi Preview (push) Skipped
Deploy Monitoring / Pulumi Deploy (push) Successful in 45s
Secret Scan / Betterleaks (push) Successful in 7s
2026-11-23 02:12:37 +01:00
25 changed files with 1783 additions and 6725 deletions

No files matched your search

+1 -1
View File
@@ -91,6 +91,6 @@ Keep it short:
- PR link and commits.
- What the merge deploys, from the `on.push.paths` in `.gitea/workflows/`. `01`, `03`, `04` and `05` deploy on merge. A change under `.gitea/workflows/` can deploy `03`, `04` and `05`, and a change to `01`'s own workflow deploys `01`.
- For `02` changes, say that they are not live until someone runs the manual workflow.
- Anything left uncommitted, and a reminder to update `<STACK>_PULUMI_DEV_YAML` if local Pulumi config changed.
- Anything left uncommitted. Also run `git -C .pulumi-config status --short --branch`, and if it shows uncommitted or unpushed changes, remind the user to commit and push them there because CI uses that repo's `main`. Don't commit or push that repo as part of `/merge`.
Do not delete the branch, dispatch a workflow, or change a live system.
+16 -4
View File
@@ -31,8 +31,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.PROXMOX_INFRA_PULUMI_DEV_YAML }}" | base64 -d > 01-proxmox-infra/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm ci
@@ -68,8 +74,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.PROXMOX_INFRA_PULUMI_DEV_YAML }}" | base64 -d > 01-proxmox-infra/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm ci
+16 -4
View File
@@ -23,8 +23,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_BOOTSTRAP_PULUMI_DEV_YAML }}" | base64 -d > 02-k8s-bootstrap/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
@@ -53,8 +59,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_BOOTSTRAP_PULUMI_DEV_YAML }}" | base64 -d > 02-k8s-bootstrap/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
+16 -4
View File
@@ -29,8 +29,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_INFRA_PULUMI_DEV_YAML }}" | base64 -d > 03-k8s-infra/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Helm
uses: azure/setup-helm@v4
@@ -62,8 +68,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_INFRA_PULUMI_DEV_YAML }}" | base64 -d > 03-k8s-infra/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Helm
uses: azure/setup-helm@v4
+16 -4
View File
@@ -29,8 +29,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_APPS_PULUMI_DEV_YAML }}" | base64 -d > 04-k8s-apps/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
@@ -59,8 +65,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.K8S_APPS_PULUMI_DEV_YAML }}" | base64 -d > 04-k8s-apps/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
+16 -4
View File
@@ -29,8 +29,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.MONITORING_PULUMI_DEV_YAML }}" | base64 -d > 05-monitoring/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
@@ -59,8 +65,14 @@ jobs:
with:
node-version: "24"
- name: Restore Stack Config
run: echo "${{ secrets.MONITORING_PULUMI_DEV_YAML }}" | base64 -d > 05-monitoring/Pulumi.dev.yaml
- name: Checkout Stack Config
uses: actions/checkout@v4
with:
repository: kasun/homelab-pulumi-config
ref: main
token: ${{ secrets.PULUMI_CONFIG_REPO_TOKEN }}
path: .pulumi-config
persist-credentials: false
- name: Install Dependencies
run: npm install
+1
View File
@@ -8,3 +8,4 @@ sdks/
.env
.env.*
!.env.example
.pulumi-config
+1
View File
@@ -15,3 +15,4 @@ packages:
parameters:
- marshallford/pfsense
- 0.22.0
stackConfigDir: ../.pulumi-config/01-proxmox-infra
+13 -13
View File
@@ -608,9 +608,9 @@
"link": true
},
"node_modules/@pulumi/pulumi": {
"version": "3.277.0",
"resolved": "https://registry.npmjs.org/@pulumi/pulumi/-/pulumi-3.277.0.tgz",
"integrity": "sha512-EvvBo55xmGByLRWjIqp24k4vzmPoKmZ6nTmK8EHzRb9veLCNISN3/Fq4RlJxrEt5+HmNkZveEasI+z0UCgkMxw==",
"version": "3.278.0",
"resolved": "https://registry.npmjs.org/@pulumi/pulumi/-/pulumi-3.278.0.tgz",
"integrity": "sha512-PedUCQG6IciTBYA5MUYeiFbeoqaI/0hlA7rtrjkETk949BZ4bpLejoHmENifAAdBk0+h0oUv+BdVNtlMQ+AhRA==",
"license": "Apache-2.0",
"dependencies": {
"@grpc/grpc-js": "^1.10.1",
@@ -670,12 +670,12 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "24.13.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.1.tgz",
"integrity": "sha512-RSpUJGmvsJ1ZeBehQZFhIdpsz+bIpES0nIQXko4Ybq+N+kX6XvOq3Jo+iJ82FWLdblFq85AsMikd3m35jgezYg==",
"version": "24.19.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.4.tgz",
"integrity": "sha512-s04odlR3ksJrLu7QLi+pddkWLD0RmSbcP9KuWn2/ozQKAp/YgwBC/6x9kJj8yAzZnGPfxePm7zm7nysVPCRagw==",
"license": "MIT",
"dependencies": {
"undici-types": "~7.18.0"
"undici-types": ">=7.24.0 <7.24.7"
}
},
"node_modules/@types/semver": {
@@ -1266,9 +1266,9 @@
}
},
"node_modules/undici-types": {
"version": "7.18.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
"integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
"license": "MIT"
},
"node_modules/upath": {
@@ -1365,9 +1365,9 @@
}
},
"sdks/pfsense/node_modules/@types/node": {
"version": "20.19.41",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.41.tgz",
"integrity": "sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==",
"version": "20.19.43",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz",
"integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==",
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
+1 -1
View File
@@ -8,6 +8,6 @@
## Running against live VMs
Re-running this stack restarts the bootstrap sequence against already-provisioned VMs. That's why it only deploys via manual dispatch. For changes to the running cluster, write the code for a fresh bootstrap and give separate manual steps.
Re-running this stack restarts the bootstrap sequence against already-provisioned VMs. That's why it only deploys via manual dispatch. For changes to the running cluster, write the code for a fresh bootstrap and give separate manual steps. To rebuild the whole cluster, follow [the rebuild runbook](../docs/runbooks/full-cluster-rebuild.md).
The SSH key comes from `proxmox-infra`'s first `pulumi up`. VMs created before that need the public key added to `~/.ssh/authorized_keys` by hand.
+1
View File
@@ -8,3 +8,4 @@ config:
pulumi:tags:
value:
pulumi:template: typescript
stackConfigDir: ../.pulumi-config/02-k8s-bootstrap
+382 -1638
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -4,3 +4,4 @@ runtime:
name: nodejs
options:
packagemanager: npm
stackConfigDir: ../.pulumi-config/03-k8s-infra
+7 -7
View File
@@ -23,13 +23,13 @@ const domain = config.requireSecret("domain");
const longhornUiUser = config.requireSecret("longhornUiUser");
const longhornUiPassword = config.requireSecret("longhornUiPassword");
// Keep the kubeconfig stored in state. A changed API address would otherwise
// make Pulumi replace the provider and every resource in this stack.
const k8sProvider = new k8s.Provider(
"k3s",
{ kubeconfig },
{ ignoreChanges: ["kubeconfig"] },
);
// A fixed identifier makes kubeconfig changes (e.g. a new API address) provider
// updates. Without it, they replace the provider and every resource in this
// stack. Changing this value triggers that replacement, so never change it.
const k8sProvider = new k8s.Provider("k3s", {
kubeconfig,
clusterIdentifier: "homelab-k3s",
});
const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({
provider: k8sProvider,
...extras,
+389 -1679
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -5,11 +5,11 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^18",
"typescript": "^5.0.0"
"@types/node": "^24.19.4",
"typescript": "^6.0.3"
},
"dependencies": {
"@pulumi/kubernetes": "^4.0.0",
"@pulumi/pulumi": "^3.113.0"
"@pulumi/kubernetes": "^4.31.1",
"@pulumi/pulumi": "^3.278.0"
}
}
+1
View File
@@ -4,3 +4,4 @@ runtime:
name: nodejs
options:
packagemanager: npm
stackConfigDir: ../.pulumi-config/04-k8s-apps
+385 -1675
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,3 +1,3 @@
# monitoring
- The `monitoring` namespace and the `kube-prometheus-stack` Helm release were adopted from existing cluster resources via the Pulumi `import` option. Be careful with renames or changes that would force a replace.
- The `monitoring` namespace and the `kube-prometheus-stack` Helm release were originally adopted from existing cluster resources and are now `protected`. Be careful with renames or changes that would force a replace.
+1
View File
@@ -4,3 +4,4 @@ runtime:
name: nodejs
options:
packagemanager: npm
stackConfigDir: ../.pulumi-config/05-monitoring
+2 -2
View File
@@ -29,7 +29,7 @@ const k8sProvider = new k8s.Provider("k3s", {
const monitoringNs = new k8s.core.v1.Namespace(
"monitoring",
{ metadata: { name: "monitoring" } },
{ provider: k8sProvider, import: "monitoring" },
{ provider: k8sProvider, protect: true },
);
const grafanaHost = pulumi.interpolate`grafana.${domain}`;
@@ -101,5 +101,5 @@ new k8s.helm.v3.Release(
alertmanager: { enabled: false },
},
},
{ provider: k8sProvider, import: "monitoring/kube-prometheus-stack" },
{ provider: k8sProvider, protect: true },
);
+382 -1672
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -24,7 +24,9 @@ proxmox-infra → k8s-bootstrap → k8s-infra
## Shared conventions
- **Secrets**: read via `config.requireSecret()`, never via environment variables or hardcoded values.
- **`Pulumi.dev.yaml`**: gitignored (contains the encryption salt). Never delete it or secrets become unrecoverable. CI restores it from a base64 Gitea secret `<STACK>_PULUMI_DEV_YAML`; after changing local config, remind me to update that secret.
- **`Pulumi.dev.yaml`**: in `.pulumi-config/<stack-dir>/` (set by `stackConfigDir`). `.pulumi-config/` is a separate private repo, gitignored here and not a submodule, so this repo's `git status` doesn't show its changes; use `git -C .pulumi-config status`. These files contain the encryption salt: never delete them or secrets become unrecoverable, and never commit them to this repo. Any `0N-*/Pulumi.dev.yaml` is an unused old copy; don't edit it.
- **Config changes**: CI checks out the config repo's `main`, so a local preview can use config that CI doesn't have yet. After config changes, remind me to commit and push them there, before opening or updating a PR that needs them. That push doesn't start a deploy. The commit rule below applies to that repo too. Setup steps are in `.pulumi-config/README.md`.
- **Private repos**: don't write a private repo's name, owner/name path or URL in READMEs or other docs. Say "the private config repo", or use a placeholder. Naming it in workflows is fine, and so is the local folder name `.pulumi-config/`.
- **Environment**: `PULUMI_BACKEND_URL` (self-hosted Postgres backend) and `PULUMI_CONFIG_PASSPHRASE` must be set.
- **CI**: PRs run `pulumi preview`. `01` and `03`–`05` deploy on push to `main`; `02` deploys only via manual dispatch. Automatic `01` deploys skip `pulumi refresh`, so run its workflow manually after changing VMs in the Proxmox GUI.
+17 -11
View File
@@ -95,6 +95,8 @@ export PULUMI_BACKEND_URL=postgresql://<user>:<pass>@<host>/<db>
export PULUMI_CONFIG_PASSPHRASE=<your-passphrase>
```
Clone your private config repo into `.pulumi-config/` (see [Stack config](#stack-config)). For an existing setup, use the config from that repo and skip the `stack init` and `config set` commands below.
Then for each stack, in order:
```bash
@@ -126,31 +128,35 @@ One workflow per stack, `.gitea/workflows/0N-deploy-<stack>.yaml`, scoped to cha
Stack 02 (cluster bootstrap) deploys **only** via manual dispatch, because re-running it restarts the bootstrap sequence. Stack 01 (VM provisioning) skips the refresh on automatic deploys so a VM missing from Proxmox can't be recreated blank. After changing VMs in the Proxmox GUI, run its workflow manually to sync state.
To rebuild the whole cluster from new VMs, follow [the rebuild runbook](docs/runbooks/full-cluster-rebuild.md). A normal `pulumi up` won't do it.
### Required secrets
| Secret | Used by |
| --- | --- |
| `PULUMI_BACKEND_URL`, `PULUMI_CONFIG_PASSPHRASE` | all workflows |
| `PROXMOX_INFRA_PULUMI_DEV_YAML` | 01-deploy-proxmox-infra |
| `K8S_BOOTSTRAP_PULUMI_DEV_YAML` | 02-deploy-k8s-bootstrap |
| `K8S_INFRA_PULUMI_DEV_YAML` | 03-deploy-k8s-infra |
| `K8S_APPS_PULUMI_DEV_YAML` | 04-deploy-k8s-apps |
| `MONITORING_PULUMI_DEV_YAML` | 05-deploy-monitoring |
| `PULUMI_CONFIG_REPO_TOKEN` (`ci-bot` token with read-only access to the config repo) | all workflows |
Each `<STACK>_PULUMI_DEV_YAML` secret is a base64-encoded copy of that stack's gitignored `Pulumi.dev.yaml`. After changing local config, re-encode and update the secret:
### Stack config
```bash
base64 -w 0 0N-<stack>/Pulumi.dev.yaml
```
Each stack's encrypted `Pulumi.dev.yaml` is in a private repo, cloned into the gitignored `.pulumi-config/` folder. CI checks out its `main` branch. After changing config, commit and push it there. That push doesn't start a deploy. See that repo's README for setup and usage.
CI reads the config repo as a separate user, so its token can't access your other private repos:
1. As a Gitea admin, create a regular (non-admin) user named `ci-bot`.
2. In the config repo's settings, add `ci-bot` as a collaborator with **Read** access. Don't add it to any other private repo.
3. Sign in as `ci-bot` and create an access token with only the `read:repository` permission.
4. In this repo's Actions secrets, add the token as `PULUMI_CONFIG_REPO_TOKEN`.
## Using this as a template
1. Fork or copy the repo
2. Update Proxmox node names/datastores and the `nodeConfigs` array in `01-proxmox-infra/index.ts` for your VM topology
3. Set your own config/secrets per stack with `pulumi config set [--secret]` — see each stack's `CLAUDE.md` for the full list of required keys
4. Point the CI/CD workflows at your own Gitea/GitOps instance and update the secrets above
4. Create your own private config repo and a `ci-bot` user that can read it (see [Stack config](#stack-config)), then set the repo as `repository` in each workflow's `Checkout Stack Config` steps
5. Point the CI/CD workflows at your own Gitea/GitOps instance and update the secrets above
## Roadmap
- Migrate secrets management to [OpenBao](https://openbao.org/) — replace `PULUMI_CONFIG_PASSPHRASE` and manual `Pulumi.dev.yaml` encoding with a self-hosted vault
- Migrate secrets management to [OpenBao](https://openbao.org/) — replace `PULUMI_CONFIG_PASSPHRASE` and the encrypted config repo with a self-hosted vault
- Add a third bare-metal Proxmox node for true 3-node HA parity
+110
View File
@@ -0,0 +1,110 @@
# Full cluster rebuild
Use this to rebuild the k3s cluster from new VMs. **It destroys everything stored in the cluster.** To change a running cluster, don't use this runbook.
> This procedure has not been run end to end. Stop at any checkpoint that doesn't match, and don't work around it with `--force` or by clicking through a preview.
## Why a normal `pulumi up` isn't enough
- **`02-k8s-bootstrap` commands run once.** They are recorded as done in state, so after new VMs appear, `pulumi up` would report them unchanged and install nothing.
- **`03`–`05` state describes the old cluster.** The fixed `clusterIdentifier` tells Pulumi it is still the same cluster, so it would try to update resources that no longer exist.
## Before you start
1. **Save your data.** Longhorn has no backup target configured, so its volumes are lost with the VMs. That includes `heimdall-config` and the Prometheus metrics. Grafana's database is external and is not affected.
2. **Stop automatic deploys.** In Gitea's **Actions** tab, disable the `01`, `03`, `04` and `05` workflows, and don't merge anything until the last step.
3. **Back up all state.** Run this from the repo root:
```bash
mkdir -p ~/state-backups/rebuild
for S in 01-proxmox-infra 02-k8s-bootstrap 03-k8s-infra 04-k8s-apps 05-monitoring; do
pulumi stack export --stack dev --cwd "$S" --file ~/state-backups/rebuild/$S.json
done
```
These backups describe the old cluster. Once its VMs are deleted, don't restore them.
4. **Check what the rebuild depends on:**
- pfSense is running, with the [control-plane VIP and HAProxy](pfsense-control-plane-vip.md) configured. They are not managed by Pulumi. pfSense is VM 200 on the Optiplex, so if you reinstall that host, restore pfSense from a config backup first.
- The [TrueNAS NFS share](truenas-nfs.md) exists.
5. **If you reinstalled any Proxmox host:**
- Replace its CA in `02-k8s-bootstrap/certs/` (`pve1` is B550, `pve2` is Optiplex, `pve3` is Esprimo). Get it with `cat /etc/pve/pve-root-ca.pem`, and never copy anything from `/etc/pve/priv/`.
- Check that the host's certificate lists its current IP. `/etc/hosts` must have that IP before the certificate is generated.
- Recreate the API token, then update the token and endpoint in `01-proxmox-infra` config. Commit and push the change in `.pulumi-config` (see [Stack config](../../README.md#stack-config)), because CI uses the pushed version.
- The VM template on that host is gone too, so expect step 1 to recreate it.
## 1. Recreate the VMs (`01-proxmox-infra`)
1. In Proxmox, delete the six `k3s-*` VMs. Keep the `k3s-ubuntu-noble-template` VMs.
2. In pfSense, delete the six `k3s-*` DHCP static mappings. New VMs get new MAC addresses.
3. Sync state and preview:
```bash
pulumi refresh --stack dev --cwd 01-proxmox-infra
pulumi preview --stack dev --cwd 01-proxmox-infra
```
**Checkpoint:** the preview creates six VMs and six DHCP mappings, plus a template for any reinstalled host. It must show no replace or delete. These resources are protected, so if one is still in state after the refresh, find its URN with `pulumi stack --show-urns` and remove only that entry:
```bash
pulumi state delete --force --stack dev --cwd 01-proxmox-infra '<urn>'
```
4. Deploy. The VMs stay stopped until step 3.
```bash
pulumi up --stack dev --cwd 01-proxmox-infra
```
## 2. Clear the state of `02`–`05`
Only do this after the old VMs are gone. It removes Pulumi's records and doesn't touch real resources or `Pulumi.dev.yaml`. `--force` is needed because `05-monitoring` protects its namespace and Helm release, so check that the old cluster is really gone before running it.
```bash
for S in 05-monitoring 04-k8s-apps 03-k8s-infra 02-k8s-bootstrap; do
pulumi state delete --all --force --yes --stack dev --cwd "$S"
done
```
Previews of `03`–`05` fail until step 3 is done, because `02` has no `kubeconfig` output yet.
## 3. Bootstrap k3s (`02-k8s-bootstrap`)
```bash
pulumi preview --stack dev --cwd 02-k8s-bootstrap
pulumi up --stack dev --cwd 02-k8s-bootstrap
```
**Checkpoint:** the preview only creates resources. The deploy starts the VMs, installs k3s on master-1, waits for the VIP, then joins the other nodes through it. If a step fails, fix the cause and run `pulumi up` again.
Check the new cluster with its own kubeconfig:
```bash
(umask 077; pulumi stack output kubeconfig --show-secrets --stack dev --cwd 02-k8s-bootstrap > ~/k3s-rebuilt.yaml)
KUBECONFIG=~/k3s-rebuilt.yaml kubectl get nodes
```
**Checkpoint:** all six nodes are `Ready`. Then replace your normal kubeconfig with this file, because the old one no longer works.
## 4. Deploy `03`, `04` and `05`
Deploy these through Gitea, because the runners have the `helm` CLI that `03` needs. Re-enable each workflow as you reach it, and wait for each run to finish.
1. Run the **Deploy k8s Infra** workflow manually.
2. Run the **Deploy k8s Apps** workflow manually.
3. Run the **Deploy Monitoring** workflow manually.
## 5. Verify
```bash
kubectl get nodes
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded
kubectl get pvc -A
kubectl get nodes.longhorn.io -n longhorn-system
kubectl get certificates -A
```
**Checkpoint:** nodes are `Ready`, no pods are unhealthy, PVCs are `Bound`, and certificates become `Ready`. New certificates come from Let's Encrypt, which rate-limits repeated requests for the same hostnames, so avoid repeated rebuilds in a short period.
Run `pulumi preview --stack dev --cwd <stack>` for all five stacks. None should show changes. Re-enable the `01` workflow, restore any data you saved, and delete `~/k3s-rebuilt.yaml` and `~/state-backups/rebuild`.