From 01c1c798225026a5e86b017b4aa26d28ce6f0025 Mon Sep 17 00:00:00 2001 From: eunames Date: Thu, 6 Jun 2024 20:30:04 +0300 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 1e7871c51b1a4e1647033fd54847fbecd495f525 Merge: d996d16c 0f1228ff Author: Bigli <9610820+TheBigLee@users.noreply.github.com> Date: Tue May 28 13:17:19 2024 +0200 Merge pull request #974 from k8up-io/gh/pr_template_co_sign Adjust the PR template to include signing off the commits commit 0f1228ff433198a986fb7c057076368d15afefa6 Author: Nicolas Bigler Date: Tue May 28 12:44:20 2024 +0200 Adjust the PR template to include signing off the commits Signed-off-by: Nicolas Bigler commit d996d16c9a7df986de02b248c38b88d8262f56ff Merge: 0b29883c c0efc71b Author: Bigli <9610820+TheBigLee@users.noreply.github.com> Date: Tue May 28 12:41:08 2024 +0200 Merge pull request #967 from SchoolGuy/add-grafana-dashboard feat: Helm - Grafana Dashboard commit c0efc71bfa4750efcbb8596418e496c25527a3a8 Author: Enno Gotthold Date: Thu May 9 12:35:41 2024 +0200 [ADD] Helm - Grafana Dashboard Signed-off-by: Enno Gotthold Signed-off-by: Nicolas Bigler commit 0b29883c44cfdbc6db988fae2166359cbd24121a Merge: 60e75b67 f6648dd2 Author: Bigli <9610820+TheBigLee@users.noreply.github.com> Date: Tue May 28 10:18:14 2024 +0200 Merge pull request #971 from k8up-io/tutorial/update_crd_version Update the tutorial to the latest k8up version commit f6648dd2b089550d0244dc90078d1eefa9d75032 Author: Nicolas Bigler Date: Mon May 27 15:31:27 2024 +0200 Update the tutorial to the latest k8up version Signed-off-by: Nicolas Bigler commit 60e75b67259090ec5e32de38b7c6e166b5769018 Merge: 212a0338 162e16bf Author: Kidswiss Date: Wed May 15 10:20:29 2024 +0200 Merge pull request #969 from k8up-io/bump_chart Bump K8up version commit 162e16bf43e963db5fad7a320945d0eb030eefb4 Author: Simon Beck Date: Wed May 15 09:45:16 2024 +0200 Bump K8up version Signed-off-by: Simon Beck commit 212a03389a3298ee003faa94acf04c8a0fccaa78 Merge: 2ddb6eef c8e92022 Author: Kidswiss Date: Wed May 15 09:36:03 2024 +0200 Merge pull request #968 from k8up-io/add/pod_spec Add full podSpec to all job types commit c8e920222d5d8ac20edbd3c40617893bdea9e8f4 Author: Simon Beck Date: Wed May 15 09:04:58 2024 +0200 Remove unnecessary RBAC Signed-off-by: Simon Beck commit d21f0194314780980212c888ec7c2b23ccb27d3a Author: Simon Beck Date: Tue May 14 16:01:26 2024 +0200 Correctly flag test for integration Signed-off-by: Simon Beck commit edea9f6a9f8fe1db9a4f4537a61258096179bc62 Author: Simon Beck Date: Tue May 14 15:29:02 2024 +0200 Add make test to actions Signed-off-by: Simon Beck commit 21494cabcbb74a1ca5348e2a4b5ab88a800a94d1 Author: Simon Beck Date: Mon May 13 13:26:56 2024 +0200 Add docs Signed-off-by: Simon Beck commit 2666a12679d72a2167151bdadbd9cf3e4f279451 Author: Simon Beck Date: Mon May 13 12:50:07 2024 +0200 Fix using the index to delay execution It did not actually do a staggered delay for each instance. Signed-off-by: Simon Beck commit dd9f657ffc41540983e8a6cf7a14a5817a4a618d Author: Simon Beck Date: Mon May 13 12:49:52 2024 +0200 Add full podSpec to all job types With this commit it's now possible to specify a full podSpec for each job type available. Signed-off-by: Simon Beck commit 2ddb6eef16737c835689b00c3515a4ef56f3e877 Merge: 5ab0be41 15f78ac8 Author: Kidswiss Date: Tue Apr 30 15:34:54 2024 +0200 Merge pull request #963 from k8up-io/bump-chart Bump versions in the chart commit 15f78ac892aa3263bbc7d0aa6ae775eed1d32325 Author: Simon Beck Date: Tue Apr 30 15:10:27 2024 +0200 Bump versions in the chart Signed-off-by: Simon Beck commit 5ab0be413be59eb02b5d18ebfdce4971d3d0f0a4 Merge: 5d67b163 51b7fd7c Author: Kidswiss Date: Tue Apr 30 14:47:07 2024 +0200 Merge pull request #962 from amghazanfari/master bug: Add operator as mandatory argument commit 51b7fd7c6b58a8f60414df0658592820782d0988 Author: Amir M. Ghazanfari Date: Sun Apr 28 12:37:15 2024 +0330 Add operator as mandatory argument Signed-off-by: amghazanfari Signed-off-by: Amir Ghazanfari commit 5d67b163177719cf4e8a3d3f02b15e6b826e4457 Merge: 2971c49d ccd6bcef Author: Kidswiss Date: Fri Apr 12 11:12:03 2024 +0200 Merge pull request #954 from M0NsTeRRR/master [enhancement] add support for dual stack clusters commit 2971c49d4ec59dfcd6b5f1a881c274ce5f934707 Merge: 10881189 80b2dddf Author: Kidswiss Date: Fri Apr 12 10:22:25 2024 +0200 Merge pull request #949 from poyaz/feature/custom-tls [enhancement] Adding new feature for supporting self-signed certificate commit 80b2dddf80364c914a3535d54de92a0c96aa95db Author: poyaz Date: Thu Apr 11 17:33:31 2024 +0330 [ADD] Add integration test for TLS and Mutual TLS options Signed-off-by: poyaz commit ad78959708e69bc555c15b8ed6d37b97869c7790 Author: poyaz Date: Thu Apr 11 17:32:40 2024 +0330 [FIX] Fix execute ps for alpine and BusyBox Signed-off-by: poyaz commit 1fc3b16762c5f9e9c855ff2b1c64d61bfd869f71 Author: poyaz Date: Thu Apr 11 17:32:05 2024 +0330 [UPDATE] Rename argument "--varDir" to "-varDir" Signed-off-by: poyaz commit df889cb4622fe51c5bfb739b5fc2610b8d68425b Author: poyaz Date: Thu Apr 11 17:14:02 2024 +0330 [UPDATE] Add unit test for utils file and refactoring ZeroLen function Signed-off-by: poyaz commit 22de53ecd5e5bcd2b01df2edbcf7ece8896f69d7 Author: poyaz Date: Thu Apr 11 00:56:30 2024 +0330 [DELETE] Delete e2e test self signed tls becuase it has too many test case and spend too much time Move restore and archive test case to two separated files Signed-off-by: poyaz commit 7d121ffcbcc880cf10d716ea56d60897e2f6a02b Author: poyaz Date: Thu Apr 11 00:53:42 2024 +0330 [ADD] Add two e2e test for restore and archive Signed-off-by: poyaz commit dc9f803e27a75c9878843d68ec028923ece92ef9 Author: poyaz Date: Thu Apr 11 00:52:56 2024 +0330 [ADD] Add cmctl command for check cert-manager is ready Signed-off-by: poyaz commit 0acef98cd79373ef5c3aafb7d392066d05eefda8 Author: poyaz Date: Thu Apr 11 00:32:34 2024 +0330 [UPDATE] Refactoring code for duplciate fucntions in operators These functions is created in utils: - AppendTLSOptionsArgs: for generate env for backend and restore specs - AttachTLSVolumes: for create volumes for pods AttachTLSVolumeMounts: for create volumeMount for backend and restore specs Signed-off-by: poyaz commit b59589a30428a9b1f7958dbc61bb962c23f59cac Author: poyaz Date: Thu Apr 11 00:30:11 2024 +0330 [UPDATE] Update documents because of changing options to tlsOptions Signed-off-by: poyaz commit 01cb120af2ed261eba84e547e6409e2cb92a0c4c Author: Pooya Azarpour Date: Mon Apr 8 14:21:24 2024 +0330 [CHANGE] Rename options to tlsOptions Signed-off-by: Pooya Azarpour commit 9b4216ae321640379d7935922c80cbe5653f3d04 Author: Pooya Azarpour Date: Mon Apr 8 11:01:50 2024 +0330 [DELETE] Delete unnecessary error param in setupArgs function Signed-off-by: Pooya Azarpour commit ccd6bcef75a047136dfd9d78e4866305dcdc186f Author: Ludovic Ortega Date: Sat Apr 6 17:59:17 2024 +0200 feat: add support for dual stack clusters Signed-off-by: Ludovic Ortega commit d1319f04bdc84bdbae5345aec69c7e7519ae3e26 Author: Pooya Azarpour Date: Sat Apr 6 13:43:25 2024 +0330 [FIX] Fix typo and document's grammers Signed-off-by: Pooya Azarpour commit 8713c813f673929e959760c342e9be0aba3dfff9 Author: Pooya Azarpour Date: Sat Apr 6 13:40:33 2024 +0330 [UPDATE] Formatting go files to old style (Remove idea customziation formatter) Signed-off-by: Pooya Azarpour commit f6b0f1259cac555c07b48e3d646eae27eddadeca Author: Pooya Azarpour Date: Sat Apr 6 11:20:33 2024 +0330 [DELETE] Delete command "sleep 3" Signed-off-by: Pooya Azarpour commit 1088118931d95579d76d4b0b668214f21d63d01d Merge: b16b4bff 29cdb0a0 Author: Tobias Brunner Date: Thu Apr 4 08:36:45 2024 +0200 Merge pull request #952 from halil-bugol/patch-1 Add Kubezy as adopter commit 29cdb0a00aea7970a656e999e85dc8b33d7f00f3 Author: Halil İbrahim BUGÖL <60687576+halil-bugol@users.noreply.github.com> Date: Thu Apr 4 00:53:48 2024 +0300 Update ADOPTERS.md Signed-off-by: Halil Bugol Signed-off-by: Halil İbrahim BUGÖL commit 9f776fe3570f2af634d960fbbe8d7c46c08f4930 Author: poyaz Date: Sat Mar 23 17:05:19 2024 +0330 [FIX] Fix test for expected args Signed-off-by: poyaz commit 295e5bf5d0cdc7c8fb43a9e383ea0f1b3a4339c6 Author: poyaz Date: Sat Mar 23 16:55:12 2024 +0330 [ADD] Adding variable GO_EXEC in Makefile to choose different versions of Golang Signed-off-by: poyaz commit c668b2585cc9da21b1faa4df81ddac74a9914858 Author: poyaz Date: Sat Mar 23 16:53:54 2024 +0330 [FIX] Fixing integration test for restic s3. Missing CaCert arguments Signed-off-by: poyaz commit da60a0b0bde4d44f1bd94cb92698749e01440c1a Author: poyaz Date: Sat Mar 23 15:03:13 2024 +0330 ADD] Adding e2e test over using env for TLS and mTls Also fixing bug in get lentgh of archive object in minio-mc Signed-off-by: poyaz commit 41825f9f4e88d2042e84cff46ea1a21a2e78ca4d Author: poyaz Date: Sat Mar 23 15:03:06 2024 +0330 [ADD] Adding e2e definitaions for using env for TLS and mTls Signed-off-by: poyaz commit bd2c880bf3d573aec5085a26b8aaaf383440d38c Author: poyaz Date: Sat Mar 23 15:01:04 2024 +0330 [UPDATE] Update cert-manager to v1.14.4 Signed-off-by: poyaz commit 6b659b8cb4e257c0be41620ea259ae6cc01a3fcb Author: poyaz Date: Sat Mar 23 13:14:10 2024 +0330 [UPDATE] Update api-refrence according to supporting volume, volumeMount, and options Signed-off-by: poyaz commit b2b83e1a85cb4b5ef186d837d7d6ee7d25a4e94a Author: poyaz Date: Sat Mar 23 13:12:30 2024 +0330 [ADD] Adding document about how to use TLS and mTls in api refrence Signed-off-by: poyaz commit fe51211404d855339fafa37e528d391638c0765b Author: poyaz Date: Sat Mar 23 13:12:03 2024 +0330 [FIX] Removing unnecessary snipped tag (tag: ) Signed-off-by: poyaz commit 800b8190ac5aaba780d5773c230c62ce8482f1a0 Author: poyaz Date: Sat Mar 23 13:10:27 2024 +0330 [UPDATE] Update operator and restic cli help according to new values is added Signed-off-by: poyaz commit 11f0945c0805ffde4df6d3d09f9a74e8b45ea80a Author: poyaz Date: Sat Mar 23 13:09:48 2024 +0330 [ADD] Adding RESTORE_CA_CERT_FILE, RESTORE_CA_CERT_FILE, RESTORE_CLIENT_KEY_FILE env instead of filling TLS and mTls options in restore method Signed-off-by: poyaz commit a9cf8fd5d108cb4844f2bcdf86b0bc70d6caded3 Author: poyaz Date: Sat Mar 23 02:08:07 2024 +0330 [FIX] Fixning problem in attach mode when failer happend in pod Signed-off-by: poyaz commit 97e03e0c1bb51d2a81a81649139fc7f8e50312b0 Merge: 5270d547 b16b4bff Author: poyaz Date: Sat Mar 23 02:06:15 2024 +0330 Merge remote-tracking branch 'upstream/master' into feature/custom-tls Signed-off-by: poyaz commit 5270d547ff6d91fd9255ab353a28783304cede15 Author: poyaz Date: Sat Mar 23 02:05:02 2024 +0330 [ADD] Adding new e2e test for supporting self-signed issuer This test contains below sections: - Testing backup API for TLS and mTLS mode - Testing restore API in pvc for TLS and mTLS mode - Testing restore API in S3 for TLS and mTLS mode - Testing archive API in S3 for TLS and mTLS mode - Testin check API for TLS and mTLS mode Signed-off-by: poyaz commit f391110e89f81be567e33a698d25379033945317 Author: poyaz Date: Sat Mar 23 02:04:44 2024 +0330 [ADD] Add some fucntions for checking e2e test These fucntions add: - Adding "mc" function for using minio client for using download files, remove buckets, get list of files - Adding "given_a_clean_archive" function for clear archive bucket - Adding "given_a_subject_dl" function for apply deployment for checking last backup when restore in S3 - Adding "give_self_signed_issuer" function for create self-signed issuer - Adding "expect_dl_file_in_container" function for checking is last backup was uploaded in S3 is okay Also fix some bugs: - Fixing empty output when get last dump of snapshot - becuase of syncing and storing file in disk, fetching last dump is took and the output of "run restic dump latest" is empty - Adding sleep before running restic and mc Signed-off-by: poyaz commit 2af7fd68f35e1235041b7944162a3da4c612a6de Author: poyaz Date: Sat Mar 23 02:04:23 2024 +0330 [ADD] Adding new resource definitions for e2e test in TLS and mTls mode These definitions contain below: - Adding archive Adding restore Adding backup Adding nginx for use reverse proxy in TLS and mTls mode Adding cert-manager for genrate self-signed issuer Signed-off-by: poyaz commit a56d46520b27a8fbd67b7821a48cb176d59796bb Author: poyaz Date: Sat Mar 23 02:03:58 2024 +0330 [UPDATE] Generating new crd according to adding VolumeMounts to BackendSpec and RestoreMethodSpec Signed-off-by: poyaz commit ece84c7d8e75c8f4fe1418b60e4ce95e69d342c4 Author: poyaz Date: Sat Mar 23 02:03:46 2024 +0330 [UPDATE] Addin VolumeMounts to BackendSpec and RestoreMethod Change: - Removing VolumeMounts from S3Spec and RestServerSpec in BackendSpec. Adding to BackendSpec (File: v1/backend.go) - Adding VolumeMounts to RestoreMethod (File: v1/restore_types.go) Signed-off-by: poyaz commit c42e748d79268e74af71974f7ce18f4ac91a315c Author: poyaz Date: Sat Mar 23 02:02:47 2024 +0330 [UPDATE] Generating new crd according to adding VolumeMounts to BackendSpec and RestoreMethodSpec Also these changes appends: - Running linter - Fixing check null pointer error if BackendSpec or Volume of Spec is null - Fixing check add duplicate VolumeMount in archive and restore API - Refactoring setupArgs Signed-off-by: poyaz commit a0f78d7b515cf8605e565ad3c92e236592962033 Author: poyaz Date: Sat Mar 23 02:01:14 2024 +0330 [ADD] Adding container volumes when they are mounting Signed-off-by: poyaz commit e2622c63d6f0085388c165f183fc20cabde320f1 Author: Pooya Azarpour Date: Mon Mar 18 19:45:22 2024 +0330 [ADD] Supporting self certificate authority and mTls when using S3 object storage Signed-off-by: Pooya Azarpour commit e13ba45445cb9283c96e68119fbb71ef0f6c5805 Author: Pooya Azarpour Date: Mon Mar 18 19:43:39 2024 +0330 [ADD] Add vardir command option for mount emptyDir in pod Signed-off-by: Pooya Azarpour commit 8eb0703674617ebaf617178b412c6520dfdae6a6 Author: Pooya Azarpour Date: Mon Mar 18 19:41:40 2024 +0330 [ADD] Add Volume for using secret or configmap in k8s, Add VolumeMounts for mount volume, Add BackendOpts for using custom options in k8up or restic Signed-off-by: Pooya Azarpour commit 2ea688a54b6bcc8ea15b5e35dbc98ad5786873ae Author: Pooya Azarpour Date: Mon Mar 18 19:39:05 2024 +0330 [ADD] Add GO_EXEC variable for using multiply version of go binary Signed-off-by: Pooya Azarpour commit 43f750ce6caab1edb80a4d367ea9f19ac59e12dc Author: Pooya Azarpour Date: Mon Mar 18 19:37:59 2024 +0330 [ADD] Ignoring vagrant dir in git Signed-off-by: Pooya Azarpour --- .github/PULL_REQUEST_TEMPLATE.md | 2 + .github/workflows/test.yml | 3 + .gitignore | 8 + ADOPTERS.md | 1 + Makefile | 15 +- Makefile.restic-integration.vars.mk | 2 +- Makefile.vars.mk | 1 + api/v1/archive_types.go | 9 + api/v1/backend.go | 26 +- api/v1/backup_types.go | 9 + api/v1/check_types.go | 9 + api/v1/job_object.go | 4 + api/v1/podconfig_types.go | 60 + api/v1/prune_types.go | 9 + api/v1/restore_types.go | 15 +- api/v1/runnable_types.go | 29 + api/v1/schedule_types.go | 13 + api/v1/zz_generated.deepcopy.go | 188 + charts/k8up/Chart.yaml | 2 +- charts/k8up/README.md | 11 +- charts/k8up/templates/grafana-dashboard.yaml | 1206 +++ .../k8up/templates/operator-clusterrole.yaml | 8 + charts/k8up/templates/service.yaml | 6 + charts/k8up/values.yaml | 13 +- clean.sh | 7 +- cmd/operator/main.go | 2 + cmd/restic/integration_test.go | 4 +- cmd/restic/main.go | 88 +- .../v1/k8up.io_archives.yaml | 278 + .../v1/k8up.io_backups.yaml | 227 + .../v1/k8up.io_checks.yaml | 227 + .../v1/k8up.io_podconfigs.yaml | 7532 +++++++++++++++++ .../v1/k8up.io_prunes.yaml | 227 + .../v1/k8up.io_restores.yaml | 278 + .../v1/k8up.io_schedules.yaml | 1311 +++ config/rbac/role.yaml | 8 + deployment.yaml | 28 + docs/modules/ROOT/examples/usage/operator.txt | 3 +- docs/modules/ROOT/examples/usage/restic.txt | 7 + .../how-tos/application-aware-backups.adoc | 8 - docs/modules/ROOT/pages/how-tos/archive.adoc | 670 ++ docs/modules/ROOT/pages/how-tos/backup.adoc | 207 + docs/modules/ROOT/pages/how-tos/restore.adoc | 685 ++ .../modules/ROOT/pages/how-tos/schedules.adoc | 41 + .../ROOT/pages/references/api-reference.adoc | 476 +- .../ROOT/pages/tutorials/tutorial.adoc | 9 +- e2e/Makefile | 4 + .../annotated-subject/deployment.yaml | 1 + e2e/definitions/annotated-subject/pod.yaml | 1 + e2e/definitions/archive/config-mtls-env.yaml | 12 + .../archive/s3-mtls-archive-mtls-env.yaml | 45 + .../archive/s3-mtls-archive-mtls.yaml | 50 + .../archive/s3-mtls-archive-tls.yaml | 55 + .../archive/s3-tls-archive-mtls.yaml | 55 + .../archive/s3-tls-archive-tls.yaml | 46 + e2e/definitions/backup/backup-mtls-env.yaml | 35 + e2e/definitions/backup/backup-mtls.yaml | 36 + e2e/definitions/backup/backup-tls.yaml | 34 + e2e/definitions/backup/backup.yaml | 4 +- e2e/definitions/backup/config-mtls-env.yaml | 9 + e2e/definitions/backup/podconfig.yaml | 20 + e2e/definitions/cert/issure.yaml | 7 + e2e/definitions/cert/minio-ca.yaml | 30 + e2e/definitions/cert/minio-mtls.yaml | 36 + e2e/definitions/cert/minio-tls.yaml | 18 + e2e/definitions/check/check-mtls-env.yaml | 35 + e2e/definitions/check/check-mtls.yaml | 36 + e2e/definitions/check/check-tls.yaml | 34 + e2e/definitions/check/config-mtls-env.yaml | 9 + e2e/definitions/proxy/config.yaml | 89 + e2e/definitions/proxy/deployment.yaml | 43 + e2e/definitions/proxy/service.yaml | 35 + e2e/definitions/restore/config-mtls-env.yaml | 12 + .../restore/restore-backupcommand.yaml | 2 +- e2e/definitions/restore/restore-mtls.yaml | 39 + e2e/definitions/restore/restore-tls.yaml | 37 + e2e/definitions/restore/restore.yaml | 2 +- .../restore/s3-mtls-restore-mtls-env.yaml | 45 + .../restore/s3-mtls-restore-mtls.yaml | 50 + .../restore/s3-mtls-restore-tls.yaml | 55 + .../restore/s3-tls-restore-mtls.yaml | 55 + .../restore/s3-tls-restore-tls.yaml | 46 + e2e/definitions/subject-dl/deployment.yaml | 104 + e2e/kind.mk | 2 +- e2e/lib/k8up.bash | 146 +- e2e/test-03-backup.bats | 14 +- e2e/test-10-restore-self-signed-tls.bats | 35 + e2e/test-11-archive-self-signed-tls.bats | 50 + envtest/envsuite.go | 1 + envtest/integration.mk | 4 +- go.mod | 1 + go.sum | 2 - operator/archivecontroller/executor.go | 52 +- operator/backupcontroller/backup_utils.go | 16 +- .../controller_integration_test.go | 31 + .../controller_utils_integration_test.go | 133 + operator/backupcontroller/executor.go | 30 +- operator/cfg/config.go | 3 + .../controller_integration_test.go | 24 + .../controller_utils_integration_test.go | 172 + operator/checkcontroller/executor.go | 34 +- operator/job/job.go | 42 +- operator/prunecontroller/executor.go | 37 +- operator/restorecontroller/executor.go | 57 +- operator/restorecontroller/executor_test.go | 9 +- operator/schedulecontroller/handler.go | 46 +- operator/schedulecontroller/handler_test.go | 105 + operator/scheduler/scheduler.go | 5 + operator/utils/utils.go | 158 + operator/utils/utils_test.go | 583 ++ restic/cfg/config.go | 8 + restic/cli/archive.go | 4 +- restic/cli/init.go | 9 +- restic/cli/restic.go | 31 + restic/cli/restore.go | 40 +- restic/cli/utils.go | 38 + restic/s3/client.go | 43 +- 117 files changed, 16878 insertions(+), 285 deletions(-) create mode 100644 api/v1/podconfig_types.go create mode 100644 charts/k8up/templates/grafana-dashboard.yaml create mode 100644 config/crd/apiextensions.k8s.io/v1/k8up.io_podconfigs.yaml create mode 100644 deployment.yaml create mode 100644 e2e/definitions/archive/config-mtls-env.yaml create mode 100644 e2e/definitions/archive/s3-mtls-archive-mtls-env.yaml create mode 100644 e2e/definitions/archive/s3-mtls-archive-mtls.yaml create mode 100644 e2e/definitions/archive/s3-mtls-archive-tls.yaml create mode 100644 e2e/definitions/archive/s3-tls-archive-mtls.yaml create mode 100644 e2e/definitions/archive/s3-tls-archive-tls.yaml create mode 100644 e2e/definitions/backup/backup-mtls-env.yaml create mode 100644 e2e/definitions/backup/backup-mtls.yaml create mode 100644 e2e/definitions/backup/backup-tls.yaml create mode 100644 e2e/definitions/backup/config-mtls-env.yaml create mode 100644 e2e/definitions/backup/podconfig.yaml create mode 100644 e2e/definitions/cert/issure.yaml create mode 100644 e2e/definitions/cert/minio-ca.yaml create mode 100644 e2e/definitions/cert/minio-mtls.yaml create mode 100644 e2e/definitions/cert/minio-tls.yaml create mode 100644 e2e/definitions/check/check-mtls-env.yaml create mode 100644 e2e/definitions/check/check-mtls.yaml create mode 100644 e2e/definitions/check/check-tls.yaml create mode 100644 e2e/definitions/check/config-mtls-env.yaml create mode 100644 e2e/definitions/proxy/config.yaml create mode 100644 e2e/definitions/proxy/deployment.yaml create mode 100644 e2e/definitions/proxy/service.yaml create mode 100644 e2e/definitions/restore/config-mtls-env.yaml create mode 100644 e2e/definitions/restore/restore-mtls.yaml create mode 100644 e2e/definitions/restore/restore-tls.yaml create mode 100644 e2e/definitions/restore/s3-mtls-restore-mtls-env.yaml create mode 100644 e2e/definitions/restore/s3-mtls-restore-mtls.yaml create mode 100644 e2e/definitions/restore/s3-mtls-restore-tls.yaml create mode 100644 e2e/definitions/restore/s3-tls-restore-mtls.yaml create mode 100644 e2e/definitions/restore/s3-tls-restore-tls.yaml create mode 100644 e2e/definitions/subject-dl/deployment.yaml create mode 100644 e2e/test-10-restore-self-signed-tls.bats create mode 100644 e2e/test-11-archive-self-signed-tls.bats create mode 100644 operator/checkcontroller/controller_utils_integration_test.go create mode 100644 operator/utils/utils.go create mode 100644 operator/utils/utils_test.go create mode 100644 restic/cli/utils.go diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a40b2d7e8..fc7f89322 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,6 +11,7 @@ `bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency` as they show up in the changelog - [ ] PR contains the label `area:operator` +- [ ] Commits are [signed off](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) - [ ] Link this PR to related issues - [ ] I have not made _any_ changes in the `charts/` directory. @@ -21,6 +22,7 @@ as they show up in the changelog - [ ] PR contains the label `area:chart` - [ ] PR contains the chart label, e.g. `chart:k8up` +- [ ] Commits are [signed off](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) - [ ] Variables are documented in the values.yaml using the format required by [Helm-Docs](https://github.com/norwoodj/helm-docs#valuesyaml-metadata). - [ ] Chart Version bumped if immediate release after merging is planned - [ ] I have run `make chart-docs` diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da3bd69a7..47126912f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,4 +35,7 @@ jobs: ${{ runner.os }}-go- - name: Run tests + run: make test + + - name: Run integration tests run: make integration-test diff --git a/.gitignore b/.gitignore index f18f07550..0becf7a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,11 @@ e2e/debug # Charts .cr-release-packages/ .cr-index/ + +# Vagrant +.vagrant/ + +# Container volumes mount +.config/ +.kube/ +.npm/ diff --git a/ADOPTERS.md b/ADOPTERS.md index fde5d11e8..fbaceb72e 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -25,3 +25,4 @@ This list is sorted in the order that organizations were added to it. | [VSHN](https://www.vshn.ch) | [@tobru](https://github.com/tobru/) | K8up was born at VSHN because at that time there was no other mature enough backup operator around. Today, K8up is integral part of the service offering and protects precious data every day. | | [amazee.io](https://www.amazee.io) | [@dasrecht](https://github.com/dasrecht/) | We use K8up as an integral part of our Disaster Recovery procedures. | | [Lagoon](https://github.com/uselagoon) | [@tobybellwood](https://github.com/tobybellwood/) | We've adopted K8up within [Lagoon](https://github.com/uselagoon). This keeps the data of all Lagoon customers safe and restorable. | +| [Kubezy](https://kubezy.com) | [@halil-bugol](https://github.com/halil-bugol/) | We use K8up as Backup Operator in our Kubernetes Management product.| diff --git a/Makefile b/Makefile index 0d3e4b409..f4629fb0c 100644 --- a/Makefile +++ b/Makefile @@ -27,21 +27,22 @@ include Makefile.restic-integration.mk envtest/integration.mk # E2E tests -include e2e/Makefile -go_build ?= go build -o $(BIN_FILENAME) $(K8UP_MAIN_GO) +go_build ?= $(GO_EXEC) build -o $(BIN_FILENAME) $(K8UP_MAIN_GO) .PHONY: test test: ## Run tests - go test ./... -coverprofile cover.out + $(GO_EXEC) test ./... -coverprofile cover.out .PHONY: build build: generate fmt vet $(BIN_FILENAME) docs-update-usage ## Build manager binary .PHONY: run +run: export ARGS := $(ARGS) operator run: export BACKUP_ENABLE_LEADER_ELECTION = $(ENABLE_LEADER_ELECTION) run: export K8UP_DEBUG = true run: export BACKUP_OPERATOR_NAMESPACE = default run: fmt vet ## Run against the configured Kubernetes cluster in ~/.kube/config. Use ARGS to pass arguments to the command, e.g. `make run ARGS="--help"` - go run $(K8UP_MAIN_GO) $(ARGS) $(CMD) $(CMD_ARGS) + $(GO_EXEC) run $(K8UP_MAIN_GO) $(ARGS) $(CMD) $(CMD_ARGS) .PHONY: run-operator run-operator: CMD := operator @@ -80,9 +81,9 @@ deploy: kind-load-image install ## Deploy controller in the configured Kubernete .PHONY: generate generate: ## Generate manifests e.g. CRD, RBAC etc. # Generate code - go run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=".github/boilerplate.go.txt" paths="./..." + $(GO_EXEC) run sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=".github/boilerplate.go.txt" paths="./..." # Generate CRDs - go run sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=$(CRD_ROOT_DIR)/v1 crd:crdVersions=v1 + $(GO_EXEC) run sigs.k8s.io/controller-tools/cmd/controller-gen rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=$(CRD_ROOT_DIR)/v1 crd:crdVersions=v1 .PHONY: crd crd: generate ## Generate CRD to file @@ -90,11 +91,11 @@ crd: generate ## Generate CRD to file .PHONY: fmt fmt: ## Run go fmt against code - go fmt ./... + $(GO_EXEC) fmt ./... .PHONY: vet vet: ## Run go vet against code - go vet ./... + $(GO_EXEC) vet ./... .PHONY: lint lint: fmt vet golangci-lint ## Invokes all linting targets diff --git a/Makefile.restic-integration.vars.mk b/Makefile.restic-integration.vars.mk index d3d0e2ff4..0555f857d 100644 --- a/Makefile.restic-integration.vars.mk +++ b/Makefile.restic-integration.vars.mk @@ -13,7 +13,7 @@ restore_dir ?= $(integrationtest_dir)/restore stats_url ?= http://localhost:8091 -restic_version ?= $(shell go mod edit -json | jq -r '.Require[] | select(.Path == "github.com/restic/restic").Version' | sed "s/v//") +restic_version ?= $(shell $(GO_EXEC) mod edit -json | jq -r '.Require[] | select(.Path == "github.com/restic/restic").Version' | sed "s/v//") restic_path ?= $(go_bin)/restic restic_pid ?= $(integrationtest_dir)/restic.pid restic_url ?= https://github.com/restic/restic/releases/download/v$(restic_version)/restic_$(restic_version)_$(os)_$(arch).bz2 diff --git a/Makefile.vars.mk b/Makefile.vars.mk index 6485686dc..6f499bba0 100644 --- a/Makefile.vars.mk +++ b/Makefile.vars.mk @@ -1,5 +1,6 @@ IMG_TAG ?= latest +GO_EXEC ?= go K8UP_MAIN_GO ?= cmd/k8up/main.go K8UP_GOOS ?= linux K8UP_GOARCH ?= amd64 diff --git a/api/v1/archive_types.go b/api/v1/archive_types.go index 6a1411b35..e6c68d4f9 100644 --- a/api/v1/archive_types.go +++ b/api/v1/archive_types.go @@ -1,10 +1,12 @@ package v1 import ( + "context" "reflect" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) // ArchiveSpec defines the desired state of Archive. @@ -87,6 +89,13 @@ func (a *Archive) GetSuccessfulJobsHistoryLimit() *int { return a.Spec.KeepJobs } +func (a *Archive) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if a.Spec.RunnableSpec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, a.Spec.RunnableSpec.PodConfigRef.Name, a.GetNamespace(), c) +} + // GetJobObjects returns a sortable list of jobs func (a *ArchiveList) GetJobObjects() JobObjectList { items := make(JobObjectList, len(a.Items)) diff --git a/api/v1/backend.go b/api/v1/backend.go index 956886992..426b0adfe 100644 --- a/api/v1/backend.go +++ b/api/v1/backend.go @@ -17,15 +17,19 @@ type ( // RepoPasswordSecretRef references a secret key to look up the restic repository password RepoPasswordSecretRef *corev1.SecretKeySelector `json:"repoPasswordSecretRef,omitempty"` // EnvFrom adds all environment variables from a an external source to the Restic job. - EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` - Local *LocalSpec `json:"local,omitempty"` - S3 *S3Spec `json:"s3,omitempty"` - GCS *GCSSpec `json:"gcs,omitempty"` - Azure *AzureSpec `json:"azure,omitempty"` - Swift *SwiftSpec `json:"swift,omitempty"` - B2 *B2Spec `json:"b2,omitempty"` - Rest *RestServerSpec `json:"rest,omitempty"` + EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` + Local *LocalSpec `json:"local,omitempty"` + S3 *S3Spec `json:"s3,omitempty"` + GCS *GCSSpec `json:"gcs,omitempty"` + Azure *AzureSpec `json:"azure,omitempty"` + Swift *SwiftSpec `json:"swift,omitempty"` + B2 *B2Spec `json:"b2,omitempty"` + Rest *RestServerSpec `json:"rest,omitempty"` InsecureTLS bool `json:"insecureTLS,omitempty"` + + + TLSOptions *TLSOptions `json:"tlsOptions,omitempty"` + VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"` } // +k8s:deepcopy-gen=false @@ -280,3 +284,9 @@ func (in *RestServerSpec) String() string { protocol, url, _ := strings.Cut(in.URL, "://") return fmt.Sprintf("rest:%s://%s:%s@%s", protocol, "$(USER)", "$(PASSWORD)", url) } + +type TLSOptions struct { + CACert string `json:"caCert,omitempty"` + ClientCert string `json:"clientCert,omitempty"` + ClientKey string `json:"clientKey,omitempty"` +} diff --git a/api/v1/backup_types.go b/api/v1/backup_types.go index 998ad509e..61b40a575 100644 --- a/api/v1/backup_types.go +++ b/api/v1/backup_types.go @@ -1,10 +1,12 @@ package v1 import ( + "context" "reflect" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) // BackupSpec defines a single backup. It must contain all information to connect to @@ -127,6 +129,13 @@ func (b *Backup) GetSuccessfulJobsHistoryLimit() *int { return b.Spec.KeepJobs } +func (b *Backup) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if b.Spec.RunnableSpec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, b.Spec.RunnableSpec.PodConfigRef.Name, b.GetNamespace(), c) +} + // GetJobObjects returns a sortable list of jobs func (b *BackupList) GetJobObjects() JobObjectList { items := make(JobObjectList, len(b.Items)) diff --git a/api/v1/check_types.go b/api/v1/check_types.go index a93e4bde5..ffa3379a3 100644 --- a/api/v1/check_types.go +++ b/api/v1/check_types.go @@ -1,10 +1,12 @@ package v1 import ( + "context" "reflect" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) // CheckSpec defines the desired state of Check. It needs to contain the repository @@ -106,6 +108,13 @@ func (c *Check) GetSuccessfulJobsHistoryLimit() *int { return c.Spec.KeepJobs } +func (b *Check) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if b.Spec.RunnableSpec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, b.Spec.RunnableSpec.PodConfigRef.Name, b.GetNamespace(), c) +} + // GetJobObjects returns a sortable list of jobs func (c *CheckList) GetJobObjects() JobObjectList { items := make(JobObjectList, len(c.Items)) diff --git a/api/v1/job_object.go b/api/v1/job_object.go index 194a2544c..4de1a4e2a 100644 --- a/api/v1/job_object.go +++ b/api/v1/job_object.go @@ -1,6 +1,8 @@ package v1 import ( + "context" + corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -19,6 +21,8 @@ type JobObject interface { GetPodSecurityContext() *corev1.PodSecurityContext // GetActiveDeadlineSeconds returns the specified active deadline seconds timeout. GetActiveDeadlineSeconds() *int64 + // GetPodConfig returns the defined PodSpec + GetPodConfig(context.Context, client.Client) (*PodConfig, error) } // +k8s:deepcopy-gen=false diff --git a/api/v1/podconfig_types.go b/api/v1/podconfig_types.go new file mode 100644 index 000000000..8a9e5d0d3 --- /dev/null +++ b/api/v1/podconfig_types.go @@ -0,0 +1,60 @@ +package v1 + +import ( + "context" + + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// +kubebuilder:rbac:groups=k8up.io,resources=podconfigs,verbs=get;list;watch + +// PodConfigSpec contains the podTemplate definition. +type PodConfigSpec struct { + Template corev1.PodTemplateSpec `json:"template,omitempty"` +} + +// PodConfigStatus defines the observed state of Snapshot +type PodConfigStatus struct { +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status + +// PodConfig is the Schema for the PodConcig API +// Any annotations and labels set on this object will also be set on +// the final pod. +type PodConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec PodConfigSpec `json:"spec,omitempty"` + Status PodConfigStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// SnapshotList contains a list of Snapshot +type PodConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PodConfig `json:"items"` +} + +func NewPodConfig(ctx context.Context, name, namespace string, c client.Client) (*PodConfig, error) { + config := &PodConfig{} + err := c.Get(ctx, client.ObjectKey{Name: name, Namespace: namespace}, config) + if err != nil { + if apierrors.IsNotFound(err) { + return nil, nil + } + return nil, err + } + return config, nil +} + +func init() { + SchemeBuilder.Register(&PodConfig{}, &PodConfigList{}) +} diff --git a/api/v1/prune_types.go b/api/v1/prune_types.go index fb1fed0ac..31c452e0d 100644 --- a/api/v1/prune_types.go +++ b/api/v1/prune_types.go @@ -1,10 +1,12 @@ package v1 import ( + "context" "reflect" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) // PruneSpec needs to contain the repository information as well as the desired @@ -115,6 +117,13 @@ func (p *Prune) GetSuccessfulJobsHistoryLimit() *int { return p.Spec.KeepJobs } +func (p *Prune) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if p.Spec.RunnableSpec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, p.Spec.RunnableSpec.PodConfigRef.Name, p.GetNamespace(), c) +} + // GetJobObjects returns a sortable list of jobs func (p *PruneList) GetJobObjects() JobObjectList { items := make(JobObjectList, len(p.Items)) diff --git a/api/v1/restore_types.go b/api/v1/restore_types.go index 780b69c66..fbfb72754 100644 --- a/api/v1/restore_types.go +++ b/api/v1/restore_types.go @@ -1,10 +1,12 @@ package v1 import ( + "context" "reflect" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" ) // RestoreSpec can either contain an S3 restore point or a local one. For the local @@ -35,8 +37,10 @@ type RestoreSpec struct { // RestoreMethod contains how and where the restore should happen // all the settings are mutual exclusive. type RestoreMethod struct { - S3 *S3Spec `json:"s3,omitempty"` - Folder *FolderRestore `json:"folder,omitempty"` + S3 *S3Spec `json:"s3,omitempty"` + Folder *FolderRestore `json:"folder,omitempty"` + TLSOptions *TLSOptions `json:"tlsOptions,omitempty"` + VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"` } type FolderRestore struct { @@ -105,6 +109,13 @@ func (r *Restore) GetSuccessfulJobsHistoryLimit() *int { return r.Spec.KeepJobs } +func (r *Restore) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if r.Spec.RunnableSpec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, r.Spec.RunnableSpec.PodConfigRef.Name, r.GetNamespace(), c) +} + // GetJobObjects returns a sortable list of jobs func (r *RestoreList) GetJobObjects() JobObjectList { items := make(JobObjectList, len(r.Items)) diff --git a/api/v1/runnable_types.go b/api/v1/runnable_types.go index a71249217..cc15cde76 100644 --- a/api/v1/runnable_types.go +++ b/api/v1/runnable_types.go @@ -15,11 +15,40 @@ type RunnableSpec struct { // PodSecurityContext describes the security context with which this action shall be executed. PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"` + // PodConfigRef describes the pod spec with wich this action shall be executed. + // It takes precedence over the Resources or PodSecurityContext field. + // It does not allow changing the image or the command of the resulting pod. + // This is for advanced use-cases only. Please only set this if you know what you're doing. + PodConfigRef *corev1.LocalObjectReference `json:"podConfigRef,omitempty"` + + // Volumes List of volumes that can be mounted by containers belonging to the pod. + Volumes *[]RunnableVolumeSpec `json:"volumes,omitempty"` + // ActiveDeadlineSeconds specifies the duration in seconds relative to the startTime that the job may be continuously active before the system tries to terminate it. // Value must be positive integer if given. ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` } +type RunnableVolumeSpec struct { + // name of the volume. + // Must be a DNS_LABEL and unique within the pod. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + Name string `json:"name"` + + // persistentVolumeClaimVolumeSource represents a reference to a + // PersistentVolumeClaim in the same namespace. + // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + // +optional + PersistentVolumeClaim *corev1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` + // secret represents a secret that should populate this volume. + // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret + // +optional + Secret *corev1.SecretVolumeSource `json:"secret,omitempty"` + // configMap represents a configMap that should populate this volume + // +optional + ConfigMap *corev1.ConfigMapVolumeSource `json:"configMap,omitempty"` +} + // AppendEnvFromToContainer will add EnvFromSource from the given RunnableSpec to the Container func (in *RunnableSpec) AppendEnvFromToContainer(containerSpec *corev1.Container) { if in.Backend != nil { diff --git a/api/v1/schedule_types.go b/api/v1/schedule_types.go index cd77398c8..54fe13002 100644 --- a/api/v1/schedule_types.go +++ b/api/v1/schedule_types.go @@ -1,11 +1,13 @@ package v1 import ( + "context" "strings" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client" ) // ScheduleSpec defines the schedules for the various job types. @@ -36,6 +38,10 @@ type ScheduleSpec struct { // PodSecurityContext describes the security context with which actions (such as backups) shall be executed. PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"` + + // PodConfigRef will apply the given template to all job definitions in this Schedule. + // It can be overriden for specific jobs if necessary. + PodConfigRef *corev1.LocalObjectReference `json:"podConfigRef,omitempty"` } // ScheduleDefinition is the actual cron-type expression that defines the interval of the actions. @@ -185,6 +191,13 @@ func (s *Schedule) GetSuccessfulJobsHistoryLimit() *int { return s.Spec.KeepJobs } +func (s *Schedule) GetPodConfig(ctx context.Context, c client.Client) (*PodConfig, error) { + if s.Spec.PodConfigRef == nil { + return nil, nil + } + return NewPodConfig(ctx, s.Spec.PodConfigRef.Name, s.GetNamespace(), c) +} + // String casts the value to string. // "aScheduleDefinition.String()" and "string(aScheduleDefinition)" are equivalent. func (s ScheduleDefinition) String() string { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index f536307f7..85c50f571 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -210,6 +210,22 @@ func (in *Backend) DeepCopyInto(out *Backend) { *out = new(RestServerSpec) (*in).DeepCopyInto(*out) } + if in.TLSOptions != nil { + in, out := &in.TLSOptions, &out.TLSOptions + *out = new(TLSOptions) + **out = **in + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = new([]corev1.VolumeMount) + if **in != nil { + in, out := *in, *out + *out = make([]corev1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend. @@ -581,6 +597,96 @@ func (in *Pod) DeepCopy() *Pod { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodConfig) DeepCopyInto(out *PodConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodConfig. +func (in *PodConfig) DeepCopy() *PodConfig { + if in == nil { + return nil + } + out := new(PodConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodConfigList) DeepCopyInto(out *PodConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PodConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodConfigList. +func (in *PodConfigList) DeepCopy() *PodConfigList { + if in == nil { + return nil + } + out := new(PodConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PodConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodConfigSpec) DeepCopyInto(out *PodConfigSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodConfigSpec. +func (in *PodConfigSpec) DeepCopy() *PodConfigSpec { + if in == nil { + return nil + } + out := new(PodConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PodConfigStatus) DeepCopyInto(out *PodConfigStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodConfigStatus. +func (in *PodConfigStatus) DeepCopy() *PodConfigStatus { + if in == nil { + return nil + } + out := new(PodConfigStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PreBackupPod) DeepCopyInto(out *PreBackupPod) { *out = *in @@ -868,6 +974,22 @@ func (in *RestoreMethod) DeepCopyInto(out *RestoreMethod) { *out = new(FolderRestore) (*in).DeepCopyInto(*out) } + if in.TLSOptions != nil { + in, out := &in.TLSOptions, &out.TLSOptions + *out = new(TLSOptions) + **out = **in + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = new([]corev1.VolumeMount) + if **in != nil { + in, out := *in, *out + *out = make([]corev1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreMethod. @@ -986,6 +1108,22 @@ func (in *RunnableSpec) DeepCopyInto(out *RunnableSpec) { *out = new(corev1.PodSecurityContext) (*in).DeepCopyInto(*out) } + if in.PodConfigRef != nil { + in, out := &in.PodConfigRef, &out.PodConfigRef + *out = new(corev1.LocalObjectReference) + **out = **in + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = new([]RunnableVolumeSpec) + if **in != nil { + in, out := *in, *out + *out = make([]RunnableVolumeSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } if in.ActiveDeadlineSeconds != nil { in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds *out = new(int64) @@ -1003,6 +1141,36 @@ func (in *RunnableSpec) DeepCopy() *RunnableSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RunnableVolumeSpec) DeepCopyInto(out *RunnableVolumeSpec) { + *out = *in + if in.PersistentVolumeClaim != nil { + in, out := &in.PersistentVolumeClaim, &out.PersistentVolumeClaim + *out = new(corev1.PersistentVolumeClaimVolumeSource) + **out = **in + } + if in.Secret != nil { + in, out := &in.Secret, &out.Secret + *out = new(corev1.SecretVolumeSource) + (*in).DeepCopyInto(*out) + } + if in.ConfigMap != nil { + in, out := &in.ConfigMap, &out.ConfigMap + *out = new(corev1.ConfigMapVolumeSource) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunnableVolumeSpec. +func (in *RunnableVolumeSpec) DeepCopy() *RunnableVolumeSpec { + if in == nil { + return nil + } + out := new(RunnableVolumeSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *S3Spec) DeepCopyInto(out *S3Spec) { *out = *in @@ -1156,6 +1324,11 @@ func (in *ScheduleSpec) DeepCopyInto(out *ScheduleSpec) { *out = new(corev1.PodSecurityContext) (*in).DeepCopyInto(*out) } + if in.PodConfigRef != nil { + in, out := &in.PodConfigRef, &out.PodConfigRef + *out = new(corev1.LocalObjectReference) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleSpec. @@ -1343,3 +1516,18 @@ func (in *SwiftSpec) DeepCopy() *SwiftSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TLSOptions) DeepCopyInto(out *TLSOptions) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSOptions. +func (in *TLSOptions) DeepCopy() *TLSOptions { + if in == nil { + return nil + } + out := new(TLSOptions) + in.DeepCopyInto(out) + return out +} diff --git a/charts/k8up/Chart.yaml b/charts/k8up/Chart.yaml index 5ba505310..98fea299f 100644 --- a/charts/k8up/Chart.yaml +++ b/charts/k8up/Chart.yaml @@ -6,7 +6,7 @@ keywords: - backup - operator - restic -version: 4.5.1 +version: 4.7.0 sources: - https://github.com/k8up-io/k8up maintainers: diff --git a/charts/k8up/README.md b/charts/k8up/README.md index bf7e622f2..7f89a9b7a 100644 --- a/charts/k8up/README.md +++ b/charts/k8up/README.md @@ -1,6 +1,6 @@ # k8up -![Version: 4.5.1](https://img.shields.io/badge/Version-4.5.1-informational?style=flat-square) +![Version: 4.7.0](https://img.shields.io/badge/Version-4.7.0-informational?style=flat-square) Kubernetes and OpenShift Backup Operator based on restic @@ -13,7 +13,7 @@ helm repo add k8up-io https://k8up-io.github.io/k8up helm install k8up k8up-io/k8up ``` ```bash -kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-4.5.1/k8up-crd.yaml +kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-4.7.0/k8up-crd.yaml ```