Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b21d5fc268 | ||
|
|
3d5b2ba097 | ||
|
|
3320f11e4b | ||
|
|
39dbfafe1c | ||
|
|
356f5b7ad4 | ||
|
|
6647d55050 | ||
|
|
13330ef3fb | ||
|
|
855d1cce85 | ||
|
|
9b388ff8e2 | ||
|
|
0d5f49591a | ||
|
|
12400b4c83 | ||
|
|
05bec1a5ff | ||
|
|
f6f74d9977 | ||
|
|
f2b8704914 | ||
|
|
be09d7592f | ||
|
|
abac1bf532 | ||
|
|
282e1c5236 | ||
|
|
339dcdd214 | ||
|
|
9b15ea5d33 | ||
|
|
344f748b84 | ||
|
|
84cf39e7d9 | ||
|
|
afc9fd36d7 | ||
|
|
3e6c8188da | ||
|
|
4c3a2b4226 | ||
|
|
c40fc0caac | ||
|
|
49fd2ba307 | ||
|
|
85ce271fd6 |
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
# Old Gitea token in deleted .env.local. Confirmed revoked (API returned 401) on 2026-11-22.
|
||||||
|
8c69ec772ab5f0df73fa2614e5b8b22adb9bbd15:.env.local:gitea-access-token:2
|
||||||
@@ -15,6 +15,10 @@
|
|||||||
# PATH path below /api/v1, e.g. /repos/kasun/homelab-infrastructure-as-code/pulls?state=open
|
# PATH path below /api/v1, e.g. /repos/kasun/homelab-infrastructure-as-code/pulls?state=open
|
||||||
# BODY JSON string, or @file to send a file
|
# BODY JSON string, or @file to send a file
|
||||||
#
|
#
|
||||||
|
# Read-only CI wait: gitea.sh WAIT /repos/OWNER/REPO/commits/SHA/status
|
||||||
|
# Polls until checks finish. Exit 0: passed or no CI ran. 1: a check failed.
|
||||||
|
# 2: bad usage. 3: timed out after 15 minutes.
|
||||||
|
#
|
||||||
# Config (outside the repo, never committed):
|
# Config (outside the repo, never committed):
|
||||||
# ${XDG_CONFIG_HOME:-~/.config}/homelab-agent/url e.g. http://192.168.1.208:3000
|
# ${XDG_CONFIG_HOME:-~/.config}/homelab-agent/url e.g. http://192.168.1.208:3000
|
||||||
# ${XDG_CONFIG_HOME:-~/.config}/homelab-agent/token chmod 600
|
# ${XDG_CONFIG_HOME:-~/.config}/homelab-agent/token chmod 600
|
||||||
@@ -28,6 +32,29 @@ method=${1:?usage: gitea.sh METHOD PATH [BODY]}
|
|||||||
path=${2:?usage: gitea.sh METHOD PATH [BODY]}
|
path=${2:?usage: gitea.sh METHOD PATH [BODY]}
|
||||||
body=${3:-}
|
body=${3:-}
|
||||||
|
|
||||||
|
if [[ "$method" == "WAIT" ]]; then
|
||||||
|
[[ "$path" =~ ^/repos/[^/]+/[^/]+/commits/[0-9a-f]{40}/status$ ]] \
|
||||||
|
|| { echo "WAIT only accepts /repos/OWNER/REPO/commits/SHA/status" >&2; exit 2; }
|
||||||
|
for ((i = 1; i <= 45; i++)); do
|
||||||
|
status=$("$0" GET "$path") || status='{}'
|
||||||
|
total=$(jq '.statuses // [] | length' <<<"$status")
|
||||||
|
running=$(jq '[.statuses // [] | .[] | select(.status == "pending" or .status == "running")] | length' <<<"$status")
|
||||||
|
# Give checks time to register. Path-filtered workflows may never start any.
|
||||||
|
if (( total == 0 && i >= 7 )); then
|
||||||
|
echo "no CI ran"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if (( total > 0 && running == 0 && i >= 4 )); then
|
||||||
|
jq -r '.statuses[] | "\(.context): \(.status) \(.target_url)"' <<<"$status"
|
||||||
|
jq -e '[.statuses[].status] | any(. == "failure" or . == "error") | not' <<<"$status" >/dev/null || exit 1
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep 20
|
||||||
|
done
|
||||||
|
echo "timed out waiting for CI" >&2
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
case "$method" in
|
case "$method" in
|
||||||
GET | POST | PATCH | PUT | DELETE) ;;
|
GET | POST | PATCH | PUT | DELETE) ;;
|
||||||
*) echo "unsupported method: $method" >&2; exit 2 ;;
|
*) echo "unsupported method: $method" >&2; exit 2 ;;
|
||||||
|
|||||||
@@ -20,9 +20,49 @@
|
|||||||
"Bash(kubectl logs *)",
|
"Bash(kubectl logs *)",
|
||||||
"Bash(kubectl top *)",
|
"Bash(kubectl top *)",
|
||||||
"Bash(kubectl config get-contexts *)",
|
"Bash(kubectl config get-contexts *)",
|
||||||
|
"Bash(git log *)",
|
||||||
|
"Bash(git status *)",
|
||||||
|
"Bash(git diff *)",
|
||||||
|
"Bash(git show *)",
|
||||||
|
"Bash(git grep *)",
|
||||||
|
"Bash(git blame *)",
|
||||||
|
"Bash(git ls-files *)",
|
||||||
|
"Bash(git ls-tree *)",
|
||||||
|
"Bash(git rev-parse *)",
|
||||||
|
"Bash(git describe *)",
|
||||||
|
"Bash(git shortlog *)",
|
||||||
|
"Bash(git merge-base *)",
|
||||||
|
"Bash(git reflog show *)",
|
||||||
|
"Bash(git stash list *)",
|
||||||
|
"Bash(git branch --list *)",
|
||||||
|
"Bash(git branch -a *)",
|
||||||
|
"Bash(git branch -v *)",
|
||||||
|
"Bash(git tag --list *)",
|
||||||
|
"Bash(git remote -v)",
|
||||||
|
"Bash(git fetch *)",
|
||||||
|
"Bash(pulumi about *)",
|
||||||
|
"Bash(pulumi plugin ls *)",
|
||||||
|
"Bash(kubectl api-resources *)",
|
||||||
|
"Bash(kubectl api-versions *)",
|
||||||
|
"Bash(kubectl explain *)",
|
||||||
|
"Bash(kubectl version *)",
|
||||||
|
"Bash(kubectl events *)",
|
||||||
|
"Bash(kubectl cluster-info)",
|
||||||
|
"Bash(kubectl auth can-i *)",
|
||||||
|
"Bash(kubectl rollout status *)",
|
||||||
|
"Bash(kubectl rollout history *)",
|
||||||
|
"Bash(kubectl config current-context *)",
|
||||||
|
"Bash(npm ls *)",
|
||||||
|
"Bash(npm outdated *)",
|
||||||
|
"Bash(ls *)",
|
||||||
|
"Bash(pwd)",
|
||||||
|
"Bash(wc *)",
|
||||||
|
"Bash(which *)",
|
||||||
|
"Bash(jq *)",
|
||||||
"Bash(git add *)",
|
"Bash(git add *)",
|
||||||
"Bash(git switch *)",
|
"Bash(git switch *)",
|
||||||
"Bash(.claude/scripts/gitea.sh GET *)",
|
"Bash(.claude/scripts/gitea.sh GET *)",
|
||||||
|
"Bash(.claude/scripts/gitea.sh WAIT *)",
|
||||||
"Bash(.claude/scripts/gitea.sh POST *)",
|
"Bash(.claude/scripts/gitea.sh POST *)",
|
||||||
"Bash(git commit *)",
|
"Bash(git commit *)",
|
||||||
"Bash(git push *)",
|
"Bash(git push *)",
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
---
|
||||||
|
name: merge
|
||||||
|
description: Commit the staged and unstaged changes that fit the branch with meaningful messages, push a branch, open a Gitea PR, wait for CI, and merge it, without stopping for confirmation.
|
||||||
|
argument-hint: [optional note on intent, or paths to limit the merge to]
|
||||||
|
disable-model-invocation: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Take the working tree changes through commit, push, PR and merge in one run. If `$ARGUMENTS` names paths, include only those. If it describes intent, use it for the commit messages and PR.
|
||||||
|
|
||||||
|
Typing `/merge` is the user's explicit instruction to commit, push, open a PR and merge these changes. It satisfies the "commit" and "ask before opening or merging" rules in `CLAUDE.md` for this run. Do not ask for confirmation, and do not pause to show drafts. Stop only for a condition under "Stop conditions".
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
- Follow `CONVENTIONS.md` for branch names, commit messages and PR titles.
|
||||||
|
- Add no AI attribution to commits or PRs.
|
||||||
|
- Never use `--no-verify`, force push, or commit directly to `main`.
|
||||||
|
- Use `.claude/scripts/gitea.sh` for PR calls, because `gh` does not work here. `$REPO` below means `/repos/kasun/homelab-infrastructure-as-code`, and must be written out in full in each command.
|
||||||
|
- Never stage `Pulumi.dev.yaml`, `.env` files, keys, credentials, `.claude/settings.local.json`, or anything in `sdks/`. Leave them out, carry on, and mention them in the report.
|
||||||
|
- Write commit messages and JSON bodies to files in the scratchpad directory with the Write tool.
|
||||||
|
- Run each command on its own, in the exact forms below, from the repo root. `cd` prefixes, pipes, loops and redirects cause permission prompts.
|
||||||
|
|
||||||
|
## Stop conditions
|
||||||
|
|
||||||
|
Stop and report only if:
|
||||||
|
|
||||||
|
- HEAD is detached, or a merge or rebase is in progress.
|
||||||
|
- There are no changes and no unpushed commits.
|
||||||
|
- Typecheck or `pulumi preview` fails.
|
||||||
|
- The preview shows a replace or delete of a VM, a PVC, or an imported resource.
|
||||||
|
- A file that looks like a secret is the only change.
|
||||||
|
- A commit hook, push or API call fails after one corrected retry of a message-format error.
|
||||||
|
- CI fails, or the PR is not mergeable.
|
||||||
|
|
||||||
|
Leave the branch and PR in place when stopping after they exist, and say what is needed to continue.
|
||||||
|
|
||||||
|
## 1. Inspect
|
||||||
|
|
||||||
|
1. Run `git status`, `git diff --staged`, `git diff`, and `git log --oneline -5`. Read any untracked files that would be included.
|
||||||
|
2. Run `git fetch origin main`.
|
||||||
|
3. On a non-`main` branch, run `.claude/scripts/gitea.sh GET $REPO/pulls?state=open`. If this branch has an open PR, reuse it only for changes that serve its purpose. If all remaining changes are unrelated to it, take that PR through steps 6 and 7 first, which returns you to `main`, then continue with the remaining changes as new work.
|
||||||
|
|
||||||
|
## 2. Group into commits
|
||||||
|
|
||||||
|
Split by reason for the change, and decide without asking. Each commit should make sense and be revertable alone.
|
||||||
|
|
||||||
|
- First decide the PR's purpose from `$ARGUMENTS`, the conversation, the branch name, or else the largest change.
|
||||||
|
- On the first `/merge`, leave out any change that does not serve that purpose, such as an unrelated `.claude/settings.json` edit. Keep it uncommitted and untouched, do not ask, and list it in the report.
|
||||||
|
- On a repeat `/merge`, meaning an earlier run this session left changes out or its PR is still open, handle all remaining changes in this run. Give each separate purpose its own branch and PR, and take them one at a time through steps 3 to 7, so each is merged and you are back on `main` before the next starts. If `$ARGUMENTS` names paths, handle only those.
|
||||||
|
- Use one commit when the remaining changes serve one purpose, and several when they are distinct steps toward it.
|
||||||
|
- Group whole files. If one file mixes purposes, put it in the commit for its main change.
|
||||||
|
- Scope is the stack (`01-proxmox-infra/` is `proxmox-infra`), or `ci` for `.gitea/workflows/`. Omit the scope for repo-wide or `.claude/` changes.
|
||||||
|
- Add a body only when the diff shows a reason that is not obvious. Never invent a reason.
|
||||||
|
|
||||||
|
## 3. Verify
|
||||||
|
|
||||||
|
For each stack with changed code, run:
|
||||||
|
|
||||||
|
- `npm run typecheck --prefix <stack-dir>`
|
||||||
|
- `pulumi preview --cwd <stack-dir> --stack dev`
|
||||||
|
|
||||||
|
## 4. Commit and push
|
||||||
|
|
||||||
|
1. If on `main`, run `git switch -c <type>/<short-kebab-description>`. This carries the changes across.
|
||||||
|
2. For each commit, run `git add -- <paths>`, then `git commit -F <message file> -- <paths>`. Naming the paths commits only those files, whatever else is staged.
|
||||||
|
3. Run `git status` to confirm only intentionally excluded files remain.
|
||||||
|
4. Run `git push -u origin <branch>`.
|
||||||
|
|
||||||
|
## 5. Open the PR
|
||||||
|
|
||||||
|
Unless one exists, run `.claude/scripts/gitea.sh POST $REPO/pulls @<json file>` with `title`, `body`, `head` and `base: "main"`. The body says what changed, why, and the preview result for each stack.
|
||||||
|
|
||||||
|
## 6. Wait for CI
|
||||||
|
|
||||||
|
Get the SHA with `git rev-parse HEAD`, then run `.claude/scripts/gitea.sh WAIT $REPO/commits/<sha>/status` as a background command. Do not write a polling loop, because that causes a permission prompt.
|
||||||
|
|
||||||
|
- Exit 0: checks passed, or it printed `no CI ran` because workflows are path-filtered. Continue.
|
||||||
|
- Exit 1: stop, and report the failing check and its `target_url`.
|
||||||
|
- Exit 3: CI timed out. Stop and report it.
|
||||||
|
|
||||||
|
Then run `.claude/scripts/gitea.sh GET $REPO/pulls/<number>` and confirm `mergeable` is true.
|
||||||
|
|
||||||
|
## 7. Merge
|
||||||
|
|
||||||
|
1. Run `.claude/scripts/gitea.sh POST $REPO/pulls/<number>/merge @<json file>` with `{"Do":"merge","head_commit_id":"<sha>"}`, so only the commit CI checked can merge.
|
||||||
|
2. Run `git fetch origin main:main`, then `git switch main`.
|
||||||
|
|
||||||
|
## 8. Report
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Do not delete the branch, dispatch a workflow, or change a live system.
|
||||||
@@ -3,6 +3,13 @@ name: Deploy Proxmox Infra
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- "01-proxmox-infra/**"
|
||||||
|
- ".gitea/workflows/01-deploy-proxmox-infra.yaml"
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -51,7 +58,7 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: Pulumi Deploy
|
name: Pulumi Deploy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -75,7 +82,10 @@ jobs:
|
|||||||
run: pulumi package add terraform-provider marshallford/pfsense 0.22.0
|
run: pulumi package add terraform-provider marshallford/pfsense 0.22.0
|
||||||
working-directory: 01-proxmox-infra
|
working-directory: 01-proxmox-infra
|
||||||
|
|
||||||
|
# Manual runs only: a refresh that finds a VM missing drops it from state,
|
||||||
|
# and `up` would then create a blank replacement without review.
|
||||||
- name: Refresh State
|
- name: Refresh State
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
run: |
|
run: |
|
||||||
pulumi login "$PULUMI_BACKEND_URL"
|
pulumi login "$PULUMI_BACKEND_URL"
|
||||||
pulumi refresh --yes --stack dev \
|
pulumi refresh --yes --stack dev \
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "03-k8s-infra/**"
|
- "03-k8s-infra/**"
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/03-deploy-k8s-infra.yaml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "04-k8s-apps/**"
|
- "04-k8s-apps/**"
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/04-deploy-k8s-apps.yaml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "05-monitoring/**"
|
- "05-monitoring/**"
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/05-deploy-monitoring.yaml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
name: Secret Scan
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
BETTERLEAKS_VERSION: "1.10.1"
|
||||||
|
BETTERLEAKS_SHA256: c174b42d7aa60caf58c0c3e555c0e4bed01fe6b0d99a412bce777b5af4ce913e
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan:
|
||||||
|
name: Betterleaks
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Full History
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Betterleaks
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /tmp/betterleaks.tar.gz \
|
||||||
|
"https://github.com/betterleaks/betterleaks/releases/download/v${BETTERLEAKS_VERSION}/betterleaks_${BETTERLEAKS_VERSION}_linux_x64.tar.gz"
|
||||||
|
echo "${BETTERLEAKS_SHA256} /tmp/betterleaks.tar.gz" | sha256sum -c -
|
||||||
|
tar -xzf /tmp/betterleaks.tar.gz -C /tmp betterleaks
|
||||||
|
|
||||||
|
- name: Scan Git History
|
||||||
|
run: /tmp/betterleaks git . --redact --verbose --no-banner --no-color --log-opts="--all -m -p -U0"
|
||||||
Executable
+11
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Git pre-commit hook: blocks a commit if its staged changes contain a secret.
|
||||||
|
#
|
||||||
|
# Activate once per clone: git config core.hooksPath .githooks
|
||||||
|
# Skip in an emergency: git commit --no-verify
|
||||||
|
if ! command -v betterleaks >/dev/null 2>&1; then
|
||||||
|
echo "pre-commit: betterleaks is not installed, so staged changes can't be scanned" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec betterleaks git --pre-commit --staged --redact --no-banner --no-color .
|
||||||
@@ -6,3 +6,5 @@ bin/
|
|||||||
Pulumi.dev.yaml
|
Pulumi.dev.yaml
|
||||||
sdks/
|
sdks/
|
||||||
.env
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
@@ -11,6 +11,7 @@ config:
|
|||||||
packages:
|
packages:
|
||||||
pfsense:
|
pfsense:
|
||||||
source: terraform-provider
|
source: terraform-provider
|
||||||
version: 1.1.3
|
version: 1.5.1
|
||||||
parameters:
|
parameters:
|
||||||
- marshallford/pfsense
|
- marshallford/pfsense
|
||||||
|
- 0.22.0
|
||||||
@@ -25,6 +25,8 @@ const worker1Ip = config.requireSecret("worker1Ip");
|
|||||||
const worker2Ip = config.requireSecret("worker2Ip");
|
const worker2Ip = config.requireSecret("worker2Ip");
|
||||||
const worker3Ip = config.requireSecret("worker3Ip");
|
const worker3Ip = config.requireSecret("worker3Ip");
|
||||||
|
|
||||||
|
const ansibleIp = config.requireSecret("ansibleIp");
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// VM templates — one per node, cloned from the downloaded cloud image.
|
// VM templates — one per node, cloned from the downloaded cloud image.
|
||||||
// Templates are not started and have no cloud-init config; that is applied
|
// Templates are not started and have no cloud-init config; that is applied
|
||||||
@@ -35,6 +37,7 @@ const templateSettings = {
|
|||||||
template: true,
|
template: true,
|
||||||
protection: true,
|
protection: true,
|
||||||
started: false,
|
started: false,
|
||||||
|
operatingSystem: { type: "l26" },
|
||||||
stopOnDestroy: true,
|
stopOnDestroy: true,
|
||||||
scsiHardware: "virtio-scsi-pci",
|
scsiHardware: "virtio-scsi-pci",
|
||||||
cdrom: { fileId: "none" },
|
cdrom: { fileId: "none" },
|
||||||
@@ -138,7 +141,7 @@ const pveNodes = pveNodeSeeds
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ provider: n.provider, ignoreChanges: ["disks"] },
|
{ provider: n.provider, protect: true, ignoreChanges: ["disks"] },
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -288,7 +291,7 @@ const k3sVms = nodeConfigs.map(
|
|||||||
agent: { enabled: true, timeout: "30s" },
|
agent: { enabled: true, timeout: "30s" },
|
||||||
cdrom: { fileId: "none" },
|
cdrom: { fileId: "none" },
|
||||||
started: false,
|
started: false,
|
||||||
stopOnDestroy: true,
|
rebootAfterUpdate: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
provider: node.host.provider,
|
provider: node.host.provider,
|
||||||
@@ -319,10 +322,84 @@ k3sVms.forEach((vmResource, i) => {
|
|||||||
ipAddress: nodeConfigs[i].ip,
|
ipAddress: nodeConfigs[i].ip,
|
||||||
hostname: nodeConfigs[i].name,
|
hostname: nodeConfigs[i].name,
|
||||||
},
|
},
|
||||||
{ dependsOn: vmResource, provider: pfSenseProvider },
|
{ dependsOn: vmResource, provider: pfSenseProvider, protect: true },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
// Ansible control node — unprivileged LXC with a pfSense DHCP reservation.
|
||||||
|
// The MAC is fixed so the reservation can exist before the container's first
|
||||||
|
// boot; otherwise its first DHCP lease could come from the dynamic pool.
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
const ansibleHost = hostFor("pve-b550");
|
||||||
|
const ansibleMac = "02:A5:1B:00:01:54";
|
||||||
|
|
||||||
|
const ansibleTemplate = new proxmox.download.File(
|
||||||
|
"ubuntu-resolute-lxc-pve-b550",
|
||||||
|
{
|
||||||
|
nodeName: ansibleHost.nodeName,
|
||||||
|
datastoreId: ansibleHost.isoStore,
|
||||||
|
contentType: "vztmpl",
|
||||||
|
fileName: "ubuntu-26.04-standard_26.04-1_amd64.tar.zst",
|
||||||
|
url: "https://download.proxmox.com/images/system/ubuntu-26.04-standard_26.04-1_amd64.tar.zst",
|
||||||
|
overwrite: false,
|
||||||
|
overwriteUnmanaged: true,
|
||||||
|
},
|
||||||
|
{ provider: ansibleHost.provider },
|
||||||
|
);
|
||||||
|
|
||||||
|
const ansibleDhcp = new pfsense.Dhcpv4Staticmapping(
|
||||||
|
"ansible-dhcp",
|
||||||
|
{
|
||||||
|
interface: "lan",
|
||||||
|
macAddress: ansibleMac,
|
||||||
|
ipAddress: ansibleIp,
|
||||||
|
hostname: "ansible",
|
||||||
|
},
|
||||||
|
{ provider: pfSenseProvider, protect: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
new proxmox.ContainerLegacy( // NOSONAR typescript:S1848
|
||||||
|
"ansible",
|
||||||
|
{
|
||||||
|
nodeName: ansibleHost.nodeName,
|
||||||
|
description: "Ansible control node — managed by Pulumi",
|
||||||
|
tags: ["ansible"],
|
||||||
|
unprivileged: true,
|
||||||
|
features: { nesting: true },
|
||||||
|
operatingSystem: {
|
||||||
|
templateFileId: ansibleTemplate.id,
|
||||||
|
type: "ubuntu",
|
||||||
|
},
|
||||||
|
cpu: { cores: 1 },
|
||||||
|
memory: { dedicated: 1024, swap: 0 },
|
||||||
|
disk: { datastoreId: ansibleHost.dataStore, size: 8 },
|
||||||
|
networkInterfaces: [
|
||||||
|
{ name: "eth0", bridge: "vmbr0", macAddress: ansibleMac },
|
||||||
|
],
|
||||||
|
initialization: {
|
||||||
|
hostname: "ansible",
|
||||||
|
ipConfigs: [{ ipv4: { address: "dhcp" } }],
|
||||||
|
userAccount: {
|
||||||
|
keys: [
|
||||||
|
pve1SshPublicKey.apply((k) => k.trim()),
|
||||||
|
pve2SshPublicKey.apply((k) => k.trim()),
|
||||||
|
pve3SshPublicKey.apply((k) => k.trim()),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
started: true,
|
||||||
|
startOnBoot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provider: ansibleHost.provider,
|
||||||
|
dependsOn: ansibleDhcp,
|
||||||
|
retainOnDelete: true,
|
||||||
|
protect: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
export const vmIds = {
|
export const vmIds = {
|
||||||
master1: k3sVms[0].vmId,
|
master1: k3sVms[0].vmId,
|
||||||
master2: k3sVms[1].vmId,
|
master2: k3sVms[1].vmId,
|
||||||
|
|||||||
Generated
+365
-1691
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,34 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIF3TCCA8WgAwIBAgIUDXajbsIFjkrtUM/HEOAMI06xHjEwDQYJKoZIhvcNAQEL
|
||||||
|
BQAwdjEkMCIGA1UEAwwbUHJveG1veCBWaXJ0dWFsIEVudmlyb25tZW50MS0wKwYD
|
||||||
|
VQQLDCRiYTk0ZDJhZC0wOTc2LTRmZjAtODQ1Mi1kMjM1OGMxZGM3OGIxHzAdBgNV
|
||||||
|
BAoMFlBWRSBDbHVzdGVyIE1hbmFnZXIgQ0EwHhcNMjYxMTAzMDAwODM5WhcNMzYx
|
||||||
|
MDMxMDAwODM5WjB2MSQwIgYDVQQDDBtQcm94bW94IFZpcnR1YWwgRW52aXJvbm1l
|
||||||
|
bnQxLTArBgNVBAsMJGJhOTRkMmFkLTA5NzYtNGZmMC04NDUyLWQyMzU4YzFkYzc4
|
||||||
|
YjEfMB0GA1UECgwWUFZFIENsdXN0ZXIgTWFuYWdlciBDQTCCAiIwDQYJKoZIhvcN
|
||||||
|
AQEBBQADggIPADCCAgoCggIBAM1OPRmaMGdkrgVQikVCOFAF7eXL0H7lUfognG4A
|
||||||
|
Xi/D85bLKGJYF106PQFlmkvw+CvNIHCeeqvgDJc2AoV22PnKjPlP34b3j4AAoEm3
|
||||||
|
sMvKHke+N3kSfhG7hxZ8JfnV+EIZO1ZAI0X2z0ixmmn3gzIVjdtO9VycL7Nj2JJV
|
||||||
|
O+Ws+yc3j3swhVA87bIikc+sD0YT8F8dK41DQfgM01wWhieGLCk4g8DSbOt1Ypgv
|
||||||
|
hAwlKziUtUdw/teC8vmE0GwUMas/uwFVXzBEd/4ancI1SkPH/Mtu568HCVzcCBjE
|
||||||
|
wFAhdMZ90g7UXC58m5cFqs2PafDsAYv2rmSCic8yO2aZCO5nbQOtU9rN2b1e9KGs
|
||||||
|
xfDksugSJ2ZsIZ4YsG9Eao6WXkZIohANEhUkGK3yI4REiJO96/pmqf1QtNRvUZWW
|
||||||
|
YIxa56i2KrjB2RdGe9eirNlshTPA3DpJbLHmcsw1agPEI5mN4uQJ3DrSGrFwXHkB
|
||||||
|
QYW9NmgwLHUlOYdvUUq7AIY3RqCBWWkBW0vlg78W2fiaq1Gp6Mx/9HeVdriB2FGa
|
||||||
|
UlAE6CAzDI+JqQPQkmzo6QmFB3hFa9m1aPctLZo0bOKCeoyREBaPmmZfn6VaI1Xk
|
||||||
|
+mUIw6NLstdG0lS/qThNYbG5LWdRIyHdLcjsg19pFfmj9YUMphoMD7k2IG4Cu9nP
|
||||||
|
mwqlAgMBAAGjYzBhMB0GA1UdDgQWBBTKcVA3Li/Qe4f/vEsHFHc/VNVFHzAfBgNV
|
||||||
|
HSMEGDAWgBTKcVA3Li/Qe4f/vEsHFHc/VNVFHzAPBgNVHRMBAf8EBTADAQH/MA4G
|
||||||
|
A1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAMLrQvbGlgpqxSaxQKb4N
|
||||||
|
wmmRQqgWvJ7/s9UhHE5BNfkUzJ+3ktAwfbswuNc4yfREjPqRBWzd/mz/WhlsDOzR
|
||||||
|
KT+ECQpNbnlR3JBJMYOiLDwKydnYWgiTiINxtc7p74NoGe/fu8dGKiGYtsk+bmps
|
||||||
|
yP1FOp3YQ2UM1NjQoalk2sZYOCRUL1HbgfaSHEwFXskJMKprUEEjJjXLxyJey14U
|
||||||
|
u6gSvUb2T8bbycW8Ilibo5Dn/DxLFBNT154M7GHQyVSdWLoEAVVzkrlJJ9b0RYnb
|
||||||
|
PQXOySSuIvrQx8QqG6X/4AfPrm2L1O8CAAwpNi3xa6jvVX6DWT1+HOhN8MfjtYJE
|
||||||
|
9KxbG6MNxnE8A39m46O2iYfwW+zTej842N1Fq6eA7i2nMuzHB3jqNVdvxaLCNK2a
|
||||||
|
FCAilpl2iuqO5eOWZG2Gd9qcPQSslRrhJid6GV/pTeh/ZpZyf/OG4XXata+IB2aq
|
||||||
|
0ggaQgGn5dFiCklLeFsnX0k0pydz/ZVA1v5C/sVk3q07JrPJo0IKs0SuS0lsHH9n
|
||||||
|
hPIdbUH3AsG850vDTIsKYgmZdssnG13bsGwZtC8x3MS1c868PRgG/ZycdT6BGk6Q
|
||||||
|
qX9ogoFrdUy3XYSRVDb2L+Z8NEI8grFOTDRXAlp5B4BHAbvXoIeeYjGtjtOunYCo
|
||||||
|
f3Em5SShmS4B2U/jTPyDeZ0=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIF3TCCA8WgAwIBAgIUUfheavZDUF4EvmQ6q8upF7dd74UwDQYJKoZIhvcNAQEL
|
||||||
|
BQAwdjEkMCIGA1UEAwwbUHJveG1veCBWaXJ0dWFsIEVudmlyb25tZW50MS0wKwYD
|
||||||
|
VQQLDCQxZWQ0Nzc1Yi1hMjc1LTQ3ZDktYTA1Mi1kM2M1MThhYjE2MzIxHzAdBgNV
|
||||||
|
BAoMFlBWRSBDbHVzdGVyIE1hbmFnZXIgQ0EwHhcNMjYxMTAyMDMzMDIxWhcNMzYx
|
||||||
|
MDMwMDMzMDIxWjB2MSQwIgYDVQQDDBtQcm94bW94IFZpcnR1YWwgRW52aXJvbm1l
|
||||||
|
bnQxLTArBgNVBAsMJDFlZDQ3NzViLWEyNzUtNDdkOS1hMDUyLWQzYzUxOGFiMTYz
|
||||||
|
MjEfMB0GA1UECgwWUFZFIENsdXN0ZXIgTWFuYWdlciBDQTCCAiIwDQYJKoZIhvcN
|
||||||
|
AQEBBQADggIPADCCAgoCggIBAK3vi3/3+0trXhEkDXoSrOFWTuXc7x7vPmORzQ6R
|
||||||
|
V/sg1X6KTbguzSPg71B/8Qu1vRYTkS6Pf5YclpE0P+z45hCV+G8B40cAL3D1Xpbo
|
||||||
|
JTznI2gaO00XDTei1MdDTC/mwUzoNBa7osXEmMwgz7Oid7WHJbIQegwq2LEMRbqQ
|
||||||
|
UtAXsAone1eq+N2vQys57MlnXnSbMFFlY1VNfUJIinjyLZgE9klFkvVFSqy9CkUs
|
||||||
|
4Yq9M6YSgvNA77tPSH/yc0605N1462x/VRHUkY4nufrWqI8oUlcGrK8mNieCtPK7
|
||||||
|
FOr3PZXq5K0I3LsSlbp7M43Bbumnuscg0ustyf/eCM7tdMQm9E5yfQsMH+Ao390x
|
||||||
|
nBrlpVqA6RSWGAeDhspuB6Sj+InVfzoLKvhqwzlGV5S+WT+uDN4VhRdGlet/kVC8
|
||||||
|
Xn5GIRgeGR/x5zs93Xxz9OEyVhSxPB6+NP/NJ4z7OD21Oiar7GUFzPbaMpWnSChW
|
||||||
|
5Vsp2i8HUikjUyiGb8nYZfVEHwj/w3JEs+m4eTwUroT4YgLRMwahye5gJTcq19oA
|
||||||
|
xFUzStAXEGglv5AVf0ngU3KTkwFP2ROLry/FIk6ZQSedJtnBpq0+CcMZe+vKSVD7
|
||||||
|
acFZ6k/bFh4jMeD9i1/Zx+mRf8XvZEeaImxYc0P9vnxfl2XP7QiroEP7PkuFZ6As
|
||||||
|
69rpAgMBAAGjYzBhMB0GA1UdDgQWBBSex+vVqEdCLAk0eKJiSfYltlTaKTAfBgNV
|
||||||
|
HSMEGDAWgBSex+vVqEdCLAk0eKJiSfYltlTaKTAPBgNVHRMBAf8EBTADAQH/MA4G
|
||||||
|
A1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAkeVBiV4Zs+yoXKTcdy0A
|
||||||
|
Y7cEAGUY+zWQeg/eZnbNMWqG5x4UKWpA+9LZDOhAu7lBwkWoTlYLw6foDuy47uzQ
|
||||||
|
LBxqxI5gXkUi/CvIlOZ8AjuNdVU02wdDoib8O5mJDpvEMIOQawbRno84mlYdzhRs
|
||||||
|
BHeBugNdiORBk1JbqZjsvAmtlbjDaDNV0oxm9C5Np4F9sbA9lChkz+bv/KJxYexB
|
||||||
|
P91nonJfmyajDkWqrCaFIyjliNjfmff1CM2EpNDlngwXo6XjSgWjFuEVtHE2xl3t
|
||||||
|
J21a0WSxuIkQUNWJMcyr9j9LLAnZG06XCNEy6g2R8vMFmm3xGM76NkABkCsFT5PZ
|
||||||
|
lEmrAVmVDWKx2heAlVmVQ1wFrlGVYnlVxTWWcIHrHRCJJfc12tCwczbumBDxO45u
|
||||||
|
iJ5d4GI5HBSYz3kdMzzpBhLIH5l5h/AzmGebkhbSAK7I/V0kPOQvOVVrtCYr/Ec4
|
||||||
|
gU1AV6bjiu3USOeiAqkxW791Xp0IFkP+8e4FYohyG6QyS5jHtf0Vtl8/xJSKU9mj
|
||||||
|
idc4dwZSWu0V9LaNcMbk8kyRTvX/LwKuLOYp++a0/vxUMvgsv0yqeElvWAJB33xe
|
||||||
|
Ih/rsFCIC247ccQZ1g4JGHRJqRTAIQT4VsDqSRh+0KwarPvgJPEsluDB9bholfZ9
|
||||||
|
LoZqoymHgYm95H7LaDTdytA=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFzTCCA7WgAwIBAgIUHFXkUXk2cmTrkKJxLSTvxhg5lfowDQYJKoZIhvcNAQEL
|
||||||
|
BQAwdjEkMCIGA1UEAwwbUHJveG1veCBWaXJ0dWFsIEVudmlyb25tZW50MS0wKwYD
|
||||||
|
VQQLDCQ4NzNhNGYzMS05YWQ2LTQ3MDYtYTg5MS0xZmU2NDIzNzgyYzQxHzAdBgNV
|
||||||
|
BAoMFlBWRSBDbHVzdGVyIE1hbmFnZXIgQ0EwHhcNMjUwODI5MjIzNjU5WhcNMzUw
|
||||||
|
ODI3MjIzNjU5WjB2MSQwIgYDVQQDDBtQcm94bW94IFZpcnR1YWwgRW52aXJvbm1l
|
||||||
|
bnQxLTArBgNVBAsMJDg3M2E0ZjMxLTlhZDYtNDcwNi1hODkxLTFmZTY0MjM3ODJj
|
||||||
|
NDEfMB0GA1UECgwWUFZFIENsdXN0ZXIgTWFuYWdlciBDQTCCAiIwDQYJKoZIhvcN
|
||||||
|
AQEBBQADggIPADCCAgoCggIBAL3iGXWp8BkVcXIpfVybY0slRl36bQp3OkswgTc9
|
||||||
|
awdsN62wWkN6NIa4yZsItzjHnCyte6Nac9qCmu25Pwhw4QEc7XRWuh4sVPvw4ica
|
||||||
|
0JgDw7yJbn8IM3C7qm9+g5iXoGcOdY41xsKJz7+cWgySh4EBPWYEuKOxtWuvTRzV
|
||||||
|
Q3b/o+LT8X/Q5qR7EehgLVy5KtWZCDjV/6862hh9zEiA87zosULHtVYAa1lWtL48
|
||||||
|
9q0flbQsIIFmaeio/iEJR66YHXTF7AlKaIrXLVCMRdRV6oef/b4SqECwnZVQnE28
|
||||||
|
I1uwnOV88MIfr9sINhdW7ogxSvlGFptkDkRVXnqfIOwLJjjPRuIifFg98KYR1gLp
|
||||||
|
vGMeRY96mJvJ98NUSeVZOQMVs8vnEXHlpPewsklQty23KQJTr42R5zIKXSguZZUU
|
||||||
|
NjNgDTPdUu45jNDu8nzU8guK3AcTkLbtmbL5uUCGZo860ScUFQUtuibou6plYVjx
|
||||||
|
Yca+mH3QoZI/lfnB/f2aNL9JP+DlTUfwTMgSAKiilOOqWvsHLjXvZjZupoAW0Xh4
|
||||||
|
CREKf0n5T9ldy6goRzbmWE475uc0UPtmLdlVrqt0F89YH8wZAlPu91a6pvomWUYX
|
||||||
|
pokkimWvPf3C+YgRDJIkolAQ1l+egnS/KR2tgLVEKktfXm4nRk2VotWOcsBDme40
|
||||||
|
Hwz3AgMBAAGjUzBRMB0GA1UdDgQWBBTK4krmBcFK3+fphDn5+DuknRdz4TAfBgNV
|
||||||
|
HSMEGDAWgBTK4krmBcFK3+fphDn5+DuknRdz4TAPBgNVHRMBAf8EBTADAQH/MA0G
|
||||||
|
CSqGSIb3DQEBCwUAA4ICAQCFW1DCfMOMTy/MvbYT8KKhwLujjjQvdKsgnRaktRzq
|
||||||
|
j66dohxWHiN0jDDgIeT1DkB/guh5pqcDnwVaiVZAagEJ/NvigTPRodTcijhomCzz
|
||||||
|
p9GCaMnl21YX2D5Ckg69iJ+AVekwNTHWqAVwbXZj1dpxs3SBceps9NQvzfNUI823
|
||||||
|
jDNpgYo9E4kymBIe8ibXNXiGbrZb171aqWzdJEdXIGmvbruXiIOwkkynJHViMo1Y
|
||||||
|
8RiUQx+NwGJw5NTTuHuCI0zYTxrqObPvtfwvyYEpaOf1fs246fRHDo8okffxLuMR
|
||||||
|
AbEVJuU4GCh3JhO5M1BUWEKllx4wZW8/ygtHc8TkKwxMQS86/bEptSoMn0TJ0XeC
|
||||||
|
YnnhML0XD0aRtcoqRhmfBjMntNeiHaAkXusLyc8LNyynhqWv3ldTw05JSfVSlhjC
|
||||||
|
paJNzLYYFa2VC/EG++1Kv6nvZjNZHzV34fkBw9dS6cJbhp5WK7WQgoZgIUF6kJN3
|
||||||
|
nEm0DzRUR6R4KjNgYJxmhXxHvKOeYyp52muiNkehFZ0d1/RdftgUvjh8pR7KEfSH
|
||||||
|
JaO5K0BWMy7infAcAOHb6krEMwfkr3NXUfF4pbuqNGQx5MHYfXkPiIdPy6q6ZqmO
|
||||||
|
ittFd5xKjL7J0QaDkAcxmJFJ2FdtQhoV14eKESBUdQV0NCSKXQgebkV5a8ik0mJU
|
||||||
|
GA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
+95
-22
@@ -4,14 +4,21 @@ import * as command from "@pulumi/command";
|
|||||||
const config = new pulumi.Config();
|
const config = new pulumi.Config();
|
||||||
|
|
||||||
// Bootstrap commands run once, on a fresh install. Without this, a changed VM
|
// Bootstrap commands run once, on a fresh install. Without this, a changed VM
|
||||||
// ID or command would re-run the k3s installer on the live cluster. After
|
// ID, node IP, SSH key or command would re-run the k3s installer on the live
|
||||||
// recreating a VM, re-run its commands explicitly with --target-replace.
|
// cluster. After recreating a VM, re-run its commands explicitly with
|
||||||
|
// --target-replace.
|
||||||
pulumi.runtime.registerResourceTransform((args) =>
|
pulumi.runtime.registerResourceTransform((args) =>
|
||||||
args.type.startsWith("command:")
|
args.type.startsWith("command:")
|
||||||
? {
|
? {
|
||||||
props: args.props,
|
props: args.props,
|
||||||
opts: pulumi.mergeOptions(args.opts, {
|
opts: pulumi.mergeOptions(args.opts, {
|
||||||
ignoreChanges: ["create", "triggers"],
|
ignoreChanges: [
|
||||||
|
"create",
|
||||||
|
"triggers",
|
||||||
|
"connection",
|
||||||
|
"environment",
|
||||||
|
"stdin",
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
@@ -51,6 +58,19 @@ const worker3Ip = infraRef.requireOutput("worker3Ip");
|
|||||||
// Pre-shared k3s cluster token
|
// Pre-shared k3s cluster token
|
||||||
const k3sToken = config.requireSecret("k3sToken");
|
const k3sToken = config.requireSecret("k3sToken");
|
||||||
|
|
||||||
|
// Version for fresh installs. Changing it does not upgrade the live cluster.
|
||||||
|
const k3sVersion = "v1.36.2+k3s1";
|
||||||
|
const k3sInstallerUrl = `https://raw.githubusercontent.com/k3s-io/k3s/${encodeURIComponent(k3sVersion)}/install.sh`;
|
||||||
|
|
||||||
|
// Runs the pinned installer. The token arrives on stdin and travels in the
|
||||||
|
// environment, so it never appears in process arguments.
|
||||||
|
function k3sInstallScript(
|
||||||
|
installEnv: pulumi.Input<string>,
|
||||||
|
installArgs: pulumi.Input<string>,
|
||||||
|
): pulumi.Output<string> {
|
||||||
|
return pulumi.interpolate`set -euo pipefail; IFS= read -r K3S_TOKEN || true; export K3S_TOKEN; curl -sfL ${k3sInstallerUrl} | sudo --preserve-env=K3S_TOKEN INSTALL_K3S_VERSION='${k3sVersion}' ${installEnv} sh -s - ${installArgs}`;
|
||||||
|
}
|
||||||
|
|
||||||
// Control-plane VIP — floating IP for API server access, ARP-announced by
|
// Control-plane VIP — floating IP for API server access, ARP-announced by
|
||||||
// kube-vip on whichever master is alive. Added as a TLS SAN on master-1's
|
// kube-vip on whichever master is alive. Added as a TLS SAN on master-1's
|
||||||
// cert below, then used (instead of master1Ip) for every other node's join
|
// cert below, then used (instead of master1Ip) for every other node's join
|
||||||
@@ -81,37 +101,56 @@ function conn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Step 1: Start all VMs (fire-and-forget — VMs are owned by proxmox-infra)
|
// Step 1: Start all VMs (VMs are owned by proxmox-infra)
|
||||||
// triggers: vmId — forces re-run when VMs are deleted and recreated
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Succeeds if the VM is already running, or reaches running after a start.
|
||||||
|
// TLS is verified against the host's Proxmox CA in certs/. The API token comes
|
||||||
|
// from PVE_API_TOKEN and reaches curl on stdin, keeping it out of process
|
||||||
|
// arguments.
|
||||||
|
function startVmScript(
|
||||||
|
endpoint: pulumi.Input<string>,
|
||||||
|
caName: string,
|
||||||
|
nodeName: string,
|
||||||
|
vmId: pulumi.Input<string>,
|
||||||
|
): pulumi.Output<string> {
|
||||||
|
return pulumi.interpolate`base="${endpoint}/api2/json/nodes/${nodeName}/qemu/${vmId}/status"; ca="certs/${caName}-ca.pem"; auth() { printf 'header = "Authorization: PVEAPIToken=%s"
|
||||||
|
' "$PVE_API_TOKEN"; }; is_running() { auth | curl -sf -K - --cacert "$ca" "$base/current" | grep -Eq '"status" *: *"running"'; }; is_running && exit 0; auth | curl -sf -K - --cacert "$ca" -X POST "$base/start" >/dev/null || exit 1; for i in $(seq 1 30); do is_running && exit 0; sleep 2; done; exit 1`;
|
||||||
|
}
|
||||||
|
|
||||||
const startMaster1 = new command.local.Command("start-master-1", {
|
const startMaster1 = new command.local.Command("start-master-1", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve1ApiToken}" "${pve1Endpoint}/api2/json/nodes/pve/qemu/${master1VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve1Endpoint, "pve1", "pve", master1VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve1ApiToken },
|
||||||
triggers: [master1VmId],
|
triggers: [master1VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
const startMaster2 = new command.local.Command("start-master-2", {
|
const startMaster2 = new command.local.Command("start-master-2", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve3ApiToken}" "${pve3Endpoint}/api2/json/nodes/pve/qemu/${master2VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve3Endpoint, "pve3", "pve", master2VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve3ApiToken },
|
||||||
triggers: [master2VmId],
|
triggers: [master2VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
const startWorker1 = new command.local.Command("start-worker-1", {
|
const startWorker1 = new command.local.Command("start-worker-1", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve1ApiToken}" "${pve1Endpoint}/api2/json/nodes/pve/qemu/${worker1VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve1Endpoint, "pve1", "pve", worker1VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve1ApiToken },
|
||||||
triggers: [worker1VmId],
|
triggers: [worker1VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
const startMaster3 = new command.local.Command("start-master-3", {
|
const startMaster3 = new command.local.Command("start-master-3", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve2ApiToken}" "${pve2Endpoint}/api2/json/nodes/pve-bckp/qemu/${master3VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve2Endpoint, "pve2", "pve-bckp", master3VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve2ApiToken },
|
||||||
triggers: [master3VmId],
|
triggers: [master3VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
const startWorker2 = new command.local.Command("start-worker-2", {
|
const startWorker2 = new command.local.Command("start-worker-2", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve2ApiToken}" "${pve2Endpoint}/api2/json/nodes/pve-bckp/qemu/${worker2VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve2Endpoint, "pve2", "pve-bckp", worker2VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve2ApiToken },
|
||||||
triggers: [worker2VmId],
|
triggers: [worker2VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
const startWorker3 = new command.local.Command("start-worker-3", {
|
const startWorker3 = new command.local.Command("start-worker-3", {
|
||||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve3ApiToken}" "${pve3Endpoint}/api2/json/nodes/pve/qemu/${worker3VmId}/status/start" 2>/dev/null || true`,
|
create: startVmScript(pve3Endpoint, "pve3", "pve", worker3VmId),
|
||||||
|
environment: { PVE_API_TOKEN: pve3ApiToken },
|
||||||
triggers: [worker3VmId],
|
triggers: [worker3VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
@@ -143,7 +182,11 @@ const installMaster1 = new command.remote.Command(
|
|||||||
"install-k3s-master-1",
|
"install-k3s-master-1",
|
||||||
{
|
{
|
||||||
connection: conn(master1Ip),
|
connection: conn(master1Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_TOKEN='${k3sToken}' sh -s - server --cluster-init --tls-san ${master1Ip} --tls-san ${controlPlaneVipAddress} --disable servicelb --node-name k3s-master-1`,
|
create: k3sInstallScript(
|
||||||
|
"",
|
||||||
|
pulumi.interpolate`server --cluster-init --tls-san ${master1Ip} --tls-san ${controlPlaneVipAddress} --disable servicelb --node-name k3s-master-1`,
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [master1VmId],
|
triggers: [master1VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitMaster1Ssh] },
|
{ dependsOn: [waitMaster1Ssh] },
|
||||||
@@ -176,7 +219,9 @@ const waitControlPlaneVipReady = new command.remote.Command(
|
|||||||
"wait-control-plane-vip-ready",
|
"wait-control-plane-vip-ready",
|
||||||
{
|
{
|
||||||
connection: conn(master1Ip),
|
connection: conn(master1Ip),
|
||||||
create: pulumi.interpolate`for i in $(seq 1 60); do curl -sk --max-time 3 https://${controlPlaneVipAddress}:6443/healthz && exit 0; sleep 5; done; exit 1`,
|
// 401/403 still prove the API server answered through the VIP: the request
|
||||||
|
// is anonymous, and some clusters reject anonymous health checks.
|
||||||
|
create: pulumi.interpolate`for i in $(seq 1 60); do code=$(curl -sk --max-time 3 -o /dev/null -w '%{http_code}' https://${controlPlaneVipAddress}:6443/healthz); case "$code" in 200|401|403) exit 0;; esac; sleep 5; done; exit 1`,
|
||||||
triggers: [master1VmId],
|
triggers: [master1VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitK3sMaster1Ready] },
|
{ dependsOn: [waitK3sMaster1Ready] },
|
||||||
@@ -210,7 +255,11 @@ const joinMaster2 = new command.remote.Command(
|
|||||||
"join-k3s-master-2",
|
"join-k3s-master-2",
|
||||||
{
|
{
|
||||||
connection: conn(master2Ip),
|
connection: conn(master2Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_TOKEN='${k3sToken}' sh -s - server --server https://${controlPlaneVipAddress}:6443 --disable servicelb --node-name k3s-master-2`,
|
create: k3sInstallScript(
|
||||||
|
"",
|
||||||
|
pulumi.interpolate`server --server https://${controlPlaneVipAddress}:6443 --disable servicelb --node-name k3s-master-2`,
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [master2VmId],
|
triggers: [master2VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitMaster2Ssh, waitControlPlaneVipReady] },
|
{ dependsOn: [waitMaster2Ssh, waitControlPlaneVipReady] },
|
||||||
@@ -220,7 +269,11 @@ const joinMaster3 = new command.remote.Command(
|
|||||||
"join-k3s-master-3",
|
"join-k3s-master-3",
|
||||||
{
|
{
|
||||||
connection: conn(master3Ip),
|
connection: conn(master3Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_TOKEN='${k3sToken}' sh -s - server --server https://${controlPlaneVipAddress}:6443 --disable servicelb --node-name k3s-master-3`,
|
create: k3sInstallScript(
|
||||||
|
"",
|
||||||
|
pulumi.interpolate`server --server https://${controlPlaneVipAddress}:6443 --disable servicelb --node-name k3s-master-3`,
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [master3VmId],
|
triggers: [master3VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitMaster3Ssh, waitControlPlaneVipReady, joinMaster2] },
|
{ dependsOn: [waitMaster3Ssh, waitControlPlaneVipReady, joinMaster2] },
|
||||||
@@ -264,7 +317,11 @@ const joinWorker1 = new command.remote.Command(
|
|||||||
"join-k3s-worker-1",
|
"join-k3s-worker-1",
|
||||||
{
|
{
|
||||||
connection: conn(worker1Ip),
|
connection: conn(worker1Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_URL=https://${controlPlaneVipAddress}:6443 K3S_TOKEN='${k3sToken}' sh -s - --node-name k3s-worker-1`,
|
create: k3sInstallScript(
|
||||||
|
pulumi.interpolate`K3S_URL=https://${controlPlaneVipAddress}:6443`,
|
||||||
|
"--node-name k3s-worker-1",
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [worker1VmId],
|
triggers: [worker1VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitWorker1Ssh] },
|
{ dependsOn: [waitWorker1Ssh] },
|
||||||
@@ -274,7 +331,11 @@ const joinWorker2 = new command.remote.Command(
|
|||||||
"join-k3s-worker-2",
|
"join-k3s-worker-2",
|
||||||
{
|
{
|
||||||
connection: conn(worker2Ip),
|
connection: conn(worker2Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_URL=https://${controlPlaneVipAddress}:6443 K3S_TOKEN='${k3sToken}' sh -s - --node-name k3s-worker-2`,
|
create: k3sInstallScript(
|
||||||
|
pulumi.interpolate`K3S_URL=https://${controlPlaneVipAddress}:6443`,
|
||||||
|
"--node-name k3s-worker-2",
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [worker2VmId],
|
triggers: [worker2VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitWorker2Ssh] },
|
{ dependsOn: [waitWorker2Ssh] },
|
||||||
@@ -284,7 +345,11 @@ const joinWorker3 = new command.remote.Command(
|
|||||||
"join-k3s-worker-3",
|
"join-k3s-worker-3",
|
||||||
{
|
{
|
||||||
connection: conn(worker3Ip),
|
connection: conn(worker3Ip),
|
||||||
create: pulumi.interpolate`curl -sfL https://get.k3s.io | sudo K3S_URL=https://${controlPlaneVipAddress}:6443 K3S_TOKEN='${k3sToken}' sh -s - --node-name k3s-worker-3`,
|
create: k3sInstallScript(
|
||||||
|
pulumi.interpolate`K3S_URL=https://${controlPlaneVipAddress}:6443`,
|
||||||
|
"--node-name k3s-worker-3",
|
||||||
|
),
|
||||||
|
stdin: k3sToken,
|
||||||
triggers: [worker3VmId],
|
triggers: [worker3VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [waitWorker3Ssh] },
|
{ dependsOn: [waitWorker3Ssh] },
|
||||||
@@ -304,11 +369,15 @@ workers.forEach((worker, i) => {
|
|||||||
connection: conn(worker),
|
connection: conn(worker),
|
||||||
create: `set -euo pipefail;
|
create: `set -euo pipefail;
|
||||||
DISK_ID=$(ls /dev/disk/by-id/ | grep 'scsi1');
|
DISK_ID=$(ls /dev/disk/by-id/ | grep 'scsi1');
|
||||||
|
[ "$(echo "$DISK_ID" | wc -l)" -eq 1 ];
|
||||||
DISK_PATH="/dev/disk/by-id/$DISK_ID";
|
DISK_PATH="/dev/disk/by-id/$DISK_ID";
|
||||||
sudo blkid "$DISK_PATH" >/dev/null 2>&1 || sudo mkfs.ext4 "$DISK_PATH";
|
BLKID_RC=0;
|
||||||
|
sudo blkid -p "$DISK_PATH" >/dev/null 2>&1 || BLKID_RC=$?;
|
||||||
|
if [ "$BLKID_RC" -eq 2 ]; then sudo mkfs.ext4 "$DISK_PATH"; elif [ "$BLKID_RC" -ne 0 ]; then exit "$BLKID_RC"; fi;
|
||||||
sudo mkdir -p /mnt/longhorn-extra;
|
sudo mkdir -p /mnt/longhorn-extra;
|
||||||
echo ""$DISK_PATH" /mnt/longhorn-extra ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab;
|
grep -qs " /mnt/longhorn-extra " /etc/fstab || echo "$DISK_PATH /mnt/longhorn-extra ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab;
|
||||||
sudo mount -a;
|
sudo mount -a;
|
||||||
|
mountpoint -q /mnt/longhorn-extra;
|
||||||
df -h /mnt/longhorn-extra`,
|
df -h /mnt/longhorn-extra`,
|
||||||
},
|
},
|
||||||
{ dependsOn: workerSshReader[i] },
|
{ dependsOn: workerSshReader[i] },
|
||||||
@@ -326,7 +395,10 @@ const getKubeconfig = new command.remote.Command(
|
|||||||
create: `sudo cat /etc/rancher/k3s/k3s.yaml`,
|
create: `sudo cat /etc/rancher/k3s/k3s.yaml`,
|
||||||
triggers: [master1VmId],
|
triggers: [master1VmId],
|
||||||
},
|
},
|
||||||
{ dependsOn: [joinWorker1, joinWorker2, joinWorker3] },
|
{
|
||||||
|
dependsOn: [joinWorker1, joinWorker2, joinWorker3],
|
||||||
|
additionalSecretOutputs: ["stdout"],
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -377,7 +449,8 @@ allVms.forEach(({ id, ip, name, readiness }) => {
|
|||||||
`install-packages-${name}`,
|
`install-packages-${name}`,
|
||||||
{
|
{
|
||||||
connection: conn(ip),
|
connection: conn(ip),
|
||||||
create: pulumi.interpolate`sudo apt update && sudo apt install -y qemu-guest-agent && sudo systemctl enable --now qemu-guest-agent`,
|
// cloud-init exit code 2 means it finished with recoverable errors.
|
||||||
|
create: pulumi.interpolate`{ sudo cloud-init status --wait >/dev/null || [ $? -eq 2 ]; } && sudo apt-get -o DPkg::Lock::Timeout=300 update && sudo apt-get -o DPkg::Lock::Timeout=300 install -y qemu-guest-agent && sudo systemctl enable --now qemu-guest-agent`,
|
||||||
triggers: [id],
|
triggers: [id],
|
||||||
},
|
},
|
||||||
{ dependsOn: readiness },
|
{ dependsOn: readiness },
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ const domain = config.requireSecret("domain");
|
|||||||
const longhornUiUser = config.requireSecret("longhornUiUser");
|
const longhornUiUser = config.requireSecret("longhornUiUser");
|
||||||
const longhornUiPassword = config.requireSecret("longhornUiPassword");
|
const longhornUiPassword = config.requireSecret("longhornUiPassword");
|
||||||
|
|
||||||
const k8sProvider = new k8s.Provider("k3s", { kubeconfig });
|
// 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"] },
|
||||||
|
);
|
||||||
const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({
|
const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({
|
||||||
provider: k8sProvider,
|
provider: k8sProvider,
|
||||||
...extras,
|
...extras,
|
||||||
|
|||||||
@@ -10,7 +10,13 @@ const bootstrapRef = new pulumi.StackReference(
|
|||||||
const kubeconfig = bootstrapRef.requireOutput("kubeconfig");
|
const kubeconfig = bootstrapRef.requireOutput("kubeconfig");
|
||||||
export const domain = config.requireSecret("domain");
|
export const domain = config.requireSecret("domain");
|
||||||
|
|
||||||
const k8sProvider = new k8s.Provider("k3s", { 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 => ({
|
const opts = (extras?: pulumi.ResourceOptions): pulumi.ResourceOptions => ({
|
||||||
provider: k8sProvider,
|
provider: k8sProvider,
|
||||||
...extras,
|
...extras,
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ const grafanaDbPassword = config.requireSecret("grafanaDbPassword");
|
|||||||
const grafanaDbHost = config.requireSecret("grafanaDbHost");
|
const grafanaDbHost = config.requireSecret("grafanaDbHost");
|
||||||
const grafanaDbName = config.require("grafanaDbName");
|
const grafanaDbName = config.require("grafanaDbName");
|
||||||
|
|
||||||
const k8sProvider = new k8s.Provider("k3s", { kubeconfig });
|
// 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"] },
|
||||||
|
);
|
||||||
|
|
||||||
const monitoringNs = new k8s.core.v1.Namespace(
|
const monitoringNs = new k8s.core.v1.Namespace(
|
||||||
"monitoring",
|
"monitoring",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ proxmox-infra → k8s-bootstrap → k8s-infra
|
|||||||
- **Secrets**: read via `config.requireSecret()`, never via environment variables or hardcoded values.
|
- **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`**: 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.
|
||||||
- **Environment**: `PULUMI_BACKEND_URL` (self-hosted Postgres backend) and `PULUMI_CONFIG_PASSPHRASE` must be set.
|
- **Environment**: `PULUMI_BACKEND_URL` (self-hosted Postgres backend) and `PULUMI_CONFIG_PASSPHRASE` must be set.
|
||||||
- **CI**: PRs run `pulumi preview`. `03`–`05` deploy on push to `main`; `01`/`02` deploy only via manual dispatch.
|
- **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.
|
||||||
|
|
||||||
## Git conventions
|
## Git conventions
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -60,4 +60,4 @@ This repo uses Gitea Actions (see root `CLAUDE.md`); Gitea's merge commit reuses
|
|||||||
- `Enhancement: Refactor k8s-bootstrap for clearer deployment order`
|
- `Enhancement: Refactor k8s-bootstrap for clearer deployment order`
|
||||||
- `Chore: Upgrade Pulumi packages across all stacks`
|
- `Chore: Upgrade Pulumi packages across all stacks`
|
||||||
|
|
||||||
Since `01`/`02` deploys are manual (`workflow_dispatch`) and `03`–`05` deploy on merge to `main`, a clear PR title also doubles as a quick changelog of what just went live.
|
Since `02` deploys are manual (`workflow_dispatch`) and `01` and `03`–`05` deploy on merge to `main`, a clear PR title also doubles as a quick changelog of what just went live.
|
||||||
@@ -120,10 +120,11 @@ One workflow per stack, `.gitea/workflows/0N-deploy-<stack>.yaml`, scoped to cha
|
|||||||
| Trigger | Stacks | Action |
|
| Trigger | Stacks | Action |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| PR → `main` | all | `pulumi preview` (read-only) |
|
| PR → `main` | all | `pulumi preview` (read-only) |
|
||||||
|
| Push to `main` | 01 | `pulumi up` (no refresh) |
|
||||||
| Push to `main` | 03–05 | `pulumi refresh` + `pulumi up` |
|
| Push to `main` | 03–05 | `pulumi refresh` + `pulumi up` |
|
||||||
| Manual dispatch | all | `pulumi refresh` + `pulumi up` |
|
| Manual dispatch | all | `pulumi refresh` + `pulumi up` |
|
||||||
|
|
||||||
Stacks 01/02 (VM provisioning, cluster bootstrap) deploy **only** via manual dispatch — they're riskier to automate.
|
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.
|
||||||
|
|
||||||
### Required secrets
|
### Required secrets
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user