Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7548402542 | ||
|
|
9e0ce35712 | ||
|
|
c1e409780d | ||
|
|
5a2d32ea84 | ||
|
|
e3fab0e151 | ||
|
|
a1867b18c8 | ||
|
|
71b0f3ce7d | ||
|
|
d0600b9153 | ||
|
|
7acf83e68d | ||
|
|
088cb5add1 | ||
|
|
b04ab52fd2 | ||
|
|
ff2b565677 |
No files matched your search
@@ -7,8 +7,8 @@
|
|||||||
#
|
#
|
||||||
# Scope: used for PRs only (list, open, check CI status, merge after your OK).
|
# 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.
|
# 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
|
# In .claude/settings.json, GET and POST (e.g. opening a PR) run without a
|
||||||
# DELETE (anything that changes something) always ask first.
|
# prompt. Merging a PR (POST .../merge), PATCH, PUT and DELETE always ask first.
|
||||||
#
|
#
|
||||||
# Usage: gitea.sh METHOD PATH [BODY]
|
# Usage: gitea.sh METHOD PATH [BODY]
|
||||||
# METHOD GET | POST | PATCH | PUT | DELETE
|
# METHOD GET | POST | PATCH | PUT | DELETE
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
"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 POST *)",
|
||||||
|
"Bash(git commit *)",
|
||||||
|
"Bash(git push *)",
|
||||||
"WebFetch(domain:www.pulumi.com)",
|
"WebFetch(domain:www.pulumi.com)",
|
||||||
"WebFetch(domain:github.com)",
|
"WebFetch(domain:github.com)",
|
||||||
"WebFetch(domain:raw.githubusercontent.com)",
|
"WebFetch(domain:raw.githubusercontent.com)",
|
||||||
@@ -51,9 +54,7 @@
|
|||||||
"Bash(ssh *)",
|
"Bash(ssh *)",
|
||||||
"Bash(scp *)",
|
"Bash(scp *)",
|
||||||
"Bash(curl *)",
|
"Bash(curl *)",
|
||||||
"Bash(git commit *)",
|
"Bash(.claude/scripts/gitea.sh POST */merge*)",
|
||||||
"Bash(git push *)",
|
|
||||||
"Bash(.claude/scripts/gitea.sh POST *)",
|
|
||||||
"Bash(.claude/scripts/gitea.sh PATCH *)",
|
"Bash(.claude/scripts/gitea.sh PATCH *)",
|
||||||
"Bash(.claude/scripts/gitea.sh PUT *)",
|
"Bash(.claude/scripts/gitea.sh PUT *)",
|
||||||
"Bash(.claude/scripts/gitea.sh DELETE *)"
|
"Bash(.claude/scripts/gitea.sh DELETE *)"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const worker3Ip = config.requireSecret("worker3Ip");
|
|||||||
|
|
||||||
const templateSettings = {
|
const templateSettings = {
|
||||||
template: true,
|
template: true,
|
||||||
|
protection: true,
|
||||||
started: false,
|
started: false,
|
||||||
stopOnDestroy: true,
|
stopOnDestroy: true,
|
||||||
scsiHardware: "virtio-scsi-pci",
|
scsiHardware: "virtio-scsi-pci",
|
||||||
@@ -292,7 +293,15 @@ const k3sVms = nodeConfigs.map(
|
|||||||
{
|
{
|
||||||
provider: node.host.provider,
|
provider: node.host.provider,
|
||||||
retainOnDelete: true,
|
retainOnDelete: true,
|
||||||
ignoreChanges: ["clone", "started"],
|
protect: true,
|
||||||
|
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();
|
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(
|
const infraRef = new pulumi.StackReference(
|
||||||
`${pulumi.getOrganization()}/proxmox-infra/dev`,
|
`${pulumi.getOrganization()}/proxmox-infra/dev`,
|
||||||
);
|
);
|
||||||
@@ -77,7 +91,7 @@ const startMaster1 = new command.local.Command("start-master-1", {
|
|||||||
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=${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],
|
triggers: [master2VmId],
|
||||||
interpreter: ["/bin/bash", "-c"],
|
interpreter: ["/bin/bash", "-c"],
|
||||||
});
|
});
|
||||||
|
|||||||
+47
-1
@@ -138,15 +138,61 @@ const longhorn = new k8s.helm.v3.Release(
|
|||||||
version: "1.12.0",
|
version: "1.12.0",
|
||||||
values: {
|
values: {
|
||||||
defaultSettings: {
|
defaultSettings: {
|
||||||
defaultReplicaCount: 2,
|
defaultReplicaCount: 3,
|
||||||
nodeDownPodDeletionPolicy: "delete-both-statefulset-and-deployment-pod",
|
nodeDownPodDeletionPolicy: "delete-both-statefulset-and-deployment-pod",
|
||||||
createDefaultDiskLabeledNodes: true,
|
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(),
|
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.
|
// Patches Longhorn instances to use the mountend Longhorn storage on the worker nodes.
|
||||||
["k3s-worker-1", "k3s-worker-2", "k3s-worker-3"].forEach(
|
["k3s-worker-1", "k3s-worker-2", "k3s-worker-3"].forEach(
|
||||||
(nodeName) =>
|
(nodeName) =>
|
||||||
|
|||||||
Reference in new issue
Block a user