Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix storage class creation when bootstrapping a cluster #39

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ The following providers are used by this module:

- [[provider_random]] <<provider_random,random>> (>= 3)

- [[provider_utils]] <<provider_utils,utils>> (>= 1)
- [[provider_null]] <<provider_null,null>>

- [[provider_argocd]] <<provider_argocd,argocd>> (>= 5)

- [[provider_null]] <<provider_null,null>>
- [[provider_utils]] <<provider_utils,utils>> (>= 1)

=== Resources

Expand Down Expand Up @@ -299,7 +299,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v3.4.0"`
Default: `"v3.7.0"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Expand Down Expand Up @@ -588,8 +588,8 @@ Description: ID to pass other modules in order to refer to this module as a depe
|===
|Name |Version
|[[provider_random]] <<provider_random,random>> |>= 3
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 5
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_null]] <<provider_null,null>> |n/a
|===

Expand Down Expand Up @@ -656,7 +656,7 @@ Description: ID to pass other modules in order to refer to this module as a depe
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.4.0"`
|`"v3.7.0"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
Expand Down
21 changes: 0 additions & 21 deletions charts/longhorn/templates/backup-storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,5 @@ parameters:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
recurringJobs: '[
{{- if $.Values.backups.config.snapshot_enabled }}
{
"name":"snapshot",
"task":"snapshot",
"cron": "{{ $.Values.backups.config.snapshot_cron }}",
"retain": {{ $.Values.backups.config.snapshot_retention }}
}
{{- end -}}
{{- if and $.Values.backups.config.backup_enabled $.Values.backups.config.snapshot_enabled -}}
,
{{ end -}}
{{- if $.Values.backups.config.backup_enabled -}}
{
"name":"backup",
"task":"backup",
"cron": "{{ $.Values.backups.config.backup_cron }}",
"retain": {{ $.Values.backups.config.backup_retention }}
}
{{- end }}
]'

{{- end }}
20 changes: 20 additions & 0 deletions charts/longhorn/templates/recurring-job-backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if $.Values.backups.enabled -}}
{{- if $.Values.backups.config.backup_enabled -}}

---
apiVersion: longhorn.io/v1beta2
kind: RecurringJob
metadata:
name: {{ $.Release.Name }}-backup
labels:
name: {{ $.Release.Name }}-backup
spec:
concurrency: 1
cron: {{ $.Values.backups.config.backup_cron | quote }}
labels: {}
name: backup
retain: {{ $.Values.backups.config.backup_retention }}
task: backup

{{- end -}}
{{- end -}}
20 changes: 20 additions & 0 deletions charts/longhorn/templates/recurring-job-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if $.Values.backups.enabled -}}
{{- if $.Values.backups.config.snapshot_enabled -}}

---
apiVersion: longhorn.io/v1beta2
kind: RecurringJob
metadata:
name: {{ $.Release.Name }}-snapshot
labels:
name: {{ $.Release.Name }}-snapshot
spec:
concurrency: 1
cron: {{ $.Values.backups.config.snapshot_cron | quote }}
labels: {}
name: backup
retain: {{ $.Values.backups.config.snapshot_retention }}
task: backup

{{- end -}}
{{- end -}}
1 change: 0 additions & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ locals {
defaultSettings = {
backupTarget = var.enable_pv_backups ? format("s3://%s@%s/", var.backup_storage.bucket_name, var.backup_storage.region) : ""
backupTargetCredentialSecret = var.enable_pv_backups ? "longhorn-s3-secret" : ""
defaultLonghornStaticStorageClass = var.enable_pv_backups && var.set_default_storage_class ? "longhorn-backup" : "longhorn-static"
storageOverProvisioningPercentage = var.storage_over_provisioning_percentage
storageMinimalAvailablePercentage = var.storage_minimal_available_percentage
taintToleration = join(";", local.tolerations_list)
Expand Down