diff --git a/docs/infrastructure-ovn-setup.md b/docs/infrastructure-ovn-setup.md index ccb818a6..6ccd82f7 100644 --- a/docs/infrastructure-ovn-setup.md +++ b/docs/infrastructure-ovn-setup.md @@ -123,8 +123,19 @@ If there's ever a need to reconfigure a node, simply remove the label and the Da !!! note - To upload backups to a Ceph Swift API gateway, edit ovn-backup.config to set + To upload backups to Swift, edit /opt/genestack/kustomize/ovn/ovn-backup/ovn-backup.config to set `SWIFT_UPLOAD' "true"`, edit the other related options appropriately (i.e., - set the SWIFT_BASE_URL and CONTAINER) and put the username and secret key of - the account to use in `swift-account.env` before running `kubectl apply` an - indicated above. + set the KEYSTONE_URL and CONTAINER) and fill the username, password or API, + domain name, project ID, and domain ID of an user to use for backup (to get + a scoped token suitable for uploading to Swift) in `swift-account.env` and + then run: + + kubectl apply -k /opt/genestack/kustomize/ovn/ovn-backup \ + --prune -l app=ovn-backup \ + --prune-allowlist=core/v1/Secret \ + --prune-allowlist=core/v1/ConfigMap + + If you need to change variables in the future, you can edit the relevant + files and use `kubectl` with these prune options to avoid accumulating + old ConfigMaps and Secrets from successive `kubectl apply` operations, but + you can omit the pruning options if desired. diff --git a/kustomize/ovn/kustomization.yaml b/kustomize/ovn/kustomization.yaml index 123dd5fb..84a68f18 100644 --- a/kustomize/ovn/kustomization.yaml +++ b/kustomize/ovn/kustomization.yaml @@ -1,18 +1,2 @@ -secretGenerator: - - name: ovn-backup-swift-account - namespace: kube-system - envs: - - swift-account.env -configMapGenerator: - - name: ovn-backup-script - namespace: kube-system - files: - - ovn-backup.sh - - get-swift-url.pl - - name: ovn-backup-config - namespace: kube-system - envs: - - ovn-backup.config resources: - ovn-setup.yaml - - ovn-backup.yaml diff --git a/kustomize/ovn/get-swift-url.pl b/kustomize/ovn/ovn-backup/get-swift-url.pl similarity index 100% rename from kustomize/ovn/get-swift-url.pl rename to kustomize/ovn/ovn-backup/get-swift-url.pl diff --git a/kustomize/ovn/ovn-backup/kustomization.yaml b/kustomize/ovn/ovn-backup/kustomization.yaml new file mode 100644 index 00000000..f5a8209a --- /dev/null +++ b/kustomize/ovn/ovn-backup/kustomization.yaml @@ -0,0 +1,19 @@ +commonLabels: + app: ovn-backup +secretGenerator: + - name: ovn-backup-swift-account + namespace: kube-system + envs: + - swift-account.env +configMapGenerator: + - name: ovn-backup-script + namespace: kube-system + files: + - ovn-backup.sh + - get-swift-url.pl + - name: ovn-backup-config + namespace: kube-system + envs: + - ovn-backup.config +resources: + - ovn-backup.yaml diff --git a/kustomize/ovn/ovn-backup.config b/kustomize/ovn/ovn-backup/ovn-backup.config similarity index 100% rename from kustomize/ovn/ovn-backup.config rename to kustomize/ovn/ovn-backup/ovn-backup.config diff --git a/kustomize/ovn/ovn-backup.sh b/kustomize/ovn/ovn-backup/ovn-backup.sh similarity index 100% rename from kustomize/ovn/ovn-backup.sh rename to kustomize/ovn/ovn-backup/ovn-backup.sh diff --git a/kustomize/ovn/ovn-backup.yaml b/kustomize/ovn/ovn-backup/ovn-backup.yaml similarity index 100% rename from kustomize/ovn/ovn-backup.yaml rename to kustomize/ovn/ovn-backup/ovn-backup.yaml diff --git a/kustomize/ovn/swift-account.env b/kustomize/ovn/ovn-backup/swift-account.env similarity index 100% rename from kustomize/ovn/swift-account.env rename to kustomize/ovn/ovn-backup/swift-account.env