Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3fab0e151 | ||
|
|
a1867b18c8 | ||
|
|
71b0f3ce7d | ||
|
|
d0600b9153 | ||
|
|
7acf83e68d | ||
|
|
088cb5add1 | ||
|
|
b04ab52fd2 | ||
|
|
ff2b565677 | ||
|
|
4b22f4ad11 |
No files matched your search
@@ -7,8 +7,8 @@
|
||||
#
|
||||
# Scope: used for PRs only (list, open, check CI status, merge after your OK).
|
||||
# Technically it can call any endpoint; CLAUDE.md limits its use to PRs.
|
||||
# In .claude/settings.json, GET runs without a prompt; POST, PATCH, PUT and
|
||||
# DELETE (anything that changes something) always ask first.
|
||||
# In .claude/settings.json, GET and POST (e.g. opening a PR) run without a
|
||||
# prompt. Merging a PR (POST .../merge), PATCH, PUT and DELETE always ask first.
|
||||
#
|
||||
# Usage: gitea.sh METHOD PATH [BODY]
|
||||
# METHOD GET | POST | PATCH | PUT | DELETE
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
"Bash(git add *)",
|
||||
"Bash(git switch *)",
|
||||
"Bash(.claude/scripts/gitea.sh GET *)",
|
||||
"Bash(.claude/scripts/gitea.sh POST *)",
|
||||
"Bash(git commit *)",
|
||||
"Bash(git push *)",
|
||||
"WebFetch(domain:www.pulumi.com)",
|
||||
"WebFetch(domain:github.com)",
|
||||
"WebFetch(domain:raw.githubusercontent.com)",
|
||||
@@ -51,9 +54,7 @@
|
||||
"Bash(ssh *)",
|
||||
"Bash(scp *)",
|
||||
"Bash(curl *)",
|
||||
"Bash(git commit *)",
|
||||
"Bash(git push *)",
|
||||
"Bash(.claude/scripts/gitea.sh POST *)",
|
||||
"Bash(.claude/scripts/gitea.sh POST */merge*)",
|
||||
"Bash(.claude/scripts/gitea.sh PATCH *)",
|
||||
"Bash(.claude/scripts/gitea.sh PUT *)",
|
||||
"Bash(.claude/scripts/gitea.sh DELETE *)"
|
||||
|
||||
@@ -292,7 +292,14 @@ const k3sVms = nodeConfigs.map(
|
||||
{
|
||||
provider: node.host.provider,
|
||||
retainOnDelete: true,
|
||||
ignoreChanges: ["clone", "started"],
|
||||
ignoreChanges: [
|
||||
"clone",
|
||||
"started",
|
||||
// Pulumi bridge bug: unset disk speed always shows a diff.
|
||||
// https://github.com/muhlba91/pulumi-proxmoxve/issues/664
|
||||
"disks[0].speed",
|
||||
...(node.longhornDiskSize == null ? [] : ["disks[1].speed"]),
|
||||
],
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3,6 +3,20 @@ import * as command from "@pulumi/command";
|
||||
|
||||
const config = new pulumi.Config();
|
||||
|
||||
// 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
|
||||
// recreating a VM, re-run its commands explicitly with --target-replace.
|
||||
pulumi.runtime.registerResourceTransform((args) =>
|
||||
args.type.startsWith("command:")
|
||||
? {
|
||||
props: args.props,
|
||||
opts: pulumi.mergeOptions(args.opts, {
|
||||
ignoreChanges: ["create", "triggers"],
|
||||
}),
|
||||
}
|
||||
: undefined,
|
||||
);
|
||||
|
||||
const infraRef = new pulumi.StackReference(
|
||||
`${pulumi.getOrganization()}/proxmox-infra/dev`,
|
||||
);
|
||||
@@ -77,7 +91,7 @@ const startMaster1 = new command.local.Command("start-master-1", {
|
||||
interpreter: ["/bin/bash", "-c"],
|
||||
});
|
||||
const startMaster2 = new command.local.Command("start-master-2", {
|
||||
create: pulumi.interpolate`curl -sf -k -X POST -H "Authorization: PVEAPIToken=${pve1ApiToken}" "${pve1Endpoint}/api2/json/nodes/pve/qemu/${master2VmId}/status/start" 2>/dev/null || true`,
|
||||
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`,
|
||||
triggers: [master2VmId],
|
||||
interpreter: ["/bin/bash", "-c"],
|
||||
});
|
||||
|
||||
+47
-1
@@ -138,15 +138,61 @@ const longhorn = new k8s.helm.v3.Release(
|
||||
version: "1.12.0",
|
||||
values: {
|
||||
defaultSettings: {
|
||||
defaultReplicaCount: 2,
|
||||
defaultReplicaCount: 3,
|
||||
nodeDownPodDeletionPolicy: "delete-both-statefulset-and-deployment-pod",
|
||||
createDefaultDiskLabeledNodes: true,
|
||||
orphanResourceAutoDeletion: "replica-data;instance",
|
||||
// Longhorn's recommendation for dedicated disks (longhorn-extra).
|
||||
// Docs: https://longhorn.io/docs/1.12.0/best-practices/
|
||||
storageMinimalAvailablePercentage: 10,
|
||||
},
|
||||
},
|
||||
},
|
||||
opts(),
|
||||
);
|
||||
|
||||
// Purges system snapshots, which can otherwise grow to a full volume's size
|
||||
// on every replica. Docs:
|
||||
// https://longhorn.io/docs/1.12.0/snapshots-and-backups/scheduling-backups-and-snapshots/
|
||||
new k8s.apiextensions.CustomResource(
|
||||
"longhorn-snapshot-cleanup",
|
||||
{
|
||||
apiVersion: "longhorn.io/v1beta2",
|
||||
kind: "RecurringJob",
|
||||
metadata: { name: "snapshot-cleanup", namespace: "longhorn-system" },
|
||||
spec: {
|
||||
name: "snapshot-cleanup",
|
||||
task: "snapshot-cleanup",
|
||||
cron: "30 3 * * *",
|
||||
groups: ["default"],
|
||||
retain: 0,
|
||||
concurrency: 1,
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [longhorn] }),
|
||||
);
|
||||
|
||||
// Returns blocks deleted inside a volume (e.g. expired Prometheus data) to the
|
||||
// disk. Runs after snapshot-cleanup, since trim can't reclaim valid snapshots.
|
||||
// Docs: https://longhorn.io/docs/1.12.0/nodes-and-volumes/volumes/trim-filesystem/
|
||||
new k8s.apiextensions.CustomResource(
|
||||
"longhorn-filesystem-trim",
|
||||
{
|
||||
apiVersion: "longhorn.io/v1beta2",
|
||||
kind: "RecurringJob",
|
||||
metadata: { name: "filesystem-trim", namespace: "longhorn-system" },
|
||||
spec: {
|
||||
name: "filesystem-trim",
|
||||
task: "filesystem-trim",
|
||||
cron: "30 4 * * *",
|
||||
groups: ["default"],
|
||||
retain: 0,
|
||||
concurrency: 1,
|
||||
},
|
||||
},
|
||||
opts({ dependsOn: [longhorn] }),
|
||||
);
|
||||
|
||||
// Patches Longhorn instances to use the mountend Longhorn storage on the worker nodes.
|
||||
["k3s-worker-1", "k3s-worker-2", "k3s-worker-3"].forEach(
|
||||
(nodeName) =>
|
||||
|
||||
Reference in new issue
Block a user