Skip to content

Commit

Permalink
fix(volsync): finalize nfs
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Oct 22, 2024
1 parent a7dd9d8 commit 38cf6d9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 60 deletions.
27 changes: 1 addition & 26 deletions .taskfiles/volsync/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tasks:
CLUSTER: Cluster to run command against (default: main)
STATE: resume or suspend (required)
cmds:
- until kubectl wait jobs --all --all-namespaces --for=condition=complete --timeout=5m &>/dev/null; do sleep 5; done
# - until kubectl wait jobs --all --all-namespaces --for=condition=complete --timeout=5m &>/dev/null; do sleep 5; done
- flux {{.STATE}} kustomization volsync
- flux --namespace {{.NS}} {{.STATE}} helmrelease volsync
- kubectl --namespace {{.NS}} scale deployment --all --replicas {{if eq .STATE "suspend"}}0{{else}}1{{end}}
Expand All @@ -29,31 +29,6 @@ tasks:
requires:
vars: [CLUSTER]

list:
desc: List snapshots for an application
summary: |-
CLUSTER: Cluster to run command against (default: main)
NS: Namespace the application is in (default: default)
APP: Application to list snapshots for (required)
cmds:
- minijinja-cli --env --trim-blocks --lstrip-blocks --autoescape=none {{.VOLSYNC_RESOURCES_DIR}}/list.yaml.j2 | kubectl apply --server-side --filename -
- until kubectl --namespace {{.NS}} get job/{{.JOB}} &>/dev/null; do sleep 5; done
- kubectl --namespace {{.NS}} wait job/{{.JOB}} --for=condition=complete --timeout=5m
- kubectl --namespace {{.NS}} logs job/{{.JOB}} --container main
- kubectl --namespace {{.NS}} delete job/{{.JOB}}
vars:
NS: '{{.NS | default "default"}}'
JOB: volsync-list-{{.APP}}
env:
NS: '{{.NS}}'
JOB: '{{.JOB}}'
APP: '{{.APP}}'
requires:
vars: [CLUSTER, APP]
preconditions:
- test -f {{.VOLSYNC_RESOURCES_DIR}}/list.yaml.j2
silent: true

unlock:
desc: Unlock all Restic repositories
summary: |-
Expand Down
20 changes: 0 additions & 20 deletions .taskfiles/volsync/resources/list.yaml.j2

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ spec:
strategy: rollback
retries: 3
dependsOn:
- name: minio
namespace: default
- name: kyverno
namespace: kyverno
- name: snapshot-controller
namespace: volsync-system
values:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/main/apps/volsync-system/volsync/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ spec:
commonMetadata:
labels:
app.kubernetes.io/name: *app
dependsOn:
- name: kyverno-policies
path: ./kubernetes/main/apps/volsync-system/volsync/app
prune: true
sourceRef:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/main/templates/volsync/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./claim.yaml
- ./minio.yaml
- ./nfs.yaml
- ./r2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ spec:
data:
RESTIC_REPOSITORY: "/repository/${APP}"
RESTIC_PASSWORD: "{{ .RESTIC_PASSWORD }}"
# AWS_ACCESS_KEY_ID: "{{ .MINIO_ROOT_USER }}"
# AWS_SECRET_ACCESS_KEY: "{{ .MINIO_ROOT_PASSWORD }}"
dataFrom:
- extract:
key: minio
- extract:
key: volsync-minio-template
key: volsync-template
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/volsync.backube/replicationsource_v1alpha1.json
apiVersion: volsync.backube/v1alpha1
Expand All @@ -48,8 +44,7 @@ spec:
fsGroup: ${VOLSYNC_PGID:-568}
retain:
hourly: 24
daily: 7
weekly: 5
daily: 14
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/volsync.backube/replicationdestination_v1alpha1.json
apiVersion: volsync.backube/v1alpha1
Expand All @@ -69,10 +64,10 @@ spec:
storageClassName: "${VOLSYNC_STORAGECLASS:-ceph-block}"
accessModes: ["${VOLSYNC_ACCESSMODES:-ReadWriteOnce}"]
capacity: "${VOLSYNC_CAPACITY}"
moverSecurityContext:
runAsUser: ${VOLSYNC_PUID:-568}
runAsGroup: ${VOLSYNC_PGID:-568}
fsGroup: ${VOLSYNC_PGID:-568}
enableFileDeletion: true
cleanupCachePVC: true
cleanupTempPVC: true
# moverSecurityContext: # Not needed due to privileged movers
# runAsUser: ${VOLSYNC_PUID:-568}
# runAsGroup: ${VOLSYNC_PGID:-568}
# fsGroup: ${VOLSYNC_PGID:-568}

0 comments on commit 38cf6d9

Please sign in to comment.