fix: longhorn | update to 1.10.0 and use longhorn-system namespace

This commit is contained in:
2025-11-15 13:20:51 +05:00
parent 6c419454d8
commit d1aae53fa6

View File

@@ -11,7 +11,6 @@ type LonghornOptions = {
helm: HelmProvider;
};
name: string;
namespace: string;
};
export class Longhorn extends Construct {
@@ -19,15 +18,15 @@ export class Longhorn extends Construct {
super(scope, id);
const { helm, kubernetes } = options.providers;
const namespace = "longhorn-system";
new Release(this, id, {
name: options.name,
namespace: options.namespace,
namespace,
provider: helm,
repository: "https://charts.longhorn.io",
chart: "longhorn",
createNamespace: true,
upgradeInstall: true,
values: [
fs.readFileSync("helm/values/longhorn.values.yaml", {
encoding: "utf8",
@@ -38,44 +37,19 @@ export class Longhorn extends Construct {
new Manifest(this, "recurring-backup-job", {
provider: kubernetes,
manifest: {
apiVersion: "longhorn.io/v1beta1",
apiVersion: "longhorn.io/v1beta2",
kind: "RecurringJob",
metadata: {
name: "daily-backup",
namespace: options.namespace,
namespace,
},
spec: {
cron: "0 0 * * *",
task: "backup",
retain: 30,
groups: ["default"],
retain: 7,
concurrency: 3,
},
},
});
new Manifest(this, "longhorn-crypto-storage-class", {
provider: kubernetes,
manifest: {
kind: "StorageClass",
apiVersion: "storage.k8s.io/v1",
metadata: {
name: "longhorn-crypto",
},
provisioner: "driver.longhorn.io",
allowVolumeExpansion: true,
parameters: {
numberOfReplicas: "3",
staleReplicaTimeout: "2880", // 48 hours in minutes
encrypted: "true",
"csi.storage.k8s.io/provisioner-secret-name": "longhorn-encryption",
"csi.storage.k8s.io/provisioner-secret-namespace": options.namespace,
"csi.storage.k8s.io/node-publish-secret-name": "longhorn-encryption",
"csi.storage.k8s.io/node-publish-secret-namespace": options.namespace,
"csi.storage.k8s.io/node-stage-secret-name": "longhorn-encryption",
"csi.storage.k8s.io/node-stage-secret-namespace": options.namespace,
},
},
});
}
}