├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── enhancement.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── pull_request.yml │ └── release.yaml ├── .gitignore ├── .golangci.yml ├── .goreleaser.yaml ├── ACKNOWLEDGEMENTS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── Makefile ├── PROJECT ├── README.md ├── api └── v1beta2 │ ├── foundationdb_constants.go │ ├── foundationdb_custom_parameter.go │ ├── foundationdb_custom_parameter_test.go │ ├── foundationdb_database_configuration.go │ ├── foundationdb_database_configuration_test.go │ ├── foundationdb_env_variables.go │ ├── foundationdb_errors.go │ ├── foundationdb_labels.go │ ├── foundationdb_process_address.go │ ├── foundationdb_process_class.go │ ├── foundationdb_status.go │ ├── foundationdb_status_test.go │ ├── foundationdb_version.go │ ├── foundationdb_version_test.go │ ├── foundationdbbackup_types.go │ ├── foundationdbbackup_types_test.go │ ├── foundationdbcluster_types.go │ ├── foundationdbcluster_types_test.go │ ├── foundationdbrestore_types.go │ ├── foundationdbrestore_types_test.go │ ├── groupversion_info.go │ ├── image_config.go │ ├── image_config_test.go │ ├── none.go │ ├── suite_test.go │ ├── testdata │ ├── fdb_status_7_1_rc1.json │ ├── fdbbackup_status_6_2.json │ └── unreachable_test_processes.json │ └── zz_generated.deepcopy.go ├── charts └── fdb-operator │ ├── Chart.yaml │ ├── crds │ ├── apps.foundationdb.org_foundationdbbackups.yaml │ ├── apps.foundationdb.org_foundationdbclusters.yaml │ └── apps.foundationdb.org_foundationdbrestores.yaml │ ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── manager │ │ └── deployment.yaml │ └── rbac │ │ ├── rbac_role.yaml │ │ ├── rbac_role_binding.yaml │ │ └── serviceaccount.yaml │ └── values.yaml ├── cmd └── po-docgen │ ├── api.go │ ├── doc.go │ └── main.go ├── config ├── blobstore │ ├── credentials.yaml │ ├── kustomization.yaml │ └── seaweedfs.yaml ├── certmanager │ ├── certificate.yaml │ ├── kustomization.yaml │ └── kustomizeconfig.yaml ├── crd │ ├── bases │ │ ├── apps.foundationdb.org_foundationdbbackups.yaml │ │ ├── apps.foundationdb.org_foundationdbclusters.yaml │ │ └── apps.foundationdb.org_foundationdbrestores.yaml │ ├── kustomization.yaml │ ├── kustomizeconfig.yaml │ └── patches │ │ ├── cainjection_in_foundationdbbackups.yaml │ │ ├── cainjection_in_foundationdbclusters.yaml │ │ ├── cainjection_in_foundationdbrestores.yaml │ │ ├── webhook_in_foundationdbbackups.yaml │ │ ├── webhook_in_foundationdbclusters.yaml │ │ └── webhook_in_foundationdbrestores.yaml ├── deployment │ ├── kustomization.yaml │ ├── manager.yaml │ └── rbac_role_binding.yaml ├── development │ ├── backup_credentials.yaml │ ├── debug_logs.yaml │ ├── kustomization.yaml.sample │ ├── remote_build.yaml │ └── test_certs.yaml ├── rbac │ ├── cluster_role.yaml │ ├── kustomization.yaml │ └── role.yaml ├── samples │ ├── Readme.md │ ├── backup.yaml │ ├── client.yaml │ ├── cluster.yaml │ ├── deployment.yaml │ ├── pod_disruption_budget.yaml │ └── restore.yaml ├── test-certs │ ├── cert.pem │ ├── generate_cert.bash │ ├── generate_secrets.bash │ └── key.pem └── tests │ ├── README.md │ ├── backup │ ├── README.md │ ├── base │ │ ├── backup.yaml │ │ └── kustomization.yaml │ ├── restore │ │ ├── kustomization.yaml │ │ └── restore.yaml │ └── stopped │ │ ├── backup.yaml │ │ └── kustomization.yaml │ ├── base │ ├── cluster.yaml │ └── kustomization.yaml │ ├── client │ ├── client.yaml │ └── kustomization.yaml │ ├── dns │ ├── client.yaml │ ├── dns.yaml │ └── kustomization.yaml │ ├── multi_dc │ ├── Readme.md │ ├── create.bash │ ├── delete.bash │ ├── final.yaml │ ├── functions.bash │ └── stage_1.yaml │ ├── multi_kc │ ├── create.bash │ ├── delete.bash │ ├── final.yaml │ ├── functions.bash │ └── stage_1.yaml │ ├── three_data_hall │ ├── Readme.md │ ├── cluster.yaml │ └── unified_image_role.yaml │ ├── tls │ ├── kustomization.yaml │ └── tls.yaml │ └── unified_image │ ├── images.yaml │ ├── kustomization.yaml │ └── unified_image_role.yaml ├── controllers ├── add_pods.go ├── add_pods_test.go ├── add_process_groups.go ├── add_process_groups_test.go ├── add_pvcs.go ├── add_pvcs_test.go ├── add_services.go ├── add_services_test.go ├── admin_client_test.go ├── backup_controller.go ├── backup_controller_test.go ├── bounce_processes.go ├── bounce_processes_test.go ├── change_coordinators.go ├── change_coordinators_test.go ├── check_client_compatibility.go ├── check_client_compatibility_test.go ├── choose_removals.go ├── choose_removals_test.go ├── cluster_controller.go ├── cluster_controller_test.go ├── controllers.go ├── delete_pods_for_buggification.go ├── delete_pods_for_buggification_test.go ├── exclude_processes.go ├── exclude_processes_test.go ├── generate_initial_cluster_file.go ├── maintenance_mode_checker.go ├── maintenance_mode_checker_test.go ├── metrics.go ├── metrics_test.go ├── modify_backup.go ├── remove_incompatible_processes.go ├── remove_incompatible_processes_test.go ├── remove_process_groups.go ├── remove_process_groups_test.go ├── remove_services.go ├── replace_failed_process_groups.go ├── replace_failed_process_groups_test.go ├── replace_misconfigured_process_groups.go ├── replace_misconfigured_process_groups_test.go ├── restore_controller.go ├── restore_controller_test.go ├── start_backup.go ├── start_restore.go ├── stop_backup.go ├── suite_test.go ├── toggle_backup_paused.go ├── update_backup_agents.go ├── update_backup_status.go ├── update_config_map.go ├── update_database_configuration.go ├── update_database_configuration_test.go ├── update_lock_configuration.go ├── update_lock_configuration_test.go ├── update_metadata.go ├── update_pod_config.go ├── update_pod_config_test.go ├── update_pods.go ├── update_pods_test.go ├── update_restore_status.go ├── update_restore_status_test.go ├── update_sidecar_versions.go ├── update_sidecar_versions_test.go ├── update_status.go └── update_status_test.go ├── docs ├── FDB_logo.png ├── backup_spec.md ├── changelog │ ├── CHANGELOG.md │ ├── v0.27.1.md │ ├── v0.28.0.md │ ├── v0.29.0.md │ ├── v0.30.0.md │ ├── v0.31.0.md │ ├── v0.31.1.md │ ├── v0.32.0.md │ ├── v0.33.0.md │ ├── v0.34.0.md │ ├── v0.34.1.md │ ├── v0.35.0.md │ ├── v0.35.1.md │ ├── v0.36.0.md │ ├── v0.37.0.md │ ├── v0.38.0.md │ ├── v0.39.0.md │ ├── v0.39.1.md │ ├── v0.39.2.md │ ├── v0.40.0.md │ ├── v0.41.0.md │ ├── v0.41.1.md │ ├── v0.42.0.md │ ├── v0.42.1.md │ ├── v0.43.0.md │ ├── v0.44.0.md │ ├── v0.45.0.md │ ├── v0.46.0.md │ ├── v0.47.0.md │ ├── v0.48.0.md │ ├── v0.49.0.md │ ├── v0.49.2.md │ ├── v0.50.0.md │ ├── v0.51.0.md │ ├── v0.51.1.md │ ├── v1.0.0.md │ ├── v1.1.0.md │ ├── v1.1.1.md │ ├── v1.10.0.md │ ├── v1.11.0.md │ ├── v1.12.0.md │ ├── v1.13.0.md │ ├── v1.14.0.md │ ├── v1.15.0.md │ ├── v1.16.0.md │ ├── v1.17.0.md │ ├── v1.18.0.md │ ├── v1.19.0.md │ ├── v1.2.0.md │ ├── v1.20.0.md │ ├── v1.20.1.md │ ├── v1.21.0.md │ ├── v1.22.0.md │ ├── v1.23.0.md │ ├── v1.24.0.md │ ├── v1.25.0.md │ ├── v1.26.0.md │ ├── v1.27.0.md │ ├── v1.28.0.md │ ├── v1.29.0.md │ ├── v1.3.0.md │ ├── v1.3.1.md │ ├── v1.30.0.md │ ├── v1.32.0.md │ ├── v1.33.0.md │ ├── v1.34.0.md │ ├── v1.35.0.md │ ├── v1.36.0.md │ ├── v1.37.0.md │ ├── v1.38.0.md │ ├── v1.39.0.md │ ├── v1.4.0.md │ ├── v1.40.0.md │ ├── v1.41.0.md │ ├── v1.42.0.md │ ├── v1.43.0.md │ ├── v1.44.0.md │ ├── v1.45.0.md │ ├── v1.46.0.md │ ├── v1.47.0.md │ ├── v1.48.0.md │ ├── v1.49.0.md │ ├── v1.5.0.md │ ├── v1.50.0.md │ ├── v1.51.0.md │ ├── v1.52.0.md │ ├── v1.53.0.md │ ├── v1.54.0.md │ ├── v1.55.0.md │ ├── v1.6.0.md │ ├── v1.7.0.md │ ├── v1.8.0.md │ ├── v1.8.1.md │ ├── v1.9.0.md │ ├── v2.0.0 │ ├── v2.0.0.md │ ├── v2.1.0.md │ ├── v2.2.0.md │ ├── v2.3.0.md │ ├── v2.4.0.md │ ├── v2.5.0.md │ ├── v2.6.0.md │ ├── v2.7.0.md │ ├── v2.8.0.md │ └── v2.9.0.md ├── cluster_spec.md ├── compatibility.md ├── design │ ├── Readme.md │ ├── backup_and_restore.md │ ├── better_coordination_multi_operator.md │ ├── bin_pack_fault_domains.md │ ├── imgs │ │ ├── fault_domain_multi_host.svg │ │ ├── increase_fault_domain_end.svg │ │ ├── increase_fault_domain_initial.svg │ │ └── reduce_fault_domains.svg │ ├── implemented │ │ ├── automatic_replacements.md │ │ ├── multiple_storage_per_disk.md │ │ ├── node_taint_eviction.md │ │ ├── process_group_status.md │ │ └── three_datahall.md │ ├── plugin_multi_fdb_support.md │ ├── process_group_crd.md │ ├── replacement_buckets.md │ ├── suspending_pods.md │ ├── template.md │ └── unified_sidecar_and_process_monitor.md ├── fdb_release_prep.md ├── manual │ ├── backup.md │ ├── customization.md │ ├── debugging.md │ ├── fault_domains.md │ ├── getting_started.md │ ├── imgs │ │ └── upgrade_mechanism.svg │ ├── index.md │ ├── more.md │ ├── operations.md │ ├── operator_customization.md │ ├── replacements_and_deletions.md │ ├── resources.md │ ├── scaling.md │ ├── technical_design.md │ ├── tls.md │ ├── upgrades.md │ └── warnings.md ├── monitoring.md └── restore_spec.md ├── e2e ├── .gitignore ├── Makefile ├── README.md ├── chaos-mesh │ ├── Readme.md │ └── api │ │ └── v1alpha1 │ │ ├── awschaos_types.go │ │ ├── azurechaos_types.go │ │ ├── blockchaos_types.go │ │ ├── common_errors.go │ │ ├── common_types.go │ │ ├── dnschaos_type.go │ │ ├── gcpchaos_types.go │ │ ├── groupversion_info.go │ │ ├── httpchaos_types.go │ │ ├── iochaos_types.go │ │ ├── jvmchaos_types.go │ │ ├── kernelchaos_types.go │ │ ├── kinds.go │ │ ├── networkchaos_types.go │ │ ├── physical_machine_chaos_types.go │ │ ├── physical_machine_types.go │ │ ├── podchaos_types.go │ │ ├── podhttpchaos_types.go │ │ ├── podiochaos_types.go │ │ ├── podnetworkchaos_types.go │ │ ├── remote_cluster_types.go │ │ ├── schedule_item.go │ │ ├── schedule_types.go │ │ ├── selector.go │ │ ├── statuscheck_types.go │ │ ├── statuschecktemplate_types.go │ │ ├── stresschaos_types.go │ │ ├── timechaos_types.go │ │ ├── workflow_types.go │ │ ├── workflownode_types.go │ │ ├── zz_generated.chaosmesh.go │ │ ├── zz_generated.deepcopy.go │ │ ├── zz_generated.schedule.chaosmesh.go │ │ └── zz_generated.workflow.chaosmesh.go ├── fixtures │ ├── blobstore.go │ ├── certificate_generator.go │ ├── chaos_common.go │ ├── chaos_disk.go │ ├── chaos_http.go │ ├── chaos_network.go │ ├── chaos_pod.go │ ├── chaos_stress.go │ ├── cluster_config.go │ ├── cluster_config_test.go │ ├── factory.go │ ├── fdb_backup.go │ ├── fdb_cluster.go │ ├── fdb_cluster_creation_tracker.go │ ├── fdb_cluster_specs.go │ ├── fdb_cluster_test.go │ ├── fdb_data_loader.go │ ├── fdb_operator_client.go │ ├── fdb_operator_fixtures.go │ ├── fdb_restore.go │ ├── fixtures.go │ ├── ha_fdb_cluster.go │ ├── images.go │ ├── images_test.go │ ├── kubernetes_fixtures.go │ ├── options.go │ ├── pods.go │ ├── random_string.go │ ├── singleton.go │ ├── status.go │ ├── suite_test.go │ ├── test_runner.go │ ├── upgrade_test_configuration.go │ └── versions.go ├── main.go ├── scripts │ ├── remove_namespaces │ ├── setup-local-fdb-cluster.sh │ ├── setup_e2e.sh │ └── start_kind_cluster.sh ├── test_operator │ ├── operator_test.go │ └── suite_test.go ├── test_operator_backups │ ├── operator_backup_test.go │ └── suite_test.go ├── test_operator_creation_velocity │ ├── operator_creation_velocity_test.go │ └── suite_test.go ├── test_operator_ha │ ├── operator_ha_test.go │ └── suite_test.go ├── test_operator_ha_failure │ ├── operator_ha_failure_test.go │ └── suite_test.go ├── test_operator_ha_flaky_upgrades │ ├── operator_ha_flaky_upgrade_test.go │ └── suite_test.go ├── test_operator_ha_upgrades │ ├── operator_ha_upgrade_test.go │ └── suite_test.go ├── test_operator_maintenance_mode │ ├── operator_maintenance_mode_test.go │ └── suite_test.go ├── test_operator_migrate_image_type │ ├── operator_migate_image_type_test.go │ └── suite_test.go ├── test_operator_migrations │ ├── operator_migration_test.go │ └── suite_test.go ├── test_operator_plugin │ ├── operator_plugin_test.go │ └── suite_test.go ├── test_operator_stress │ ├── operator_stress_test.go │ └── suite_test.go ├── test_operator_three_data_hall │ ├── operator_three_data_hall_test.go │ └── suite_test.go ├── test_operator_upgrades │ ├── operator_upgrades_test.go │ └── suite_test.go ├── test_operator_upgrades_variations │ ├── operator_upgrades_variations_test.go │ └── suite_test.go ├── test_operator_upgrades_with_chaos │ ├── operator_upgrades_with_chaos_test.go │ └── suite_test.go └── test_operator_velocity │ ├── operator_velocity_test.go │ └── suite_test.go ├── fdbclient ├── admin_client.go ├── admin_client_test.go ├── command_runner.go ├── command_runner_test.go ├── common.go ├── common_test.go ├── doc.go ├── fdb_client.go ├── lock_client.go └── suite_test.go ├── foundationdb-kubernetes-sidecar └── Readme.md ├── go.mod ├── go.sum ├── hack └── boilerplate.go.txt ├── internal ├── Readme.md ├── buggify │ ├── buggify.go │ ├── buggify_test.go │ └── suite_test.go ├── configmap_helper.go ├── configmap_helper_test.go ├── coordination │ ├── coordination.go │ ├── coordination_test.go │ └── suite_test.go ├── coordinator │ ├── coordinator.go │ ├── coordinator_test.go │ └── suite_test.go ├── deprecations.go ├── deprecations_test.go ├── error_helper.go ├── error_helper_test.go ├── kubernetes │ └── kubernetes.go ├── locality │ ├── locality.go │ ├── locality_test.go │ └── suite_test.go ├── log_file_cleaner.go ├── log_file_cleaner_test.go ├── maintenance │ ├── maintenance.go │ ├── maintenance_test.go │ └── suite_test.go ├── monitor_conf.go ├── monitor_conf_test.go ├── node_predicate.go ├── pod_client.go ├── pod_client_test.go ├── pod_helper.go ├── pod_helper_test.go ├── pod_models.go ├── pod_models_test.go ├── process_class.go ├── removals │ ├── remove.go │ ├── remove_test.go │ └── suite_test.go ├── replacements │ ├── replace_failed_process_groups.go │ ├── replace_failed_process_groups_test.go │ ├── replacements.go │ ├── replacements_test.go │ └── suite_test.go ├── restarts │ ├── restarts.go │ ├── restarts_test.go │ └── suite_test.go ├── service_helper.go ├── suite_test.go └── test_helper.go ├── kubectl-fdb ├── Readme.md ├── cmd │ ├── analyze.go │ ├── analyze_test.go │ ├── buggify.go │ ├── buggify_crash_loop.go │ ├── buggify_crash_loop_test.go │ ├── buggify_empty-monitor_conf_test.go │ ├── buggify_empty_monitor_conf.go │ ├── buggify_no_schedule.go │ ├── buggify_no_schedule_test.go │ ├── configuration.go │ ├── configuration_test.go │ ├── cordon.go │ ├── cordon_test.go │ ├── deprecation.go │ ├── deprecation_test.go │ ├── exclusion_status.go │ ├── exec.go │ ├── exec_test.go │ ├── fix_coordinator_ips.go │ ├── fix_coordinator_ips_test.go │ ├── get.go │ ├── k8s_client.go │ ├── k8s_client_test.go │ ├── plugin_version_checker.go │ ├── recover_multi_region_cluster.go │ ├── recover_multi_region_cluster_test.go │ ├── remove.go │ ├── remove_process_group.go │ ├── remove_process_group_test.go │ ├── restart.go │ ├── restart_test.go │ ├── root.go │ ├── root_test.go │ ├── suite_test.go │ ├── update.go │ ├── update_connection_string.go │ ├── update_connection_string_test.go │ ├── version.go │ └── version_test.go └── main.go ├── logs └── .gitignore ├── main.go ├── mock-kubernetes-client └── client │ ├── client.go │ ├── client_test.go │ ├── doc.go │ └── suite_test.go ├── pkg ├── fdbadminclient │ ├── admin_client.go │ ├── database_provider.go │ ├── lock_client.go │ └── mock │ │ ├── admin_client_mock.go │ │ ├── admin_client_mock_test.go │ │ ├── database_provider.go │ │ ├── lock_client.go │ │ ├── lock_client_test.go │ │ └── suite_test.go ├── fdbstatus │ ├── fdb_status_helper.go │ ├── fdb_status_helper_test.go │ ├── status_checks.go │ ├── status_checks_test.go │ └── suite_test.go ├── podclient │ ├── mock │ │ └── pod_client.go │ └── pod_client.go └── podmanager │ ├── fdb_process_group.go │ ├── pod_lifecycle_manager.go │ ├── pod_lifecycle_manager_test.go │ └── suite_test.go ├── sample-apps └── data-loader │ ├── Dockerfile │ ├── app.py │ └── job.yaml ├── scripts ├── .gitignore ├── cluster1.yml ├── cluster2.yml ├── cluster3.yml ├── cluster4.yml ├── setup_container.sh ├── setup_e2e.sh └── update_changelog.py └── setup ├── setup.go ├── setup_test.go └── suite_test.go /.dockerignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/c02323519ea3466aca46500e894e6531da64acc5/.dockerignore -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Support Request 4 | url: https://forums.foundationdb.org/c/using-foundationdb/kubernetes-operator 5 | about: Support request or question relating to FDB Kubernetes operator 6 | - name: Security Report 7 | url: https://github.com/FoundationDB/fdb-kubernetes-operator/blob/main/CONTRIBUTING.md#security-issues 8 | about: Reports about security issues for the FDB Kubernetes operator. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.yml: -------------------------------------------------------------------------------- 1 | name: Enhancement Tracking Issue 2 | description: Provide supporting details for a feature in development 3 | labels: enhancement 4 | body: 5 | - type: textarea 6 | id: feature 7 | attributes: 8 | label: What would you like to be added/changed? 9 | description: | 10 | Check if the requested feature has already a design document in https://github.com/FoundationDB/fdb-kubernetes-operator/tree/main/docs/design. 11 | For larger changes consider to create and file a PR with design document and the details about the changes. 12 | Please also add some additional context and let us know why this feature is required and should be implemented. 13 | validations: 14 | required: true 15 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | *Please include a summary of the change and which issue is addressed. If this change resolves an issue, please include the issue number in the description.* 4 | 5 | ## Type of change 6 | 7 | *Please select one of the options below.* 8 | 9 | - Bug fix (non-breaking change which fixes an issue) 10 | - New feature (non-breaking change which adds functionality) 11 | - Breaking change (fix or feature that would cause existing functionality to not work as expected) 12 | - Documentation 13 | - Other 14 | 15 | ## Discussion 16 | 17 | *Are there any design details that you would like to discuss further?* 18 | 19 | ## Testing 20 | 21 | *Please describe the tests that you ran to verify your changes. Unit tests? 22 | Manual testing?* 23 | 24 | *Do we need to perform additional testing once this is merged, or perform in a larger testing environment?* 25 | 26 | ## Documentation 27 | 28 | *Did you update relevant documentation within this repository?* 29 | 30 | *If this change is adding new functionality, do we need to describe it in our user manual?* 31 | 32 | *If this change is adding or removing subreconcilers, have we updated the core technical design doc to reflect that?* 33 | 34 | *If this change is adding new safety checks or new potential failure modes, have we documented and how to debug potential issues?* 35 | 36 | ## Follow-up 37 | 38 | *Are there any follow-up issues that we should pursue in the future?* 39 | 40 | *Does this introduce new defaults that we should re-evaluate in the future?* 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Binaries for programs and plugins 3 | *.exe 4 | *.exe~ 5 | *.dll 6 | *.so 7 | *.dylib 8 | bin 9 | .DS_Store 10 | 11 | # Test binary, build with `go test -c` 12 | *.test 13 | 14 | # Output of the go coverage tool, specifically when used with LiteIDE 15 | *.out 16 | 17 | # Kubernetes Generated files - skip generated files, except for vendored files 18 | 19 | !vendor/**/zz_generated.* 20 | 21 | # editor and IDE paraphernalia 22 | .idea 23 | *.swp 24 | *.swo 25 | .vscode 26 | *~ 27 | .classpath 28 | .project 29 | .settings 30 | 31 | # binaries for sideloading 32 | foundationdb-kubernetes-sidecar/website 33 | 34 | # Customizable templates 35 | 36 | config/default/manager_image_patch.yaml 37 | config/default/manager_image_patch.yaml-e 38 | config/development/kustomization.yaml 39 | 40 | # General temp directory 41 | tmp/ 42 | 43 | dist/ 44 | 45 | # Ignore any temporary created kube config files 46 | *.kubeconfig 47 | 48 | # Used for testing locally build FDB library 49 | libfdb_c.so 50 | fdb-kubernetes-operator 51 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | before: 4 | hooks: 5 | - go mod tidy 6 | 7 | builds: 8 | - id: kubectl-fdb 9 | goos: 10 | - linux 11 | - windows 12 | - darwin 13 | main: ./kubectl-fdb 14 | binary: kubectl-fdb 15 | ldflags: 16 | - -s -w -X github.com/FoundationDB/fdb-kubernetes-operator/v2/kubectl-fdb/cmd.pluginVersion={{ .Version }} -X github.com/FoundationDB/fdb-kubernetes-operator/v2/kubectl-fdb/cmd.pluginBuildDate={{ .Date }} -X github.com/FoundationDB/fdb-kubernetes-operator/v2/kubectl-fdb/cmd.pluginBuildCommit={{ .Commit }} 17 | goarch: 18 | - amd64 19 | - arm64 20 | 21 | archives: 22 | - id: kubectl-fdb 23 | ids: 24 | - kubectl-fdb 25 | formats: [ "binary" ] 26 | name_template: "{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" 27 | 28 | changelog: 29 | disable: true 30 | 31 | checksum: 32 | name_template: 'checksums.txt' 33 | 34 | snapshot: 35 | version_template: "{{ incpatch .Version }}-next" 36 | -------------------------------------------------------------------------------- /PROJECT: -------------------------------------------------------------------------------- 1 | domain: foundationdb.org 2 | repo: github.com/FoundationDB/fdb-kubernetes-operator 3 | resources: 4 | - group: apps 5 | kind: FoundationDBCluster 6 | version: v1beta1 7 | - group: apps 8 | kind: FoundationDBRestore 9 | version: v1beta1 10 | - group: apps 11 | kind: FoundationDBBackup 12 | version: v1beta1 13 | - group: apps 14 | kind: FoundationDBCluster 15 | version: v1beta2 16 | - group: apps 17 | kind: FoundationDBRestore 18 | version: v1beta2 19 | - group: apps 20 | kind: FoundationDBBackup 21 | version: v1beta2 22 | version: "2" 23 | -------------------------------------------------------------------------------- /api/v1beta2/foundationdb_errors.go: -------------------------------------------------------------------------------- 1 | /* 2 | * foundationdb_errors.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2022 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package v1beta2 22 | 23 | import "fmt" 24 | 25 | // TimeoutError represents a timeout for either the fdb client library or fdbcli 26 | // +k8s:deepcopy-gen=false 27 | type TimeoutError struct { 28 | Err error 29 | } 30 | 31 | // Error returns the error message of the internal timeout error. 32 | func (timeoutErr TimeoutError) Error() string { 33 | return fmt.Sprintf("fdb timeout: %s", timeoutErr.Err.Error()) 34 | } 35 | -------------------------------------------------------------------------------- /api/v1beta2/groupversion_info.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020-2022 FoundationDB project authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package v1beta2 contains API Schema definitions for the apps v1beta2 API group 18 | // +kubebuilder:object:generate=true 19 | // +groupName=apps.foundationdb.org 20 | package v1beta2 21 | 22 | import ( 23 | "k8s.io/apimachinery/pkg/runtime/schema" 24 | "sigs.k8s.io/controller-runtime/pkg/scheme" 25 | ) 26 | 27 | var ( 28 | // GroupVersion is group version used to register these objects 29 | GroupVersion = schema.GroupVersion{Group: "apps.foundationdb.org", Version: "v1beta2"} 30 | 31 | // SchemeBuilder is used to add go types to the GroupVersionKind scheme 32 | SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 33 | 34 | // AddToScheme adds the types in this group-version to the given scheme. 35 | AddToScheme = SchemeBuilder.AddToScheme 36 | ) 37 | -------------------------------------------------------------------------------- /api/v1beta2/none.go: -------------------------------------------------------------------------------- 1 | /* 2 | * none.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package v1beta2 22 | 23 | // None is a simple struct to create a set to indicate the value of the map 24 | // has no meaning. 25 | type None struct{} 26 | -------------------------------------------------------------------------------- /api/v1beta2/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2022 FoundationDB project authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1beta2 18 | 19 | import ( 20 | "testing" 21 | 22 | . "github.com/onsi/ginkgo/v2" 23 | . "github.com/onsi/gomega" 24 | ) 25 | 26 | func TestCmd(t *testing.T) { 27 | RegisterFailHandler(Fail) 28 | RunSpecs(t, "FDB v1beta2 API") 29 | } 30 | -------------------------------------------------------------------------------- /api/v1beta2/testdata/fdbbackup_status_6_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "SchemaVersion": "1.0.0", 3 | "BackupAgentsPaused": false, 4 | "Tag": "default", 5 | "UID": "3874300eea1e154e4079530b381f71c3", 6 | "Status": { 7 | "Name": "Running", 8 | "Description": "has been started", 9 | "Completed": false, 10 | "Running": true 11 | }, 12 | "Restorable": false, 13 | "DestinationURL": "blobstore://minio@minio-service:9000/sample-cluster?bucket=fdb-backups", 14 | "StopAfterSnapshot": false, 15 | "SnapshotIntervalSeconds": 864000, 16 | "LogBytesWritten": 0, 17 | "RangeBytesWritten": 13, 18 | "LatestLogEnd": { 19 | "Version": 334508757, 20 | "EpochSeconds": 1588041700, 21 | "Timestamp": "2020/04/28.02:41:40+0000" 22 | }, 23 | "LatestSnapshotEnd": { 24 | "Version": 334573197, 25 | "EpochSeconds": 1588041700, 26 | "Timestamp": "2020/04/28.02:41:40+0000" 27 | }, 28 | "CurrentSnapshot": { 29 | "Begin": { 30 | "Version": 334642281, 31 | "EpochSeconds": 1588041701, 32 | "Timestamp": "2020/04/28.02:41:41+0000" 33 | }, 34 | "EndTarget": { 35 | "Version": 864334642281, 36 | "EpochSeconds": 1588905701, 37 | "Timestamp": "2020/05/08.02:41:41+0000" 38 | }, 39 | "IntervalSeconds": 864000, 40 | "ExpectedProgress": 0.00155186, 41 | "LastDispatch": { 42 | "Version": 334670373, 43 | "EpochSeconds": 1588041701, 44 | "Timestamp": "2020/04/28.02:41:41+0000", 45 | "ShardsBehind": 0 46 | } 47 | }, 48 | "Errors": [] 49 | } -------------------------------------------------------------------------------- /charts/fdb-operator/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: fdb-operator 3 | description: A Helm chart for foundationDB operator 4 | home: https://www.foundationdb.org/ 5 | sources: 6 | - https://github.com/FoundationDB/fdb-kubernetes-operator/tree/main/charts/fdb-operator 7 | # A chart can be either an 'application' or a 'library' chart. 8 | # 9 | # Application charts are a collection of templates that can be packaged into versioned archives 10 | # to be deployed. 11 | # 12 | # Library charts provide useful utilities or functions for the chart developer. They're included as 13 | # a dependency of application charts to inject those utilities and functions into the rendering 14 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 15 | type: application 16 | # This is the chart version. This version number should be incremented each time you make changes 17 | # to the chart and its templates, including the app version. 18 | version: 0.2.0 19 | # This is the version number of the application being deployed. This version number should be 20 | # incremented each time you make changes to the application. 21 | appVersion: v2.9.0 22 | maintainers: 23 | - name: "foundationdb-ci" 24 | -------------------------------------------------------------------------------- /charts/fdb-operator/crds/apps.foundationdb.org_foundationdbbackups.yaml: -------------------------------------------------------------------------------- 1 | ../../../config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml -------------------------------------------------------------------------------- /charts/fdb-operator/crds/apps.foundationdb.org_foundationdbclusters.yaml: -------------------------------------------------------------------------------- 1 | ../../../config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml -------------------------------------------------------------------------------- /charts/fdb-operator/crds/apps.foundationdb.org_foundationdbrestores.yaml: -------------------------------------------------------------------------------- 1 | ../../../config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml -------------------------------------------------------------------------------- /charts/fdb-operator/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | FoundationDB operator has been installed successfully. 2 | 3 | To see the logs of the operator you can use below command 4 | kubectl logs deployment/{{ include "fdb-operator.fullname" . }} -n {{ .Release.Namespace }} -f 5 | 6 | Thanks for trying out FoundationDB helm chart. 7 | -------------------------------------------------------------------------------- /charts/fdb-operator/templates/rbac/rbac_role_binding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | {{- if .Values.globalMode.enabled }} 4 | kind: ClusterRoleBinding 5 | {{- else }} 6 | kind: RoleBinding 7 | {{- end }} 8 | metadata: 9 | name: {{ include "fdb-operator.fullname" . }} 10 | labels: 11 | {{- include "fdb-operator.labels" . | nindent 4 }} 12 | roleRef: 13 | apiGroup: rbac.authorization.k8s.io 14 | {{- if .Values.globalMode.enabled }} 15 | kind: ClusterRole 16 | {{- else }} 17 | kind: Role 18 | {{- end }} 19 | name: {{ include "fdb-operator.fullname" . }} 20 | subjects: 21 | - kind: ServiceAccount 22 | name: {{ include "fdb-operator.serviceAccountName" . }} 23 | {{- if .Values.globalMode.enabled }} 24 | namespace: {{ .Release.Namespace }} 25 | {{- end }} 26 | {{- if .Values.nodeReadClusterRole }} 27 | --- 28 | apiVersion: rbac.authorization.k8s.io/v1 29 | kind: ClusterRoleBinding 30 | metadata: 31 | name: {{ include "fdb-operator.fullname" . }}-clusterrolebinding 32 | labels: 33 | {{- include "fdb-operator.labels" . | nindent 4 }} 34 | roleRef: 35 | apiGroup: rbac.authorization.k8s.io 36 | kind: ClusterRole 37 | name: {{ include "fdb-operator.fullname" . }}-clusterrole 38 | subjects: 39 | - kind: ServiceAccount 40 | name: {{ include "fdb-operator.serviceAccountName" . }} 41 | {{- if .Values.globalMode.enabled }} 42 | namespace: {{ .Release.Namespace }} 43 | {{- end }} 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /charts/fdb-operator/templates/rbac/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | {{- if .Values.serviceAccount.create }} 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: {{ include "fdb-operator.serviceAccountName" . }} 7 | labels: 8 | {{- include "fdb-operator.labels" . | nindent 4 }} 9 | {{- with .Values.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- with .Values.serviceAccount.imagePullSecrets }} 14 | imagePullSecrets: 15 | {{- toYaml . | nindent 2 }} 16 | {{- end }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /charts/fdb-operator/values.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | image: 3 | repository: foundationdb/fdb-kubernetes-operator 4 | tag: v2.9.0 5 | pullPolicy: IfNotPresent 6 | initContainers: 7 | 7.1: 8 | image: 9 | repository: foundationdb/fdb-kubernetes-monitor 10 | tag: 7.1.67 11 | pullPolicy: IfNotPresent 12 | 7.3: 13 | image: 14 | repository: foundationdb/fdb-kubernetes-monitor 15 | tag: 7.3.63 16 | pullPolicy: IfNotPresent 17 | 7.4: 18 | image: 19 | repository: foundationdb/fdb-kubernetes-monitor 20 | tag: 7.4.1 21 | pullPolicy: IfNotPresent 22 | globalMode: 23 | enabled: false 24 | replicas: null 25 | imagePullSecrets: [] 26 | annotations: {} 27 | podAnnotations: {} 28 | podLabels: {} 29 | serviceAccount: 30 | create: true 31 | name: null 32 | imagePullSecrets: [] 33 | annotations: {} 34 | priorityClassName: null 35 | securityContext: 36 | runAsUser: 4059 37 | runAsGroup: 4059 38 | fsGroup: 4059 39 | containerSecurityContext: 40 | allowPrivilegeEscalation: false 41 | privileged: false 42 | capabilities: 43 | drop: 44 | - all 45 | readOnlyRootFilesystem: true 46 | nodeSelector: {} 47 | affinity: {} 48 | tolerations: {} 49 | resources: 50 | limits: 51 | cpu: 500m 52 | memory: 256Mi 53 | requests: 54 | cpu: 500m 55 | memory: 256Mi 56 | initContainersResources: 57 | limits: 58 | cpu: 10m 59 | memory: 50Mi 60 | requests: 61 | cpu: 10m 62 | memory: 50Mi 63 | initContainerSecurityContext: 64 | allowPrivilegeEscalation: false 65 | privileged: false 66 | capabilities: 67 | drop: 68 | - all 69 | readOnlyRootFilesystem: true 70 | nodeReadClusterRole: true 71 | -------------------------------------------------------------------------------- /cmd/po-docgen/doc.go: -------------------------------------------------------------------------------- 1 | // This is adapted from the po-docgen tool from the 2 | // Prometheus Operator project: 3 | // https://github.com/coreos/prometheus-operator 4 | 5 | package main 6 | -------------------------------------------------------------------------------- /cmd/po-docgen/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The prometheus-operator Authors and the FoundationDB project authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package main 16 | 17 | import ( 18 | "os" 19 | ) 20 | 21 | func main() { 22 | switch os.Args[1] { 23 | case "api": 24 | printAPIDocs(os.Args[2:]) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /config/blobstore/credentials.yaml: -------------------------------------------------------------------------------- 1 | # Those credentials are only intended for testing. 2 | --- 3 | apiVersion: v1 4 | kind: Secret 5 | metadata: 6 | name: backup-credentials 7 | type: Opaque 8 | stringData: 9 | credentials: | 10 | { 11 | "accounts": { 12 | "seaweedfs@seaweedfs": { 13 | "secret" : "tot4llys3cure" 14 | }, 15 | "seaweedfs@seaweedfs:8333": { 16 | "secret" : "tot4llys3cure" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /config/blobstore/kustomization.yaml: -------------------------------------------------------------------------------- 1 | kind: Kustomization 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | resources: 4 | - credentials.yaml 5 | - seaweedfs.yaml 6 | -------------------------------------------------------------------------------- /config/certmanager/certificate.yaml: -------------------------------------------------------------------------------- 1 | # The following manifests contain a self-signed issuer CR and a certificate CR. 2 | # More document can be found at https://docs.cert-manager.io 3 | # WARNING: Targets CertManager 0.11 check https://docs.cert-manager.io/en/latest/tasks/upgrading/index.html for breaking changes 4 | apiVersion: cert-manager.io/v1alpha2 5 | kind: Issuer 6 | metadata: 7 | name: selfsigned-issuer 8 | namespace: system 9 | spec: 10 | selfSigned: {} 11 | --- 12 | apiVersion: cert-manager.io/v1alpha2 13 | kind: Certificate 14 | metadata: 15 | name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml 16 | namespace: system 17 | spec: 18 | # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize 19 | dnsNames: 20 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc 21 | - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local 22 | issuerRef: 23 | kind: Issuer 24 | name: selfsigned-issuer 25 | secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize 26 | -------------------------------------------------------------------------------- /config/certmanager/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - certificate.yaml 3 | 4 | configurations: 5 | - kustomizeconfig.yaml 6 | -------------------------------------------------------------------------------- /config/certmanager/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This configuration is for teaching kustomize how to update name ref and var substitution 2 | nameReference: 3 | - kind: Issuer 4 | group: cert-manager.io 5 | fieldSpecs: 6 | - kind: Certificate 7 | group: cert-manager.io 8 | path: spec/issuerRef/name 9 | 10 | varReference: 11 | - kind: Certificate 12 | group: cert-manager.io 13 | path: spec/commonName 14 | - kind: Certificate 15 | group: cert-manager.io 16 | path: spec/dnsNames 17 | -------------------------------------------------------------------------------- /config/crd/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This kustomization.yaml is not intended to be run by itself, 2 | # since it depends on service name and namespace that are out of this kustomize package. 3 | # It should be run by config/default 4 | resources: 5 | - bases/apps.foundationdb.org_foundationdbclusters.yaml 6 | - bases/apps.foundationdb.org_foundationdbbackups.yaml 7 | - bases/apps.foundationdb.org_foundationdbrestores.yaml 8 | # +kubebuilder:scaffold:crdkustomizeresource 9 | 10 | patchesStrategicMerge: 11 | # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. 12 | # patches here are for enabling the conversion webhook for each CRD 13 | #- patches/webhook_in_foundationdbclusters.yaml 14 | #- patches/webhook_in_foundationdbrestores.yaml 15 | #- patches/webhook_in_foundationdbbackups.yaml 16 | # +kubebuilder:scaffold:crdkustomizewebhookpatch 17 | 18 | # [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix. 19 | # patches here are for enabling the CA injection for each CRD 20 | #- patches/cainjection_in_foundationdbclusters.yaml 21 | #- patches/cainjection_in_foundationdbrestores.yaml 22 | #- patches/cainjection_in_foundationdbbackups.yaml 23 | # +kubebuilder:scaffold:crdkustomizecainjectionpatch 24 | 25 | # the following config is for teaching kustomize how to do kustomization for CRDs. 26 | configurations: 27 | - kustomizeconfig.yaml 28 | -------------------------------------------------------------------------------- /config/crd/kustomizeconfig.yaml: -------------------------------------------------------------------------------- 1 | # This file is for teaching kustomize how to substitute name and namespace reference in CRD 2 | nameReference: 3 | - kind: Service 4 | version: v1 5 | fieldSpecs: 6 | - kind: CustomResourceDefinition 7 | group: apiextensions.k8s.io 8 | path: spec/conversion/webhookClientConfig/service/name 9 | 10 | namespace: 11 | - kind: CustomResourceDefinition 12 | group: apiextensions.k8s.io 13 | path: spec/conversion/webhookClientConfig/service/namespace 14 | create: false 15 | 16 | varReference: 17 | - path: metadata/annotations 18 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_foundationdbbackups.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | annotations: 7 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 8 | name: foundationdbbackups.apps.foundationdb.org 9 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_foundationdbclusters.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | annotations: 7 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 8 | name: foundationdbclusters.apps.foundationdb.org 9 | -------------------------------------------------------------------------------- /config/crd/patches/cainjection_in_foundationdbrestores.yaml: -------------------------------------------------------------------------------- 1 | # The following patch adds a directive for certmanager to inject CA into the CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | annotations: 7 | cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) 8 | name: foundationdbrestores.apps.foundationdb.org 9 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_foundationdbbackups.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables conversion webhook for CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | name: foundationdbbackups.apps.foundationdb.org 7 | spec: 8 | conversion: 9 | strategy: Webhook 10 | webhookClientConfig: 11 | # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, 12 | # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) 13 | caBundle: Cg== 14 | service: 15 | namespace: system 16 | name: webhook-service 17 | path: /convert 18 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_foundationdbclusters.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables conversion webhook for CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | name: foundationdbclusters.apps.foundationdb.org 7 | spec: 8 | conversion: 9 | strategy: Webhook 10 | webhookClientConfig: 11 | # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, 12 | # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) 13 | caBundle: Cg== 14 | service: 15 | namespace: system 16 | name: webhook-service 17 | path: /convert 18 | -------------------------------------------------------------------------------- /config/crd/patches/webhook_in_foundationdbrestores.yaml: -------------------------------------------------------------------------------- 1 | # The following patch enables conversion webhook for CRD 2 | # CRD conversion requires k8s 1.13 or later. 3 | apiVersion: apiextensions.k8s.io/v1beta1 4 | kind: CustomResourceDefinition 5 | metadata: 6 | name: foundationdbrestores.apps.foundationdb.org 7 | spec: 8 | conversion: 9 | strategy: Webhook 10 | webhookClientConfig: 11 | # this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank, 12 | # but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager) 13 | caBundle: Cg== 14 | service: 15 | namespace: system 16 | name: webhook-service 17 | path: /convert 18 | -------------------------------------------------------------------------------- /config/deployment/kustomization.yaml: -------------------------------------------------------------------------------- 1 | kind: Kustomization 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | # Adds namespace to all resources. 4 | 5 | # Value of this field is prepended to the 6 | # names of all resources, e.g. a deployment named 7 | # "wordpress" becomes "alices-wordpress". 8 | # Note that it should also match with the prefix (text before '-') of the namespace 9 | # field above. 10 | namePrefix: fdb-kubernetes-operator- 11 | 12 | # Each entry in this list must resolve to an existing 13 | # resource definition in YAML. These are the resource 14 | # files that kustomize reads, modifies and emits as a 15 | # YAML string, with resources separated by document 16 | # markers ("---"). 17 | resources: 18 | - ../rbac 19 | - rbac_role_binding.yaml 20 | - manager.yaml 21 | -------------------------------------------------------------------------------- /config/deployment/rbac_role_binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | creationTimestamp: null 5 | name: manager-rolebinding 6 | roleRef: 7 | apiGroup: rbac.authorization.k8s.io 8 | kind: ClusterRole 9 | name: fdb-kubernetes-operator-manager-role 10 | subjects: 11 | - kind: ServiceAccount 12 | name: fdb-kubernetes-operator-controller-manager 13 | --- 14 | apiVersion: rbac.authorization.k8s.io/v1 15 | kind: ClusterRoleBinding 16 | metadata: 17 | creationTimestamp: null 18 | name: manager-clusterrolebinding 19 | roleRef: 20 | apiGroup: rbac.authorization.k8s.io 21 | kind: ClusterRole 22 | name: fdb-kubernetes-operator-manager-clusterrole 23 | subjects: 24 | - kind: ServiceAccount 25 | name: fdb-kubernetes-operator-controller-manager 26 | namespace: metadata.namespace 27 | 28 | -------------------------------------------------------------------------------- /config/development/backup_credentials.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: manager 10 | env: 11 | - name: FDB_BLOB_CREDENTIALS 12 | value: "/tmp/fdb-backup-credentials/credentials" 13 | volumeMounts: 14 | - mountPath: /tmp/fdb-backup-credentials 15 | name: fdb-backup-credentials 16 | readOnly: true 17 | volumes: 18 | - name: fdb-backup-credentials 19 | secret: 20 | secretName: backup-credentials 21 | -------------------------------------------------------------------------------- /config/development/debug_logs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: manager 10 | imagePullPolicy: Never 11 | args: 12 | - --zap-log-level=debug 13 | -------------------------------------------------------------------------------- /config/development/kustomization.yaml.sample: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | patchesStrategicMerge: 5 | - test_certs.yaml 6 | # - backup_credentials.yaml 7 | - debug_logs.yaml 8 | 9 | resources: 10 | - ../deployment 11 | # Enable if you want to test the backup setup. 12 | # - ../blobstore 13 | 14 | images: 15 | - name: foundationdb/fdb-kubernetes-operator 16 | newName: fdb-kubernetes-operator 17 | newTag: latest 18 | -------------------------------------------------------------------------------- /config/development/remote_build.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: manager 10 | imagePullPolicy: Always 11 | -------------------------------------------------------------------------------- /config/development/test_certs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: controller-manager 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: manager 10 | env: 11 | - name: DISABLE_SIDECAR_TLS_CHECK 12 | value: "1" 13 | - name: FDB_TLS_CERTIFICATE_FILE 14 | value: /tmp/fdb-certs/tls.crt 15 | - name: FDB_TLS_CA_FILE 16 | value: /tmp/fdb-certs/tls.crt 17 | - name: FDB_TLS_KEY_FILE 18 | value: /tmp/fdb-certs/tls.key 19 | volumeMounts: 20 | - mountPath: /tmp/fdb-certs 21 | name: fdb-certs 22 | readOnly: true 23 | volumes: 24 | - name: fdb-certs 25 | secret: 26 | secretName: fdb-kubernetes-operator-secrets -------------------------------------------------------------------------------- /config/rbac/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | creationTimestamp: null 6 | name: manager-clusterrole 7 | rules: 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - nodes 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | -------------------------------------------------------------------------------- /config/rbac/kustomization.yaml: -------------------------------------------------------------------------------- 1 | kind: Kustomization 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | resources: 4 | - role.yaml 5 | - cluster_role.yaml 6 | -------------------------------------------------------------------------------- /config/rbac/role.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | kind: ClusterRole 4 | metadata: 5 | name: manager-role 6 | rules: 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - configmaps 11 | - events 12 | - persistentvolumeclaims 13 | - pods 14 | - secrets 15 | - services 16 | verbs: 17 | - create 18 | - delete 19 | - get 20 | - list 21 | - patch 22 | - update 23 | - watch 24 | - apiGroups: 25 | - apps 26 | resources: 27 | - deployments 28 | verbs: 29 | - create 30 | - delete 31 | - get 32 | - list 33 | - patch 34 | - update 35 | - watch 36 | - apiGroups: 37 | - apps.foundationdb.org 38 | resources: 39 | - foundationdbbackups 40 | - foundationdbclusters 41 | - foundationdbrestores 42 | verbs: 43 | - create 44 | - delete 45 | - get 46 | - list 47 | - patch 48 | - update 49 | - watch 50 | - apiGroups: 51 | - apps.foundationdb.org 52 | resources: 53 | - foundationdbbackups/status 54 | - foundationdbclusters/status 55 | - foundationdbrestores/status 56 | verbs: 57 | - get 58 | - patch 59 | - update 60 | - apiGroups: 61 | - coordination.k8s.io 62 | resources: 63 | - leases 64 | verbs: 65 | - create 66 | - delete 67 | - get 68 | - list 69 | - patch 70 | - update 71 | - watch 72 | -------------------------------------------------------------------------------- /config/samples/Readme.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | 3 | This folder contains some samples on how to use the FoundationDB operator. 4 | All files except for `pod_disruption_budget.yaml` are automatically generated from the [config/tests](../tests) folder. 5 | If you want to change the base files, do the changes in the `config/tests` folder and then run `make samples`. 6 | You can find some additional examples under `config/tests`. 7 | -------------------------------------------------------------------------------- /config/samples/pod_disruption_budget.yaml: -------------------------------------------------------------------------------- 1 | # Kubernetes won't deliberately cause an interruption to a ready storage pod if 2 | # that would drop the ready count below 5. 3 | apiVersion: policy/v1 4 | kind: PodDisruptionBudget 5 | metadata: 6 | name: sample-cluster-storage 7 | namespace: default 8 | spec: 9 | minAvailable: 5 10 | selector: 11 | matchLabels: 12 | fdb-cluster-name: sample-cluster 13 | fdb-process-class: storage 14 | --- 15 | apiVersion: policy/v1 16 | kind: PodDisruptionBudget 17 | metadata: 18 | name: sample-cluster-log 19 | namespace: default 20 | spec: 21 | minAvailable: 3 22 | selector: 23 | matchLabels: 24 | fdb-cluster-name: sample-cluster 25 | fdb-process-class: log 26 | --- 27 | apiVersion: policy/v1 28 | kind: PodDisruptionBudget 29 | metadata: 30 | name: sample-cluster-transaction 31 | namespace: default 32 | spec: 33 | minAvailable: 3 34 | selector: 35 | matchLabels: 36 | fdb-cluster-name: sample-cluster 37 | fdb-process-class: transaction 38 | -------------------------------------------------------------------------------- /config/test-certs/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEwzCCAqugAwIBAgIJALSgFIERepa2MA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV 3 | BAMMCWxvY2FsaG9zdDAeFw0yNDA5MjUwODMyMDhaFw0yNTA5MjUwODMyMDhaMBQx 4 | EjAQBgNVBAMMCWxvY2FsaG9zdDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC 5 | ggIBAMN/lR/FKEL9ETz45IE2C8f1JuU73boT5fBHquj5+wDYtu2HU/tgcXOSNGNI 6 | biM0cvKe1OkMQhOVh7JRsiqxzpF7zE/d9Fpio4cP75Fbdw/LlafLCbAXDTzQPMsm 7 | 6t8RaTj51mkRX3TkgwEiMTWKtKXmwzb7TcEeYY7vNWYhAS7tNkekzZEQl0/+TcSj 8 | kZCm9ePBS6aSJu3HRIJ2cu49ZVMFza4/xlsN3WN/fNLsF5Qie9Vp60AB9TxdEgDt 9 | GO6YfbN5GDfRo/vdA1ocHR1JczjrQzRmW+6TegeSDj0Xp/atXNO7qXNgRFxKENVk 10 | IsZ5RfJoHi9tv0EcmEK+ifVIWGfppKDVdUw03guXpYYmJPJF7+MJzoCMWO3U6uex 11 | I5vje+9J7H4852arKcnnNHncV3EvKQtpMRDs77ymsjS/uZhtpjUZPuORtryizzkw 12 | P7WHuS+riRPmRVdkY3YNFEkncDIIDN76XZXYOns6LY6yx18AiOhkiV2843miMZAT 13 | DovQ/TMbC+Jh8ryNAzd/uSq7mwWEzWce6yFOvjkIHfL+71huRnwrrm+3uIbJpziB 14 | YLAfLnRaiJ2urvzaizdscO2uRlzlmxckDbcfVm62Ma3dWtCBIv7Wjp8+/++hgSym 15 | RppwwQIATWGlAOhtw3jM3w0B2eg6/8sMyP5Q0Vt18c4vkD1dAgMBAAGjGDAWMBQG 16 | A1UdEQQNMAuCCXNlYXdlZWRmczANBgkqhkiG9w0BAQsFAAOCAgEAqGH2WPkJJ+lO 17 | h+T8Q6Q7xhr+i/wl6Y8JGUn5EoAJNyNzfDiUcCKnsvezaSZQ8z2H5hYx9A89taiZ 18 | 8zLM+xST2eDdGUOrIiFnNCkW0kW00P329Gt2UTiMw5fbRjtsTi6d8BsUmQEnQFES 19 | AIND9QnZ0hJSX8SrmQyCrIiuzVyxQ4LdaS9nOSPvqk2w3/a7tY+YhLFavvtumcsR 20 | UWrMtyJ1sKQxb3PbU6lTf8uCHCPIotrNno+BPO9pmDlPGGl4W/KO8DAHR7nwcS48 21 | Z4Tq+AcfMYREWMICwUG6V05vPuqbUzRYzF3hqxXKEmC+DJnNtOqLx2UfdEX5eDxR 22 | N/FQ2rBKwPyKbN8c8u6TGtC1vjwh2hLyu2F2+VzlX4HEGzyZFOi7Zz3x0CfNjCao 23 | a4CbUuI0FhCTEBVwJerBOWsuud82JkSSWw/1u+BlfrmkbbRBzgN9Y6z6MeepyCB2 24 | lEufoIg294R6lJWkKtGNwo9YH9mDXgwmFSiVBGEHNTfyrvzecR1QXWiO7swIZeLL 25 | DQi9IGrSOVzX/xZ88RxTEmcMj/Qg9LPKkRrMd0MD/zbL9ILp+js9I5a4YTDDsMVC 26 | JJkXu2o+fBm8bwLBiKktG8Zj4os9XQkxvZfXL97ZbM7G72A43xJ0NffoXPui6Kkk 27 | JjQiteZZOGGEpBiG8xqta5lZVL7+gGo= 28 | -----END CERTIFICATE----- 29 | -------------------------------------------------------------------------------- /config/test-certs/generate_cert.bash: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # generate_cert.bash 4 | # 5 | # This source file is part of the FoundationDB open source project 6 | # 7 | # Copyright 2018-2024 Apple Inc. and the FoundationDB project authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | 22 | # This script generates a self-signed cert for local testing. 23 | # The cert will be stored in the repository, so you do not need to run this 24 | # yourself unless the certificate has expired. 25 | 26 | openssl req -x509 -newkey rsa:4096 -nodes -keyout config/test-certs/key.pem -out config/test-certs/cert.pem -days 365 -subj '/CN=localhost' -reqexts SAN -extensions SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:seaweedfs")) 27 | -------------------------------------------------------------------------------- /config/test-certs/generate_secrets.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | # generate_secrets.bash 6 | # 7 | # This source file is part of the FoundationDB open source project 8 | # 9 | # Copyright 2018-2024 Apple Inc. and the FoundationDB project authors 10 | # 11 | # Licensed under the Apache License, Version 2.0 (the "License"); 12 | # you may not use this file except in compliance with the License. 13 | # You may obtain a copy of the License at 14 | # 15 | # http://www.apache.org/licenses/LICENSE-2.0 16 | # 17 | # Unless required by applicable law or agreed to in writing, software 18 | # distributed under the License is distributed on an "AS IS" BASIS, 19 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | # See the License for the specific language governing permissions and 21 | # limitations under the License. 22 | # 23 | 24 | # This script generates secrets with test certs for use in local testing. 25 | SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) 26 | cd "${SCRIPT_DIR}" 27 | 28 | kubectl delete secrets -l app=fdb-kubernetes-operator 29 | kubectl create secret tls fdb-kubernetes-operator-secrets --key=${SCRIPT_DIR}/key.pem --cert=${SCRIPT_DIR}/cert.pem 30 | kubectl label secret fdb-kubernetes-operator-secrets app=fdb-kubernetes-operator 31 | -------------------------------------------------------------------------------- /config/tests/README.md: -------------------------------------------------------------------------------- 1 | This directory contains test cases for use in developing new features in the 2 | operator. These are not guaranteed to be representative of how you would run 3 | FoundationDB in a real environment. For basic examples of how to configure a 4 | real FoundationDB installation, see the [samples](/config/samples) directory. 5 | For more examples of how to customize a deployment, see the 6 | [user manual](/docs/user_manual.md). 7 | 8 | Most of these test cases are built using kustomize, and you can apply them by 9 | using kubectl. Example: `kubectl apply -k config/tests/base`. The `multi_kc` and 10 | `multi_dc` test cases have special test scripts to support a multi-stage 11 | creation process. Example: `bash config/tests/multi_dc/create.bash`. Those 12 | directories also contain `apply.bash` and `delete.bash` scripts. 13 | -------------------------------------------------------------------------------- /config/tests/backup/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - "../../base" 3 | resources: 4 | - backup.yaml 5 | -------------------------------------------------------------------------------- /config/tests/backup/restore/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - "../stopped" 3 | resources: 4 | - "restore.yaml" 5 | -------------------------------------------------------------------------------- /config/tests/backup/restore/restore.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps.foundationdb.org/v1beta2 2 | kind: FoundationDBRestore 3 | metadata: 4 | name: test-cluster 5 | spec: 6 | destinationClusterName: test-cluster 7 | blobStoreConfiguration: 8 | accountName: seaweedfs@seaweedfs:8333 9 | -------------------------------------------------------------------------------- /config/tests/backup/stopped/backup.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps.foundationdb.org/v1beta2 2 | kind: FoundationDBBackup 3 | metadata: 4 | name: test-cluster 5 | spec: 6 | backupState: Stopped 7 | -------------------------------------------------------------------------------- /config/tests/backup/stopped/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - "../base" 3 | patchesStrategicMerge: 4 | - backup.yaml 5 | -------------------------------------------------------------------------------- /config/tests/base/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This file provides a basic cluster designed for local testing of the operator. 2 | resources: 3 | - cluster.yaml 4 | -------------------------------------------------------------------------------- /config/tests/client/kustomization.yaml: -------------------------------------------------------------------------------- 1 | bases: 2 | - "../base" 3 | resources: 4 | - client.yaml 5 | -------------------------------------------------------------------------------- /config/tests/dns/dns.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: "/spec/routing/useDNSInClusterFile" 3 | value: true 4 | - op: remove 5 | path: "/spec/routing/defineDNSLocalityFields" 6 | -------------------------------------------------------------------------------- /config/tests/dns/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This file provides a test cluster using DNS names instead of IP addresses in 2 | # its cluster file. 3 | # 4 | # This test requires FDB 7.0, which has not been released yet, so in order to 5 | # run this test case you must update the image configs to specify a prerelease 6 | # image tag. 7 | bases: 8 | - "../base" 9 | patchesJson6902: 10 | - path: dns.yaml 11 | target: 12 | group: apps.foundationdb.org 13 | version: v1beta2 14 | kind: FoundationDBCluster 15 | name: test-cluster 16 | resources: 17 | - client.yaml 18 | -------------------------------------------------------------------------------- /config/tests/multi_dc/Readme.md: -------------------------------------------------------------------------------- 1 | # Multi DC example 2 | 3 | Ensure that you ran the `setup_e2e.sh` script and setup the environment variables for the clusters. 4 | This setup is currently meant to run manually. In the future this will be rewritten to be a real e2e test. 5 | 6 | ## Create the multi-dc cluster 7 | 8 | This will bringup a FDB cluster running across 3 different Kubernetes clusters in a multi-region configuration. 9 | 10 | ```bash 11 | ./create.bash 12 | ``` 13 | 14 | ## Delete 15 | 16 | This will remove all created resources: 17 | 18 | ```bash 19 | ./bash.bash 20 | ``` 21 | -------------------------------------------------------------------------------- /config/tests/multi_dc/create.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | # This directory provides an example of creating a cluster using the multi-KC 6 | # replication topology. 7 | # 8 | # This example is built for local testing, so it will create all of the pods 9 | # within a single KC, but will give false locality information for the zones 10 | # to make the processes believe they are in different locations. 11 | # 12 | # You can use this script to bootstrap the cluster. Once it finishes, you can 13 | # make changes to the cluster by editing the final.yaml file and running the 14 | # apply.bash script. You can clean up the clusters by running the delete.bash 15 | # script. 16 | DIR="${BASH_SOURCE%/*}" 17 | 18 | . $DIR/functions.bash 19 | 20 | # To test a multi-region FDB cluster setup we need to have 3 Kubernetes clusters 21 | cluster1=${CLUSTER1:-cluster1} 22 | cluster2=${CLUSTER2:-cluster2} 23 | cluster3=${CLUSTER3:-cluster3} 24 | 25 | # For all the clusters we have to create tha according kubeconfig 26 | kubeconfig1=${KUBECONFIG1:-"${cluster1}.kubeconfig"} 27 | kubeconfig2=${KUBECONFIG2:-"${cluster2}.kubeconfig"} 28 | kubeconfig3=${KUBECONFIG3:-"${cluster3}.kubeconfig"} 29 | 30 | applyFile "${DIR}/stage_1.yaml" dc1 '""' "${kubeconfig1}" 31 | checkReconciliationLoop test-cluster-dc1 "${kubeconfig1}" 32 | connectionString=$(getConnectionString test-cluster-dc1 "${kubeconfig1}") 33 | 34 | applyFile "${DIR}/final.yaml" dc1 "${connectionString}" "${kubeconfig1}" 35 | applyFile "${DIR}/final.yaml" dc2 "${connectionString}" "${kubeconfig2}" 36 | applyFile "${DIR}/final.yaml" dc3 "${connectionString}" "${kubeconfig3}" 37 | 38 | checkReconciliationLoop test-cluster-dc1 "${kubeconfig1}" 39 | checkReconciliationLoop test-cluster-dc2 "${kubeconfig2}" 40 | checkReconciliationLoop test-cluster-dc3 "${kubeconfig3}" 41 | -------------------------------------------------------------------------------- /config/tests/multi_dc/delete.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | # To test a multi-region FDB cluster setup we need to have 3 Kubernetes clusters 6 | cluster1=${CLUSTER1:-cluster1} 7 | cluster2=${CLUSTER2:-cluster2} 8 | cluster3=${CLUSTER3:-cluster3} 9 | 10 | # For all the clusters we have to create tha according kubeconfig 11 | kubeconfig1=${KUBECONFIG1:-"${cluster1}.kubeconfig"} 12 | kubeconfig2=${KUBECONFIG2:-"${cluster2}.kubeconfig"} 13 | kubeconfig3=${KUBECONFIG3:-"${cluster3}.kubeconfig"} 14 | 15 | kubectl --kubeconfig "${kubeconfig1}" delete fdb -l cluster-group=test-cluster 16 | kubectl --kubeconfig "${kubeconfig2}" delete fdb -l cluster-group=test-cluster 17 | kubectl --kubeconfig "${kubeconfig3}" delete fdb -l cluster-group=test-cluster 18 | -------------------------------------------------------------------------------- /config/tests/multi_dc/final.yaml: -------------------------------------------------------------------------------- 1 | # This file provides an example of a cluster you can run in a local testing 2 | # environment to create a simulation of a multi-DC cluster. 3 | # 4 | # This requires variables to be interpolated for $dc, $logCount, 5 | # and $connectionString 6 | apiVersion: apps.foundationdb.org/v1beta2 7 | kind: FoundationDBCluster 8 | metadata: 9 | labels: 10 | cluster-group: test-cluster 11 | name: test-cluster-$dc 12 | spec: 13 | imageType: split 14 | version: 7.1.26 15 | faultDomain: 16 | key: foundationdb.org/none 17 | processGroupIDPrefix: $dc 18 | dataCenter: $dc 19 | processCounts: 20 | stateless: -1 21 | log: $logCount 22 | seedConnectionString: $connectionString 23 | databaseConfiguration: 24 | redundancy_mode: "double" 25 | usable_regions: 2 26 | regions: 27 | - datacenters: 28 | - id: dc1 29 | priority: 1 30 | - id: dc3 31 | satellite: 1 32 | priority: 2 33 | - id: dc2 34 | satellite: 1 35 | priority: 1 36 | satellite_logs: 3 37 | - datacenters: 38 | - id: dc2 39 | priority: 0 40 | - id: dc3 41 | satellite: 1 42 | priority: 2 43 | - id: dc1 44 | satellite: 1 45 | priority: 1 46 | satellite_logs: 3 47 | processes: 48 | general: 49 | customParameters: 50 | - "knob_disable_posix_kernel_aio=1" 51 | volumeClaimTemplate: 52 | spec: 53 | resources: 54 | requests: 55 | storage: "16G" 56 | podTemplate: 57 | spec: 58 | containers: 59 | - name: foundationdb 60 | resources: 61 | requests: 62 | cpu: 250m 63 | memory: 128Mi 64 | -------------------------------------------------------------------------------- /config/tests/multi_dc/functions.bash: -------------------------------------------------------------------------------- 1 | function applyFile() { 2 | dc=${2} 3 | 4 | if [[ "${dc}" == "dc3" ]]; then 5 | logCount=0 6 | else 7 | logCount=-1 8 | fi 9 | 10 | dc="${dc}" connectionString="${3}" logCount="${logCount}" envsubst < "${1}"| kubectl --kubeconfig "${4}" apply -f - 11 | } 12 | 13 | function checkReconciliation() { 14 | clusterName=$1 15 | 16 | generationsOutput=$(kubectl --kubeconfig "${2}" get fdb "${clusterName}" -o jsonpath='{.metadata.generation} {.status.generations.reconciled}') 17 | read -ra generations <<< "${generationsOutput}" 18 | if [[ ("${#generations[@]}" -ge 2) && ("${generations[0]}" == "${generations[1]}") ]]; then 19 | return 1 20 | else 21 | echo "Latest generations for $clusterName: $generationsOutput" 22 | return 0 23 | fi 24 | } 25 | 26 | function getConnectionString() { 27 | kubectl --kubeconfig "${2}" get fdb "${1}" -o jsonpath='{.status.connectionString}' 28 | } 29 | 30 | function checkReconciliationLoop() { 31 | while checkReconciliation "${1}" "${2}"; do 32 | echo "Waiting for reconciliation" 33 | sleep 5 34 | done 35 | } 36 | -------------------------------------------------------------------------------- /config/tests/multi_dc/stage_1.yaml: -------------------------------------------------------------------------------- 1 | # This file provides an example of a cluster you can run in a local testing 2 | # environment to create a simulation of a multi-DC cluster. 3 | # 4 | # This requires variables to be interpolated for $dc, $logCount, 5 | # and $connectionString 6 | apiVersion: apps.foundationdb.org/v1beta2 7 | kind: FoundationDBCluster 8 | metadata: 9 | labels: 10 | cluster-group: test-cluster 11 | name: test-cluster-$dc 12 | spec: 13 | imageType: split 14 | version: 7.1.26 15 | faultDomain: 16 | key: foundationdb.org/none 17 | processGroupIDPrefix: $dc 18 | dataCenter: $dc 19 | processCounts: 20 | stateless: -1 21 | log: $logCount 22 | seedConnectionString: $connectionString 23 | databaseConfiguration: 24 | redundancy_mode: "double" 25 | usable_regions: 1 26 | regions: 27 | - datacenters: 28 | - id: $dc 29 | priority: 1 30 | processes: 31 | general: 32 | customParameters: 33 | - "knob_disable_posix_kernel_aio=1" 34 | volumeClaimTemplate: 35 | spec: 36 | resources: 37 | requests: 38 | storage: "16G" 39 | podTemplate: 40 | spec: 41 | containers: 42 | - name: foundationdb 43 | resources: 44 | requests: 45 | cpu: 250m 46 | memory: 128Mi 47 | -------------------------------------------------------------------------------- /config/tests/multi_kc/create.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | 5 | # This directory provides an example of creating a cluster using the multi-KC 6 | # replication topology. 7 | # 8 | # This example is built for local testing, so it will create all of the pods 9 | # within a single KC, but will give false locality information for the zones 10 | # to make the processes believe they are in different locations. 11 | # 12 | # You can use this script to bootstrap the cluster. Once it finishes, you can 13 | # make changes to the cluster by editing the final.yaml file and running the 14 | # apply.bash script. You can clean up the clusters by running the delete.bash 15 | # script. 16 | DIR="${BASH_SOURCE%/*}" 17 | 18 | . $DIR/functions.bash 19 | 20 | # To test a multi-region FDB cluster setup we need to have 3 Kubernetes clusters 21 | cluster1=${CLUSTER1:-cluster1} 22 | cluster2=${CLUSTER2:-cluster2} 23 | cluster3=${CLUSTER3:-cluster3} 24 | 25 | # For all the clusters we have to create tha according kubeconfig 26 | kubeconfig1=${KUBECONFIG1:-"${cluster1}.kubeconfig"} 27 | kubeconfig2=${KUBECONFIG2:-"${cluster2}.kubeconfig"} 28 | kubeconfig3=${KUBECONFIG3:-"${cluster3}.kubeconfig"} 29 | 30 | applyFile $DIR/stage_1.yaml dc1 '""' "${kubeconfig1}" 31 | checkReconciliationLoop test-cluster-dc1 "${kubeconfig1}" 32 | connectionString=$(getConnectionString test-cluster-dc1 "${kubeconfig1}") 33 | 34 | applyFile $DIR/final.yaml dc1 $connectionString "${kubeconfig1}" 35 | applyFile $DIR/final.yaml dc2 $connectionString "${kubeconfig2}" 36 | applyFile $DIR/final.yaml dc3 $connectionString "${kubeconfig3}" 37 | 38 | checkReconciliationLoop test-cluster-dc1 "${kubeconfig1}" 39 | checkReconciliationLoop test-cluster-dc2 "${kubeconfig2}" 40 | checkReconciliationLoop test-cluster-dc3 "${kubeconfig3}" 41 | -------------------------------------------------------------------------------- /config/tests/multi_kc/delete.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bine/env bash 2 | 3 | set -eu 4 | 5 | # To test a multi-region FDB cluster setup we need to have 3 Kubernetes clusters 6 | cluster1=${CLUSTER1:-cluster1} 7 | cluster2=${CLUSTER2:-cluster2} 8 | cluster3=${CLUSTER3:-cluster3} 9 | 10 | # For all the clusters we have to create tha according kubeconfig 11 | kubeconfig1=${KUBECONFIG1:-"${cluster1}.kubeconfig"} 12 | kubeconfig2=${KUBECONFIG2:-"${cluster2}.kubeconfig"} 13 | kubeconfig3=${KUBECONFIG3:-"${cluster3}.kubeconfig"} 14 | 15 | kubectl --kubeconfig "${kubeconfig1}" delete fdb -l cluster-group=test-cluster 16 | kubectl --kubeconfig "${kubeconfig2}" delete fdb -l cluster-group=test-cluster 17 | kubectl --kubeconfig "${kubeconfig3}" delete fdb -l cluster-group=test-cluster 18 | -------------------------------------------------------------------------------- /config/tests/multi_kc/final.yaml: -------------------------------------------------------------------------------- 1 | # This file provides an example of a cluster you can run in a local testing 2 | # environment to create a simulation of a multi-KC cluster. 3 | # 4 | # This requires variables to be interpolated for $zone, $zoneIndex, 5 | # and $connectionString. 6 | apiVersion: apps.foundationdb.org/v1beta2 7 | kind: FoundationDBCluster 8 | metadata: 9 | labels: 10 | cluster-group: test-cluster 11 | name: test-cluster-$zone 12 | spec: 13 | imageType: split 14 | version: 7.1.26 15 | faultDomain: 16 | key: foundationdb.org/kubernetes-cluster 17 | value: $zone 18 | zoneIndex: $zoneIndex 19 | zoneCount: 3 20 | processGroupIDPrefix: $zone 21 | processCounts: 22 | stateless: -1 23 | seedConnectionString: $connectionString 24 | databaseConfiguration: 25 | redundancy_mode: "double" 26 | processes: 27 | general: 28 | customParameters: 29 | - "knob_disable_posix_kernel_aio=1" 30 | volumeClaimTemplate: 31 | spec: 32 | resources: 33 | requests: 34 | storage: "16G" 35 | podTemplate: 36 | spec: 37 | containers: 38 | - name: foundationdb 39 | resources: 40 | requests: 41 | cpu: 250m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /config/tests/multi_kc/functions.bash: -------------------------------------------------------------------------------- 1 | function applyFile() { 2 | zone=$2 3 | zone="${zone}" zoneIndex="${zone:2:1}" connectionString="${3}" envsubst < "${1}" | kubectl --kubeconfig "${4}" apply -f - 4 | } 5 | 6 | function checkReconciliation() { 7 | clusterName=$1 8 | 9 | generationsOutput=$(kubectl --kubeconfig "${2}" get fdb "${clusterName}" -o jsonpath='{.metadata.generation} {.status.generations.reconciled}') 10 | read -ra generations <<< "${generationsOutput}" 11 | if [[ ("${#generations[@]}" -ge 2) && ("${generations[0]}" == "${generations[1]}") ]]; then 12 | return 1 13 | else 14 | echo "Latest generations for $clusterName: $generationsOutput" 15 | return 0 16 | fi 17 | } 18 | 19 | function getConnectionString() { 20 | kubectl --kubeconfig "${2}" get fdb "${1}" -o jsonpath='{.status.connectionString}' 21 | } 22 | 23 | function checkReconciliationLoop() { 24 | while checkReconciliation "${1}" "${2}"; do 25 | echo "Waiting for reconciliation" 26 | sleep 5 27 | done 28 | } 29 | -------------------------------------------------------------------------------- /config/tests/multi_kc/stage_1.yaml: -------------------------------------------------------------------------------- 1 | # This file provides an example of a cluster you can run in a local testing 2 | # environment to create a simulation of a multi-KC cluster. 3 | # 4 | # This requires variables to be interpolated for $zone, $zoneIndex, 5 | # and $connectionString. 6 | apiVersion: apps.foundationdb.org/v1beta2 7 | kind: FoundationDBCluster 8 | metadata: 9 | labels: 10 | cluster-group: test-cluster 11 | name: test-cluster-$zone 12 | spec: 13 | imageType: split 14 | version: 7.1.26 15 | faultDomain: 16 | key: foundationdb.org/kubernetes-cluster 17 | value: $zone 18 | zoneIndex: $zoneIndex 19 | zoneCount: 1 20 | processGroupIDPrefix: $zone 21 | processCounts: 22 | stateless: -1 23 | seedConnectionString: $connectionString 24 | databaseConfiguration: 25 | redundancy_mode: "single" 26 | processes: 27 | general: 28 | customParameters: 29 | - "knob_disable_posix_kernel_aio=1" 30 | volumeClaimTemplate: 31 | spec: 32 | resources: 33 | requests: 34 | storage: "16G" 35 | podTemplate: 36 | spec: 37 | containers: 38 | - name: foundationdb 39 | resources: 40 | requests: 41 | cpu: 250m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /config/tests/three_data_hall/Readme.md: -------------------------------------------------------------------------------- 1 | # Three-Data-hall example 2 | 3 | This example requires that your Kubernetes cluster has nodes which are labeled with `topology.kubernetes.io/zone`. 4 | The example requires at least 3 unique zones, those can be faked for testing, by adding the labels to a node. 5 | 6 | ## Create the RBAC settings 7 | 8 | This example uses the unified image to read data from the Kubernetes API and therefore we have to 9 | create the according RBAC setup. If you use a different namespace than the default namespace, you have 10 | to adjust the `fdb-kubernetes` `ClusterRoleBinding` to point to the right `ServiceAccount`. 11 | 12 | ```bash 13 | kubectl apply -f ./config/tests/three_data_hall/unified_image_role.yaml 14 | ``` 15 | 16 | 17 | ## Create the Three-Data-Hall cluster 18 | 19 | This will bring up the three data hall cluster managed by a single `FoundationDBCluster` resource: 20 | 21 | ```bash 22 | kubectl apply -f ./config/tests/three_data_hall/cluster.yaml 23 | ``` 24 | 25 | ## Delete 26 | 27 | This will remove all created resources: 28 | 29 | ```bash 30 | kubectl delete -f ./config/tests/three_data_hall/cluster.yaml 31 | ``` 32 | 33 | ## Migration to a Three-Data-Hall cluster 34 | 35 | See [Fault domains](../../../docs/manual/fault_domains.md) 36 | -------------------------------------------------------------------------------- /config/tests/three_data_hall/unified_image_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: fdb-kubernetes 5 | --- 6 | apiVersion: rbac.authorization.k8s.io/v1 7 | kind: Role 8 | metadata: 9 | name: fdb-kubernetes 10 | rules: 11 | - apiGroups: 12 | - "" 13 | resources: 14 | - "pods" 15 | verbs: 16 | - "get" 17 | - "watch" 18 | - "update" 19 | - "patch" 20 | - "list" 21 | --- 22 | apiVersion: rbac.authorization.k8s.io/v1 23 | kind: RoleBinding 24 | metadata: 25 | name: fdb-kubernetes 26 | roleRef: 27 | apiGroup: rbac.authorization.k8s.io 28 | kind: Role 29 | name: fdb-kubernetes 30 | subjects: 31 | - kind: ServiceAccount 32 | name: fdb-kubernetes 33 | --- 34 | apiVersion: rbac.authorization.k8s.io/v1 35 | kind: ClusterRole 36 | metadata: 37 | name: fdb-kubernetes 38 | rules: 39 | - apiGroups: 40 | - "" 41 | resources: 42 | - "nodes" 43 | verbs: 44 | - "get" 45 | - "watch" 46 | - "list" 47 | --- 48 | apiVersion: rbac.authorization.k8s.io/v1 49 | kind: ClusterRoleBinding 50 | metadata: 51 | name: fdb-kubernetes 52 | roleRef: 53 | apiGroup: rbac.authorization.k8s.io 54 | kind: ClusterRole 55 | name: fdb-kubernetes 56 | subjects: 57 | - kind: ServiceAccount 58 | name: fdb-kubernetes 59 | -------------------------------------------------------------------------------- /config/tests/tls/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This file provides a test cluster with TLS enabled. 2 | bases: 3 | - "../base" 4 | patchesJson6902: 5 | - path: tls.yaml 6 | target: 7 | group: apps.foundationdb.org 8 | version: v1beta2 9 | kind: FoundationDBCluster 10 | name: test-cluster 11 | -------------------------------------------------------------------------------- /config/tests/tls/tls.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: "/spec/processes/general/podTemplate/spec/volumes" 3 | value: 4 | - name: fdb-certs 5 | secret: 6 | secretName: fdb-kubernetes-operator-secrets 7 | - op: add 8 | path: "/spec/processes/general/podTemplate/spec/containers/0/env" 9 | value: 10 | - name: FDB_TLS_CERTIFICATE_FILE 11 | value: /tmp/fdb-certs/tls.crt 12 | - name: FDB_TLS_CA_FILE 13 | value: /tmp/fdb-certs/tls.crt 14 | - name: FDB_TLS_KEY_FILE 15 | value: /tmp/fdb-certs/tls.key 16 | - op: add 17 | path: "/spec/processes/general/podTemplate/spec/containers/0/volumeMounts" 18 | value: 19 | - name: fdb-certs 20 | mountPath: /tmp/fdb-certs 21 | - op: add 22 | path: "/spec/processes/general/podTemplate/spec/containers/1/env" 23 | value: 24 | - name: FDB_TLS_CERTIFICATE_FILE 25 | value: /tmp/fdb-certs/tls.crt 26 | - name: FDB_TLS_CA_FILE 27 | value: /tmp/fdb-certs/tls.crt 28 | - name: FDB_TLS_KEY_FILE 29 | value: /tmp/fdb-certs/tls.key 30 | - op: add 31 | path: "/spec/processes/general/podTemplate/spec/containers/1/volumeMounts" 32 | value: 33 | - name: fdb-certs 34 | mountPath: /tmp/fdb-certs 35 | - op: add 36 | path: "/spec/mainContainer" 37 | value: 38 | enableTls: true 39 | - op: add 40 | path: "/spec/sidecarContainer" 41 | value: 42 | enableTls: true 43 | -------------------------------------------------------------------------------- /config/tests/unified_image/images.yaml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: "/spec/imageType" 3 | value: unified 4 | - op: remove 5 | path: "/spec/processes/general/podTemplate/spec/initContainers/0" 6 | - op: add 7 | path: "/spec/processes/general/podTemplate/spec/serviceAccount" 8 | value: "fdb-kubernetes" 9 | -------------------------------------------------------------------------------- /config/tests/unified_image/kustomization.yaml: -------------------------------------------------------------------------------- 1 | # This file provides a test cluster with the unified image for the main 2 | # container and the sidecar. 3 | apiVersion: kustomize.config.k8s.io/v1beta1 4 | kind: Kustomization 5 | resources: 6 | - "../base" 7 | - "unified_image_role.yaml" 8 | patchesJson6902: 9 | - path: images.yaml 10 | target: 11 | group: apps.foundationdb.org 12 | version: v1beta2 13 | kind: FoundationDBCluster 14 | name: test-cluster 15 | -------------------------------------------------------------------------------- /config/tests/unified_image/unified_image_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: fdb-kubernetes 5 | --- 6 | apiVersion: rbac.authorization.k8s.io/v1 7 | kind: Role 8 | metadata: 9 | name: fdb-kubernetes 10 | rules: 11 | - apiGroups: 12 | - "" 13 | resources: 14 | - "pods" 15 | verbs: 16 | - "get" 17 | - "watch" 18 | - "update" 19 | - "patch" 20 | - "list" 21 | --- 22 | apiVersion: rbac.authorization.k8s.io/v1 23 | kind: RoleBinding 24 | metadata: 25 | name: fdb-kubernetes 26 | roleRef: 27 | apiGroup: rbac.authorization.k8s.io 28 | kind: Role 29 | name: fdb-kubernetes 30 | subjects: 31 | - kind: ServiceAccount 32 | name: fdb-kubernetes 33 | -------------------------------------------------------------------------------- /controllers/stop_backup.go: -------------------------------------------------------------------------------- 1 | /* 2 | * stop_backup.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2020-2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package controllers 22 | 23 | import ( 24 | "context" 25 | 26 | fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" 27 | ) 28 | 29 | // stopBackup provides a reconciliation step for stopping backup. 30 | type stopBackup struct { 31 | } 32 | 33 | // reconcile runs the reconciler's work. 34 | func (s stopBackup) reconcile( 35 | ctx context.Context, 36 | r *FoundationDBBackupReconciler, 37 | backup *fdbv1beta2.FoundationDBBackup, 38 | ) *requeue { 39 | if backup.ShouldRun() || backup.Status.BackupDetails == nil || 40 | !backup.Status.BackupDetails.Running { 41 | return nil 42 | } 43 | 44 | adminClient, err := r.adminClientForBackup(ctx, backup) 45 | if err != nil { 46 | return &requeue{curError: err} 47 | } 48 | defer func() { 49 | _ = adminClient.Close() 50 | }() 51 | 52 | err = adminClient.StopBackup(backup.BackupURL()) 53 | if err != nil { 54 | return &requeue{curError: err} 55 | } 56 | 57 | return nil 58 | } 59 | -------------------------------------------------------------------------------- /docs/FDB_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/c02323519ea3466aca46500e894e6531da64acc5/docs/FDB_logo.png -------------------------------------------------------------------------------- /docs/changelog/v0.27.1.md: -------------------------------------------------------------------------------- 1 | # v0.27.1 2 | 3 | * Prevent the operator from crashing on errors in lock acquisition. 4 | * Allow deleting other pods when we have a pod stuck in a Terminating state. -------------------------------------------------------------------------------- /docs/changelog/v0.28.0.md: -------------------------------------------------------------------------------- 1 | # v0.28.0 2 | 3 | * Add a flag to enable verbose logs. 4 | * Replace pods when changing node selectors. 5 | * Add an option to automatically replace failed processes. 6 | * Allow deleting pods when other pods are stuck in Terminating. 7 | * Refactor the creation of service, pods, and PVCs to be based around the 8 | process group status. 9 | * Enable leader election by default. 10 | * Use the FDB client to read the JSON status, rather than the CLI. 11 | * Automatically build and publish docker images for the operator. 12 | * Coordinate bounces across data centers when doing upgrades. -------------------------------------------------------------------------------- /docs/changelog/v0.29.0.md: -------------------------------------------------------------------------------- 1 | # v0.29.0 2 | 3 | * Fix #520: Public NotReady pods to pod cluster IPs. 4 | * Add test for kubectl rootcmd. 5 | * Prevent removing unknown labels in pods. 6 | * Allow removing instances by pod name. 7 | * Update controller-runtime and dependencies. 8 | * Add deny list to prevent specific instances of the operator from taking global operations. 9 | * Rename release job. 10 | * Add locks before removing pods or including instances. 11 | * Add python lint. 12 | * Update to golang 1.15.8. 13 | * Add evacuate command for plugin. 14 | -------------------------------------------------------------------------------- /docs/changelog/v0.30.0.md: -------------------------------------------------------------------------------- 1 | # v0.30.0 2 | 3 | * Add tini to the sidecar image. 4 | * Use locality information to determine which processes to remove in a shrink. 5 | * Prevent reconciliation from being blocked when pods are stuck in terminating. 6 | * Add documentation on working with locks. 7 | * Test the CRDs against multiple versions of the API server. 8 | * Manage more conditions through the process group status. 9 | * Represent process classes as a customn type. 10 | * Fix the image tag in the helm chart. 11 | * Add validation on the satellite configuration in the region config. -------------------------------------------------------------------------------- /docs/changelog/v0.31.0.md: -------------------------------------------------------------------------------- 1 | # v0.31.0 2 | 3 | * Block exclusions until replacement processes are reporting to the cluster. 4 | * Prevent reconciliation from getting stuck when pods are stuck in terminating 5 | and have failing conditions on the process group. 6 | * Add the age of the FDB object to the kubectl output. 7 | * Improve parallelism when checking for updates to config maps. 8 | * Update the version of the CRD API we use in our CRD definition. 9 | * Update logging flags to conform with standard names for Zap. 10 | * Fix a bug that caused error events to be silently lost. 11 | * Requeue reconciliation when we detect an increase to the resource version for 12 | the cluster resource. 13 | * Use patch requests when making changes to the cluster spec in the kubectl 14 | plugin. 15 | * Fix Prometheus configuration in the sample deployment. 16 | * Allow specifying a custom duration for the minimum uptime between bounces. -------------------------------------------------------------------------------- /docs/changelog/v0.31.1.md: -------------------------------------------------------------------------------- 1 | # v0.31.1 2 | 3 | * Remove the custom CA certs used when downloading artifacts from the FoundationDB website. -------------------------------------------------------------------------------- /docs/changelog/v0.32.0.md: -------------------------------------------------------------------------------- 1 | # v0.32.0 2 | 3 | * Add option to put pods in a crash loop state for testing. 4 | * Remove unused conditions. 5 | * Prevent crashloop if pod is not available. 6 | * Calculate the sum of resource requirements when doing replacements. 7 | * Allow replacing all failed pods within the plugin. 8 | * Remove pods that are failed and have NodeAffinity reason. 9 | * Fix ReadOnlyRootFilesystem override. -------------------------------------------------------------------------------- /docs/changelog/v0.33.0.md: -------------------------------------------------------------------------------- 1 | # v0.33.0 2 | 3 | * Ignore processes that are pending removal when doing a bounce. 4 | * Simplify selection of FDB version when generating the sidecar image version. 5 | * Improve support for custom sidecar images. 6 | * Add initial end-to-end tests. 7 | * Add a restart command to the kubectl plugin. 8 | * Add an analyze command to the kubectl plugin. 9 | * Validate FDB version format as part of the CRD definition. -------------------------------------------------------------------------------- /docs/changelog/v0.34.0.md: -------------------------------------------------------------------------------- 1 | # v0.34.0 2 | 3 | * Allow setting a livenessProbe for the sidecar. 4 | * Report errors in logs for sidecar interactions. 5 | * Ignore process groups without an address 6 | * Add monitoring docs and fix markdown. 7 | * Remove lock for pod removal. 8 | * Add metrics for instances to remove. 9 | * Add metrics for process group and reconciled status. 10 | * Reset args to prevent test failures. 11 | * Set trace log format in fdbcli. 12 | * plugin deprecation. 13 | * Fix test skip regex. 14 | * Fix broken tests. 15 | -------------------------------------------------------------------------------- /docs/changelog/v0.34.1.md: -------------------------------------------------------------------------------- 1 | # v0.34.1 2 | 3 | * merge exclude check and process group removal. 4 | * ignore process group on error instead of setting condition. 5 | * add explicit schema for podTemplateSpec.metadata. 6 | * Add instructions on testing a restore in our backup sample. 7 | -------------------------------------------------------------------------------- /docs/changelog/v0.35.0.md: -------------------------------------------------------------------------------- 1 | # v0.35.0 2 | 3 | * Fix a bug with the arguments to the backup and restore commands. 4 | * Refactor the setup in the main method to move more setup code into a library. 5 | * Merge the steps for confirming exclusion completion and removing the pods. 6 | * Improve handling of missing pods when updating the status. 7 | * Change our release process to upload the binary for the plugin instead of an 8 | archive. 9 | * Disable end-to-end tests by default when running `go test` directly. 10 | * Use different config map hashes for different process classes. 11 | * Remove unnecessary requeueing of reconciliation when a step updates the 12 | status. 13 | * Move the FDB client dependencies into a dedicated subpackage. 14 | * Prefer to place coördinators on storage pods. 15 | * Add the metadata from the pod template to the schema to prevent pruning. 16 | * Add an option in the spec to prevent reconciling a cluster. -------------------------------------------------------------------------------- /docs/changelog/v0.35.1.md: -------------------------------------------------------------------------------- 1 | # v0.35.1 2 | 3 | * Prevent sub-optimal recruitment of coordinators in multi-DC configurations. 4 | * Remove use of recently deprecated paths in initializing the controllers. -------------------------------------------------------------------------------- /docs/changelog/v0.36.0.md: -------------------------------------------------------------------------------- 1 | # v0.36.0 2 | 3 | * Allow access to the ready endpoint without client certs. 4 | * Add emptyMonitorConf as an option to diable all fdbserver processes. 5 | * Code refactoring. 6 | * Fix status not getting updated. 7 | * Only track latest address IP Address. 8 | * Use new DB client. 9 | * Allow specifying a portion of the connection string. 10 | * Add support for key-range restores. 11 | * Refactor user manual, samples, and test configs. 12 | * Apply an annotation when there is an out-of-date config map. 13 | * Set the missing conditions when creating new process groups. 14 | * Use instance metadata directly for the deletion timestamp check. 15 | -------------------------------------------------------------------------------- /docs/changelog/v0.37.0.md: -------------------------------------------------------------------------------- 1 | # v0.37.0 2 | 3 | * Show the availability instead of the cluster health in the kubectl output. 4 | * Ensure that coordinator selection is deterministic. 5 | * Ensure that we never remove an active coordinator. 6 | * Print messages about pending removals in the `kubectl fdb analyze` command. 7 | * Only reconcile on generation or annotation change. 8 | * Allow reconciliation to move forward when PVCs are stuck in terminating. 9 | * Add an option for the maximum concurrent replacements when doing safety checks 10 | for automatic replacements. 11 | * Add an option for the maximum concurrent reconciliations. 12 | * Clean up the helm chart. 13 | -------------------------------------------------------------------------------- /docs/changelog/v0.38.0.md: -------------------------------------------------------------------------------- 1 | # v0.38.0 2 | 3 | * Fix CI. 4 | * Remove deprecated metrics. 5 | * Don't skip update status after process groups are removed. 6 | * Wait to set the HasPendingRemoval flag in the status until we’ve started terminating the resources. 7 | * Deprecate the Resolver field in the process counts. 8 | * Support defining custom match labels for identifying resources owned by the operator. 9 | * Refactor reconciliations results to use a custom structure. 10 | * Pod IP selection rules for dual-stack environments. 11 | * Make health check in the database more narrowly-targeted. 12 | * Enable automatic replacements by default. 13 | * Improve user manual. 14 | * Remove cache for the database. 15 | * Merge affinities instead of replacing them. 16 | * Update output files. 17 | * Add a compact format to the FDB version. 18 | * Allow defininig which processes should take part in coordinator selection. 19 | * Fallback to pod IP rather than machine ID. 20 | -------------------------------------------------------------------------------- /docs/changelog/v0.39.0.md: -------------------------------------------------------------------------------- 1 | # v0.39.0 2 | 3 | * Check for unexpected arguments. 4 | * Remove sort from initial file generation. 5 | * Add the number of desired pods in the message for initial cluster file generation. 6 | * Enable log file rotation. 7 | * Fix log message using wrong cluster key. 8 | * Remove explicity gomega imports. 9 | * Remove sidecar code. 10 | * Add methods to get next version based on current version. 11 | * Add additional logs for reconcile state. 12 | * Wrap error with additional process group info. 13 | * Make use of net.IP for address. 14 | * Updaet the index page in user manual. 15 | -------------------------------------------------------------------------------- /docs/changelog/v0.39.1.md: -------------------------------------------------------------------------------- 1 | # v0.39.1 2 | 3 | * add condition for unreachable sidecar 4 | * revert unexpected args checks 5 | -------------------------------------------------------------------------------- /docs/changelog/v0.39.2.md: -------------------------------------------------------------------------------- 1 | # v0.39.2 2 | 3 | * Refactor common methods into more specific files in the internal package 4 | * Expose the GetPodSpec method in the controller package 5 | * Allow to only set the IP address without any ports and add more tests 6 | -------------------------------------------------------------------------------- /docs/changelog/v0.40.0.md: -------------------------------------------------------------------------------- 1 | # v0.40.0 2 | 3 | * Prevent doubl-encoding ipv6 addresses when translating between pod IPs and process addresses. 4 | * Replace instances if PVC hash/name does not match. 5 | * Using explicit listen address for all clusters. 6 | * Revert the change for th eCRD to use coordinators as strings. 7 | -------------------------------------------------------------------------------- /docs/changelog/v0.41.0.md: -------------------------------------------------------------------------------- 1 | # v0.41.0 2 | 3 | * Fix the security context and ClusterRoleBindings in the helm chart. 4 | * Fix some scenarios where we block reconciliation on pending pods. 5 | * Add more flexible options for customizing images for built-in containers. 6 | -------------------------------------------------------------------------------- /docs/changelog/v0.41.1.md: -------------------------------------------------------------------------------- 1 | # v0.41.1 2 | 3 | * Restore a missing shim 4 | -------------------------------------------------------------------------------- /docs/changelog/v0.42.0.md: -------------------------------------------------------------------------------- 1 | # v0.42.0 2 | 3 | * Adds a command to fix coordinator IPs when cluster is unavailable. 4 | * Change the kubebuilder download path in the PR build. 5 | * Allow exclusions when another process is missing. 6 | * Replace pods with the PodFailing condition. 7 | * Skip already upgraded processes. 8 | * Printout pod names instead of a pod struct. 9 | * Adds a log field reconciler. 10 | * Minor refactoring. 11 | -------------------------------------------------------------------------------- /docs/changelog/v0.42.1.md: -------------------------------------------------------------------------------- 1 | # v0.42.1 2 | 3 | * Disable non-blocking excludes. 4 | * Change kubebuilder download path in PR build. 5 | -------------------------------------------------------------------------------- /docs/changelog/v0.43.0.md: -------------------------------------------------------------------------------- 1 | # v0.43.0 2 | 3 | * Remove old remove_pods_test.go 4 | * Add setting to enforce full replication of the cluster before deleting Pods 5 | * Check for fault tolerance and not cluster health when deleting Pods 6 | * Add the fully replicated information into the status printout 7 | * Return error when fdbcli binary cannot be found 8 | * Add additional checks for deprecated fields in container overrides. 9 | -------------------------------------------------------------------------------- /docs/changelog/v0.44.0.md: -------------------------------------------------------------------------------- 1 | # v0.44.0 2 | 3 | * Stamp the manager binary with the operator version 4 | * Update go version in our builds 5 | * Remove unnecessary requeue when generating the initial cluster file 6 | * Check the fault tolerance of the cluster before removing process groups 7 | * Refactor the FdbInstance type so we can directly reference pods in more places 8 | * Add prefixes to the default labels used by the operator 9 | * Add constants to represent possible backup states 10 | * Improve timeouts and retries in the HTTP connection to the sidecar process 11 | -------------------------------------------------------------------------------- /docs/changelog/v0.45.0.md: -------------------------------------------------------------------------------- 1 | # v0.45.0 2 | 3 | * Added flag in `FoundationDBClusterAutomationOptions` for enabling no-wait excludes 4 | * Refactor exposed methods 5 | * Specify the complete registry to allow builds with container 6 | runtimes/builders other than docker 7 | * Make DatabaseConfiguration explicit 8 | * Corrected the log level to error for all error in `UpdatePodConfig` 9 | * Deprecated `enforceFullReplicationForDeletion` 10 | * Ensure in reconcilers that we iterate over ProcessGroups not 11 | Instances/Pods, fixing #918 12 | * `ProcessGroupIDLabels` and `ProcessClassLabels` have a new max limit of 13 | 100 items 14 | * pod client: uses the default retry policy of hashicorp/go-retryablehttp 15 | -------------------------------------------------------------------------------- /docs/changelog/v0.46.0.md: -------------------------------------------------------------------------------- 1 | # v0.46.0 2 | 3 | * Allow automatically replacing failed process groups with no address assigned 4 | * Ignore test-class processes when converting to TLS 5 | * Allow limiting the number of parallel replacements when replacing due to 6 | spec changes. 7 | * Reduce reliance on sorting results in tests. 8 | -------------------------------------------------------------------------------- /docs/changelog/v0.47.0.md: -------------------------------------------------------------------------------- 1 | # v0.47.0 2 | 3 | * Makes use of util functions for pointers. 4 | * Adds a deps target to fetch all needed Go binaries in makefile. 5 | * Extends the timeout for connections to the sidecar. 6 | * Fixes markdown for backup. 7 | -------------------------------------------------------------------------------- /docs/changelog/v0.48.0.md: -------------------------------------------------------------------------------- 1 | # v0.48.0 2 | 3 | * Refactoring to unify naming to process groups. 4 | * Added `Age` field to the `FoundationDBBackup` resource. 5 | * Added `Age` field to the `FoundationDBRestore` resource 6 | * Prevent a deadlock in cluster creation 7 | * Only replace instances with incorrect node selectors when the pod spec hash 8 | has changed. 9 | * Add multiple deletion modes to give more customization of how pods are 10 | recreated. 11 | * Move the FdbPodClient interface out of the internal package. 12 | * Add metrics for removal and exclusion of process groups. 13 | * Allow targeting reconciliation on resources with a specific label selector. 14 | * Allow customizing the container CLI in the build process. 15 | * Add a plugin command to generate a configuration string for fdbcli. 16 | * Use a delayed requeue for in-progress exclusions. 17 | * Use a delayed requeue when deferring the recreation of pods. 18 | * Update various dependencies 19 | 20 | 21 | ## Deprecations 22 | 23 | * `InstancesToRemove` use `ProcessGroupsToRemove` instead. 24 | * `InstancesToRemoveWithoutExclusion` use `ProcessGroupsToRemoveWithoutExclusion` instead. 25 | * `InstanceIDPrefix` use `ProcessGroupIDPrefix` instead. 26 | 27 | ## Breaking changes 28 | 29 | * Renamed `kubectl-fdb remove instances` to `kubectl-fdb remove process-groups`. 30 | -------------------------------------------------------------------------------- /docs/changelog/v0.49.0.md: -------------------------------------------------------------------------------- 1 | # v0.49.0 2 | 3 | * Add support for custom parameters in the commandline. 4 | * Change services to routing in the docs. 5 | * Fix build for CI. 6 | * Remove reference to old context package. 7 | * Refactor code to make context first argument of functions. 8 | * Add missing go package to copy. 9 | * Adds design for three_data_hall and three_datacenter modes. 10 | * Adds design for better fault domain distribution. 11 | -------------------------------------------------------------------------------- /docs/changelog/v0.49.2.md: -------------------------------------------------------------------------------- 1 | # v0.49.2 2 | 3 | * Pull FDB assets from GitHub instead of foundationdb.org 4 | -------------------------------------------------------------------------------- /docs/changelog/v0.50.0.md: -------------------------------------------------------------------------------- 1 | # v0.50.0 2 | 3 | * If a process group is in terminating only add that condition (#1044) 4 | * Add additional docs about coordinator selection (#1045) 5 | * Add validation for storage engine and redundancy mode (#1027) 6 | * Update go version to 1.17 (#1025) 7 | * Correct the env setting for race detection (#1026) 8 | -------------------------------------------------------------------------------- /docs/changelog/v0.51.0.md: -------------------------------------------------------------------------------- 1 | # v0.51.0 2 | 3 | * Experimental support for using DNS names in cluster files (#1055) 4 | * Adds an option to filter the conditions that are shown in the analyze command in the kubectl plugin (#1054) 5 | -------------------------------------------------------------------------------- /docs/changelog/v0.51.1.md: -------------------------------------------------------------------------------- 1 | # v0.51.1 2 | 3 | * Adding support for FoundationDB release candidates (https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1102) 4 | -------------------------------------------------------------------------------- /docs/changelog/v1.1.0.md: -------------------------------------------------------------------------------- 1 | # v1.1.0 2 | 3 | ## Changes 4 | 5 | * Unify kustomize setup and reduce duplication [#1084](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1084). 6 | * Pass configured logger into fdbclient [#1111](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1111). 7 | * Add an image pull policy in the development operator config [#1115](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1115). 8 | * Changes to support coordinator changes when using DNS names [#1122](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1122). 9 | * Remove the usage of go get and unused dep [#1124](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1124). 10 | * Fix flaky unit test and bug in process group removal [#1129](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1129). 11 | * Add authentication support for OpenStack, Azure and GCP [#1130](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1130). 12 | * Run specs in parallel [#1125](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1125). 13 | * Remove unused deps and use make to install required versions [#1127](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1127). 14 | * Correct the generation of our spec documentation to include structs from different files [#1137](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1137). 15 | * Make use of [goreleaser](https://goreleaser.com) for our plugin [#1139](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1139). 16 | * Add support for grv and commit proxies for FDB 7.0+ [#1114](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1114). 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.1.1.md: -------------------------------------------------------------------------------- 1 | # v1.1.1 2 | 3 | ## Changes 4 | 5 | * Fix role counts for versions prior to 7.0 [#1142](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1142). 6 | -------------------------------------------------------------------------------- /docs/changelog/v1.11.0.md: -------------------------------------------------------------------------------- 1 | # v1.11.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Expose Pod Mock Client for testing [#1451](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1451) 8 | * Initial changes to remove update Pod config in bounce reconciler [#1372](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1372) 9 | * If configure database is set to false skip all work [#1433](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1433) 10 | -------------------------------------------------------------------------------- /docs/changelog/v1.12.0.md: -------------------------------------------------------------------------------- 1 | # v1.12.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Remove old Kubernetes version from tests [#1471](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1471) 8 | * Add buggify option to ingore processes during restart [#1467](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1467) 9 | * Add docs for DNS setup documentation Improvements or additions to documentation [#1466](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1466) 10 | * Small clean up [#1463](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1463) 11 | * Add first status check for the analyze command [#1461](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1461) 12 | * Security Updates [#1457](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1457) 13 | * Add update hooks to the mock Kubernetes client [#1456](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1456) 14 | * Ensure that Pods that are stuck in terminating but still have a fdbserver process reporting are marked as failed [#1455](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1455) 15 | * Ensure that the configmap is synced before restarting processes [#1454](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1454) 16 | 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.13.0.md: -------------------------------------------------------------------------------- 1 | # v1.13.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Make sure we do a delayed reconcile if the incompatible check has an error [#1488](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1488) 8 | * Fix bug in ignore restart logic [#1490](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1490) 9 | * Cdf 17647: patch CVE 2022 41721 [#1486](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1486) 10 | * Improve operator restart logic for upgrades [#1474](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1474) 11 | * Migrate old CrashLoop to new Spec [#1484](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1484) 12 | * Add recommended running env for setup_e2e.sh and fix a broken link in getting_started [#1487](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1487) 13 | * Change crashLoop setup to allow to select container [#1472](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1472) 14 | * Convert some lists in admin_client_mock to sets. [#1437](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1437) 15 | * make: don't target emacs autosave files [#1481](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1481) 16 | -------------------------------------------------------------------------------- /docs/changelog/v1.14.0.md: -------------------------------------------------------------------------------- 1 | # v1.14.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Improve the way how the operator handles partitial upgrades [#1491](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1491) 8 | * extending the cordon command for all clusters [#1493](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1493) 9 | * Update dependencies [#1499](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1499) 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/changelog/v1.16.0.md: -------------------------------------------------------------------------------- 1 | # v1.16.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | Ensure we call exclude only on missing processes [#1550](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1550) 8 | Make sure we always check the sidecar to get the most recent information about the updated ConfigMap [#1547](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1547) 9 | Initial design for replacing Pods running on tainted nodes [#1502](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1502) 10 | Update examples and better document how to run a multi-region FDB cluster [#1548](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1548) 11 | Add kube builder validation checks for a couple of entries. [#1544](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1544) 12 | Adding a way to ignore specific LogGroups in check client compatibility [#1526](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1526) 13 | Fix upgrade logic for multiple storage server per Pod [#1538](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1538) 14 | -------------------------------------------------------------------------------- /docs/changelog/v1.2.0.md: -------------------------------------------------------------------------------- 1 | # v1.2.0 2 | 3 | ## Changes 4 | 5 | * Document fail-over with plugin and allow to update config [#1131](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1131). 6 | * Update go version to 1.17.8 [#1147](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1147). 7 | * Recreating pods that are not fully excluded [#1136](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1136). 8 | * Add 7.1.0-rc3 to our CI pipeline [#1128](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1128). 9 | * Add support for ssd-rocksdb-v1 [#1152](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1152). 10 | -------------------------------------------------------------------------------- /docs/changelog/v1.20.1.md: -------------------------------------------------------------------------------- 1 | # v1.20.1 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Fix exclusion logic multiple processes [#1721](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1721) 8 | -------------------------------------------------------------------------------- /docs/changelog/v1.21.0.md: -------------------------------------------------------------------------------- 1 | # v1.21.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Remove logServersPerDisk from v1beta1 API [#1742](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1742) 8 | * Fix linting for status fields that are lists [#1737](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1737) 9 | * Explanation for the number of recoveries that happen during an upgrade [#1736](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1736) 10 | * Disable node access per default in the operator [#1735](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1735) 11 | * Document used FDB ports [#1733](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1733) 12 | * Correct the way how the client knobs are passed down and used [#1731](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1731) 13 | * Replacement logic should ignore process groups that are in maintenance mode [#1711](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1711) 14 | * supporting multiple Log processes per disk [#1686](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1686) 15 | -------------------------------------------------------------------------------- /docs/changelog/v1.22.0.md: -------------------------------------------------------------------------------- 1 | # v1.22.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add messages from the client and cluster part in the machine-readable status [#1761](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1761) 8 | * Remove the additional get status call for getting the coordinator set [#1759](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1759) 9 | * Check if the database is available before doing any exclusion checks [#1758](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1758) 10 | * Update fault domain detection for multiple processes in a single Pod [#1753](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1753) 11 | * Verify the processes that are excluded [#1752](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1752) 12 | * Fix get removal mode [#1751](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1751) 13 | * Add label watch perdicate [#1744](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1744) 14 | * Upgrade to go version 1.20 [#1740](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1740) 15 | * Split deployment.yaml config sample RBAC roles [#1734](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1734) 16 | -------------------------------------------------------------------------------- /docs/changelog/v1.23.0.md: -------------------------------------------------------------------------------- 1 | # v1.23.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * update goreleaser version, and remove invalid config [#1780](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1780) 8 | * Add namespace parameter for PVC query and move process count validation into common method [#1774](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1774) 9 | * Add e2e test to make sure operator can handle Pods that are stuck in pending [#1773](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1773) 10 | * Remove the client service in the sample [#1772](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1772) 11 | * Document the maintenance mode feature [#1771](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1771) 12 | * Allow to reduce debugging information in operator test framework [#1770](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1770) 13 | * Update goreleaser [#1767](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1767) 14 | * updating ipv6 support in sidecar and service [#1754](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1754) 15 | * Allow to create controller runtime from different context [#1745](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1745) 16 | * Update controller gen [#1738](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1738) 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.24.0.md: -------------------------------------------------------------------------------- 1 | # v1.24.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * exposing context [#1790](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1790) 8 | * Fix Issue #1739 [#1789](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1789) 9 | * Update the default e2e FDB versions [#1783](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1783) 10 | * Fix CRD validation for Process Group ID and allow wildcard [#1779](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1779) 11 | * Allow to update the annotations and labels for the FoundationDBCluster resource in tests [#1778](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1778) 12 | -------------------------------------------------------------------------------- /docs/changelog/v1.25.0.md: -------------------------------------------------------------------------------- 1 | # v1.25.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Split upgrade tests into tests with chaos mesh and without [#1812](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1812) 8 | * Split upgrade tests as we hit the timeout for our CI pipeline [#1808](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1808) 9 | * Correct the namespace creation for e2e tests [#1806](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1806) 10 | * Allow to use max timeout for get status and allow to specify the max timeout [#1805](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1805) 11 | * Improve operator lock handling by releasing locks once cluster is reconciled [#1803](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1803) 12 | * Correct the value used for testing [#1802](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1802) 13 | * Make use of the new fault tolerance methods [#1797](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1797) 14 | * Fix the lock ID to return the correct value [#1796](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1796) 15 | * Only set the MissingProcesses condition if the machine-readable status contains at least one process [#1794](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1794) 16 | * Increase timeout for default single cluster upgrade [#1792](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1792) 17 | * Initial design doc for suspending Process Groups [#1785](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1785) 18 | * Remove unused hot-shard tool [#1784](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1784) 19 | -------------------------------------------------------------------------------- /docs/changelog/v1.28.0.md: -------------------------------------------------------------------------------- 1 | # v1.28.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Make sure the operator checks all provided addresses for exclusions [#1875](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1875) 8 | * Simplify test setup [#1871](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1871) 9 | * Three data hall fault domain storage check bug fix [#1869](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1869) 10 | * Correct the version check for the locality based exclusions [#1868](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1868) 11 | * Make sure the operator can proceed with exclusions even if multiple pods are failing [#1867](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1867) 12 | * Add some buffer for the exclusion logic to mitigate dead locks [#1866](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1866) 13 | * Add support for redwood storage engine [#1865](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1865) 14 | * Make use of string builder for getting the configuration string [#1863](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1863) 15 | * Fix resources limits for non performance tests [#1859](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1859) 16 | * If locality-based exclusions are enabled, only make use of the locality [#1844](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1844) 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.3.0.md: -------------------------------------------------------------------------------- 1 | # v1.3.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Ensure we delete all resources when a process group is in resource terminating state [#1145](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1145) 8 | * Update ginkgo version to v2 [#1156](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1156) 9 | * fix replacements with empty monitor conf setting [#1141](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1141) 10 | * make use of constants for storage engine references [#1165](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1165) 11 | 12 | ### Plugin 13 | 14 | * add flag to ignore removals [#1166](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1166) 15 | * experimental command for the plugin to show the state of exclusions [#1133](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1133) 16 | * skip Pods that are part of a process group marked for removal [#1132](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1132) 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.3.1.md: -------------------------------------------------------------------------------- 1 | # v1.3.1 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Fix handling of role counts when running 7.1. [#1172](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1172) 8 | -------------------------------------------------------------------------------- /docs/changelog/v1.30.0.md: -------------------------------------------------------------------------------- 1 | # v1.30.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add indexer to fix exec command [#1917](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1917) 8 | * Add e2e test case for maintenance mode interaction [#1915](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1915) 9 | * Update dependencies [#1914](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1914) 10 | * Minor documentation improvements [#1913](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1913) 11 | * Add support for using the unified image as init container for the operator [#1911](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1911) 12 | * Add the missing list verb to Pods for testing the unified image [#1910](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1910) 13 | * Allow to modify the leader election timeouts [#1909](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1909) 14 | * format files changed during release with yq [#1907](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1907) 15 | -------------------------------------------------------------------------------- /docs/changelog/v1.32.0.md: -------------------------------------------------------------------------------- 1 | # v1.32.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add estimates and pretty printing to exclusion status check [#1927](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1927) 8 | * Allow the operator to restart the CC when tester processes are unreachable [#1925](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1925) 9 | * Add additional safety checks for bouncing and excluding processes [#1924](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1924) 10 | * Update the FDB versions used for e2e tests [#1923](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1923) 11 | * Add cache client selector [#1922](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1922) 12 | * Add additional tests for the maintenance mode [#1921](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1921) 13 | * Make sure we exclude the FDB_NETWORK_OPTION_CLIENT_THREADS_PER_VERSION env variable and don't pass it down to fdbcli [#1920](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1920) 14 | * Change base image to rocky9 [#1894](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1894) 15 | -------------------------------------------------------------------------------- /docs/changelog/v1.34.0.md: -------------------------------------------------------------------------------- 1 | # v1.34.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Minor typo fix in mention of localities [#1957](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1957) 8 | * Document issue with older fdb bindings and DNS support [#1956](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1956) 9 | * Fix the e2e test case for the new FDB version that supports to remove old tester processes automatically [#1955](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1955) 10 | * Fix nil pointer ha e2e [#1952](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1952) 11 | * Disable flaky test in nightly runs [#1947](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1947) 12 | -------------------------------------------------------------------------------- /docs/changelog/v1.36.0.md: -------------------------------------------------------------------------------- 1 | # v1.36.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Documentation updates for fault domain and ADDITIONAL_ENV_FILE [#1980](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1980) 8 | * Add additional documentation for the copied cluster-file [#1978](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1978) 9 | -------------------------------------------------------------------------------- /docs/changelog/v1.37.0.md: -------------------------------------------------------------------------------- 1 | # v1.37.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Remove old indexer [#1997](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1997) 8 | * Add additional variation test with dedicated coordinators and service IP [#1995](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1995) 9 | * Small logging improvements and code restructure for the taint feature [#1993](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1993) 10 | * Correct log line for maintenance check and remove process if restarted in different zone [#1992](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1992) 11 | * Correct the event message for process group removal [#1990](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1990) 12 | * Allow the operator to trigger a reconciliation if a node changes [#1989](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1989) 13 | * Document the limitation that only custom parameters for fdbserver can be defined [#1988](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1988) 14 | * Update docs old env variables [#1986](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1986) 15 | * Automatically add port for backup and restore [#1985](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1985) 16 | * Update go version to 1.22.2 [#1983](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1983) 17 | * Label selection for pods/processGroups [#1981](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1981) 18 | -------------------------------------------------------------------------------- /docs/changelog/v1.38.0.md: -------------------------------------------------------------------------------- 1 | # v1.38.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * updating logging level from debug to info [#2011](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2011) 8 | * Fix warning of deprecated setting in golangci-lint [#2010](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2010) 9 | * Make sure that the provided namespace will be used for HA tests [#2009](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2009) 10 | * Add safe guard to reduce risk when a large number of nodes are tainted [#2008](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2008) 11 | * Make sure that only the container is build [#2005](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2005) 12 | * Make sure to skip process groups that are under maintenance [#2004](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2004) 13 | * Improve some code paths in the update status code [#2002](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2002) 14 | * Add additional log statements for taint feature [#2000](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2000) 15 | * Bump golang.org/x/net from 0.17.0 to 0.23.0 [#1999](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1999) 16 | * Document how to run e2e tests with the unified image [#1998](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1998) 17 | * Limit range over processes to DC [#1994](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1994) 18 | -------------------------------------------------------------------------------- /docs/changelog/v1.39.0.md: -------------------------------------------------------------------------------- 1 | # v1.39.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Unify operator args for the sidecar and unified image approach [#2030](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2030) 8 | * Improve reliability of the reset maintenance test [#2027](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2027) 9 | * Initial support for the unified image in the backup deployment [#2025](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2025) 10 | * Run trivy only for the operator image [#2023](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2023) 11 | * Update to go 1.22.3 [#2019](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2019) 12 | * Prefer upgraded processes for coordinators when the operator chooses the coordinators [#2017](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2017) 13 | * Add a new e2e test for knob rollout with process group replacement [#2013](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2013) 14 | -------------------------------------------------------------------------------- /docs/changelog/v1.4.0.md: -------------------------------------------------------------------------------- 1 | # v1.4.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add support for is present and fix a bug in is_present [#1206](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1206) 8 | * Updating the logic for check more than 1 value [#1203](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1203) 9 | * Fix backup setup for image config [#1198] (https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1198) 10 | * For versions that support grv and commit use grv and commit proxy count if defined [#1191](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1191) 11 | * Fix allowTagOverride for FDB backup [#1188] (https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1188) 12 | * Check exclusion status of fully excluded and in progress exclusions in two steps [#1182](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1182) 13 | * Delay requeue for terminating Pod in update pods [#1181](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1181/files) 14 | 15 | ## Plugin 16 | 17 | * Fix how the desired configuration is created [#1199](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1199) 18 | * Add flags for http timeouts [#1190](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1190) 19 | * Add image config support for backup [#1189](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1189) 20 | * Remove CGO setting for building the plugin [#1183](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1183) 21 | -------------------------------------------------------------------------------- /docs/changelog/v1.40.0.md: -------------------------------------------------------------------------------- 1 | # v1.40.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Refactor replacement tests for better readability [#2044](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2044) 8 | * Use the same ConfigMap entries for all different process configuration [#2038](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2038) 9 | * Allow to override the image tag for specific versions [#2037](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2037) 10 | * Add a test case for the unified image to check what happens if the Kubernetes API is partitioned [#2036](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2036) 11 | * Add support for env variables in custom parameters for the unified image [#2035](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2035) 12 | * Fix DNS setup for unified image and make sure env variable is set [#2031](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2031) 13 | * Add support for PodIPFamily in the unified image [#2028](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2028) 14 | * quick doc addition to help emphasize recreation vs replacement terms [#2024](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2024) 15 | * Make sure we ignore clients that share the same machine address as a process from the FoundationDB cluster [#2022](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2022) 16 | * Replace pod for instances with changed file security context [#2014](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2014) 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.43.0.md: -------------------------------------------------------------------------------- 1 | # v1.43.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Move well-known env vars and config map keys into constants [#2101](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2101) 8 | * Improve team tracker checks when DD was restarted [#2100](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2100) 9 | * Try to get the running version based on the reachable coordinators during an upgrade [#2098](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2098) 10 | * Check if the namespace is created by the same test suite [#2097](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2097) 11 | * Make sure to only check the isolate process group annotation if a pod was returned [#2095](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2095) 12 | * Update go version to 1.22.5 [#2094](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2094) 13 | * Adding permissions for "nodes" resources to the helm chart (#2091) [#2093](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2093) 14 | * Fix race condition in e2e test suite when checking if a pod is deleted [#2092](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2092) 15 | * Run the change coordinator command before excluding the coordinator [#2083](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2083) 16 | -------------------------------------------------------------------------------- /docs/changelog/v1.44.0.md: -------------------------------------------------------------------------------- 1 | # v1.44.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Fix the update status setup when a different image type is used [#2106](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2106) 8 | * Fix typo in documentation mention of redundancy_mode [#2104](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2104) 9 | * Update examples for imageType setting [#2102](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2102) 10 | * Make sure to test if the fdb-kubernetes-monitor is able to update the annotation after the partition [#2096](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2096) 11 | -------------------------------------------------------------------------------- /docs/changelog/v1.45.0.md: -------------------------------------------------------------------------------- 1 | # v1.45.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Bug fix: Added required field namespace for global mode [#2112](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2112) 8 | * Allow the operator to replace process groups with an I/O error [#2111](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2111) 9 | * Make sure the operator provides an error message when the command line is too long [#2110](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2110) 10 | * Ensure that the status checker unsets the FDB network options [#2109](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2109) 11 | * Correct the base image for the unified image and increase the memory for the FDB pods to 8GiB [#2107](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2107) 12 | -------------------------------------------------------------------------------- /docs/changelog/v1.46.0.md: -------------------------------------------------------------------------------- 1 | # v1.46.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Make sure the e2e tests are running with different storage engines [#2113](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2113) 8 | -------------------------------------------------------------------------------- /docs/changelog/v1.47.0.md: -------------------------------------------------------------------------------- 1 | # v1.47.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add test suite name into namespace and cluster name to reduce conflicts [#2126](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2126) 8 | * Refactor exec code to share same code and add plugin e2e test suite [#2122](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2122) 9 | * Initial docs for coordinator recovery and e2e test [#2121](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2121) 10 | * Read the coordinator IPs from the running Pods if they are present [#2119](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2119) 11 | * Only release the lock when the cluster is reconciled [#2117](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2117) 12 | * Improve logging for fdbclient and lock client to see what subreconciler issued the command [#2116](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2116) 13 | -------------------------------------------------------------------------------- /docs/changelog/v1.48.0.md: -------------------------------------------------------------------------------- 1 | # v1.48.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Fix the get logs from Pod set [#2135](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2135) 8 | * Fix the missing test suite name [#2133](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2133) 9 | * Change timeout for health tracker test [#2132](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2132) 10 | * Update to go 1.22.7 [#2131](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2131) 11 | * Improve the tester handling when a cluster is upgraded [#2130](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2130) 12 | * Add recovery plugin clean [#2127](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2127) 13 | -------------------------------------------------------------------------------- /docs/changelog/v1.49.0.md: -------------------------------------------------------------------------------- 1 | # v1.49.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Remove Minio config and make use of SeaweedFS [#2137](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2137) 8 | * Add support for storage migration in the operator [#2090](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2090) 9 | -------------------------------------------------------------------------------- /docs/changelog/v1.5.0.md: -------------------------------------------------------------------------------- 1 | # v1.5.0 2 | 3 | * Add logging in the fault tolerance checks 4 | * Prevent replacing process groups in a buggified crash loop 5 | * Add more conditions for automatic replacements 6 | * Update the FDB binding version 7 | * Add metrics to reflect the desired number of processes -------------------------------------------------------------------------------- /docs/changelog/v1.50.0.md: -------------------------------------------------------------------------------- 1 | # v1.50.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Fix the case where the process group gets removed without the addresses being included [#2147](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2147) 8 | * Update the docs for e2e tests with a custom FDB version [#2146](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2146) 9 | * Fix output for kubectl fdb exec command [#2145](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2145) 10 | * Update docs unified image [#2143](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2143) 11 | * Fix some bugs in the e2e test suite when only one version mapping is provided and fix the setup of the data loader [#2141](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2141) 12 | * Add an operator e2e exclusion tests when a single log process has high latency [#2138](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2138) 13 | -------------------------------------------------------------------------------- /docs/changelog/v1.51.0.md: -------------------------------------------------------------------------------- 1 | # v1.51.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Try to batch the exclusions of transaction system processes together [#2158](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2158) 8 | * Smaller doc fixes [#2157](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2157) 9 | * Fix the unified image setup during bootstrap when a custom environment variable is used for the zone [#2156](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2156) 10 | * Make sure that the remove cluster is skipped too and add more debugging output for the plugin [#2154](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2154) 11 | * Update go version to 1.22.8 [#2152](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2152) 12 | * Simplify the confirmRemoval code [#2148](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2148) 13 | -------------------------------------------------------------------------------- /docs/changelog/v1.52.0.md: -------------------------------------------------------------------------------- 1 | # v1.52.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Enable unified image tests [#2165](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2165) 8 | * Restart processes only once when doing a setting rollout and include uptime from processes [#2164](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2164) 9 | * Adding a new e2e test for producing data loss [#2162](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2162) 10 | * Ensure the the cluster reconciler status is set to be in simulation after each test [#2160](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2160) 11 | -------------------------------------------------------------------------------- /docs/changelog/v1.54.0.md: -------------------------------------------------------------------------------- 1 | # v1.54.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Update go version and FDB versions for e2e testing [#2194](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2194) 8 | -------------------------------------------------------------------------------- /docs/changelog/v1.55.0.md: -------------------------------------------------------------------------------- 1 | # v1.55.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Ensure that the tag suffix is only added when it is missing [#2208](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2208) 8 | * Check if the newly added process group ID is already excluded [#2207](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2207) 9 | * Update docs for three data hall and move something to implemented [#2206](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2206) 10 | * Ensure reconcilation is requeued for restore controller if the restore is not completed [#2203](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2203) 11 | * Allow to modify the e2e peer verification string [#2202](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2202) 12 | * Add the restore state to the restore CRD [#2198](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2198) 13 | * Mark the HA upgrade test where no remote processes are restarted as pending until it passes reliably [#2197](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2197) 14 | * Ensure the init container is removed if the unified image should be used [#2195](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2195) 15 | * docs: document procedure to migrate a live cluster to three-data-hall redundancy [#2191](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2191) 16 | -------------------------------------------------------------------------------- /docs/changelog/v1.6.0.md: -------------------------------------------------------------------------------- 1 | # v1.6.0 2 | 3 | * Reorder the removal of headless services to avoid a race condition 4 | * Add missing constraints on collection sizes in some fields in the CRD 5 | * Revert to an older version of the FDB bindings to match the oldest supported 6 | database version. -------------------------------------------------------------------------------- /docs/changelog/v1.7.0.md: -------------------------------------------------------------------------------- 1 | # v1.7.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | - Don't allocate extra space for include processes method [#1247](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1247) 8 | - Add coordinator as stateful process [#1245](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1245) 9 | - Add changes to publish helm-chart [#1253](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1253) 10 | - Increase limit for PeerVerificationRules [#1260](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1260) 11 | - Only update cluster status if changes are made [#1263](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1263) 12 | 13 | ### Tooling 14 | 15 | - Update sed command to run on Mac [#1269](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1269) 16 | - Remove unused kube-score [#1259](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1259) 17 | -------------------------------------------------------------------------------- /docs/changelog/v1.8.0.md: -------------------------------------------------------------------------------- 1 | # v1.8.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | - Fix bug where config update is triggered to often [#1280](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1280) 8 | - Use DB key for connection string [#1262](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1262) 9 | - Retry flaky test [#1267](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1267) 10 | 11 | ### Tooling 12 | 13 | - Update customization.md [#1290](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1290) 14 | - Fix setup of deployment [#1282](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1282) 15 | - Fix how goreleaser fetches the current tag [#1272](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1272/) 16 | -------------------------------------------------------------------------------- /docs/changelog/v1.8.1.md: -------------------------------------------------------------------------------- 1 | # v1.8.1 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | - Make upgrades more reliable [#1283](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1283) 8 | - Unblock incompatible processes reconciler [#1306](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1306) 9 | - Ignore process groups if they have the sidecar unreachable condition in the bounce sub reconciler [#1313](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1313) 10 | - Correct error check for timeout [#1311](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1311) 11 | -------------------------------------------------------------------------------- /docs/changelog/v1.9.0.md: -------------------------------------------------------------------------------- 1 | # v1.9.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Reduce API calls to Kubernetes to fetch process group ID information [#1295](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1295). 8 | * Fix log line [#1297](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1297). 9 | * Add hot shard tool [#1299](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1299). 10 | * Update to go 1.18.5 and add docs for local setup with arm64 [#1305](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/1305). 11 | * updating the default time for failure detection [#1312] 12 | * Add better logging for fdb client calls [#1317] 13 | * Add storage engine type [#1318] 14 | * Initial support for server side apply [#1319] 15 | * Add FoundationDB Logo and description [#1321] 16 | * Put correct syntax to get SHA [#1327] 17 | * Correct the way how the connection string is read [#1329] 18 | * Add wait time between actions [#1330] 19 | * Allow downgrades of compatible versions [#1331] 20 | * Update the documentation on per-pod service IPs to reflect where the feature stands [#1332] 21 | * Ignore excluded processes from minimum uptime calculation when doing a rolling bounce [#1333] 22 | * Ignore missing processes during bounce [#1335] 23 | * Only run remove incompatible processes sub reconciler when cluster was upgraded [#1338] 24 | * Add support for recovery state recovered since [#1343] 25 | * Refactor docker images [#1355] 26 | * Add Docker login back for pushing from main [#1356] 27 | -------------------------------------------------------------------------------- /docs/changelog/v2.0.0: -------------------------------------------------------------------------------- 1 | # v2.0.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Update the image type default in the CRD [#2220](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2220) 8 | * Update docs for v2 release [#2219](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2219) 9 | * Fix typo storagerServersPerPod [#2218](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2218) 10 | * Ensure that the ConfigMap name for the cluster can't be modified [#2215](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2215) 11 | * Streamline lock client usage [#2214](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2214) 12 | * Ensure operator uses static names for PVC. [#2213](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2213) 13 | * Changes for the operator v2 release [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 14 | * Expose the multi-region recover mechanism [#2210](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2210) 15 | -------------------------------------------------------------------------------- /docs/changelog/v2.0.0.md: -------------------------------------------------------------------------------- 1 | # v2.0.0 2 | 3 | ## Changes 4 | 5 | ### Action Required 6 | 7 | Please read the required steps before upgrading in the [compatibility guide](https://github.com/FoundationDB/fdb-kubernetes-operator/blob/v0.51.1/docs/compatibility.md#preparing-for-a-major-release). 8 | 9 | ### Breaking Changes 10 | 11 | * Dropped support for the `v1beta1` CRD [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 12 | * Use locality-based exclusions per default [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 13 | * Use DNS in cluster files per default [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 14 | * Use the unified image per default [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 15 | * Drop support for FDB 6.2 and 6.3 [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 16 | * Drop support for custom PVC names [#2213](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2213) 17 | * Drop support for custom ConfigMap names [#2215](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2215) 18 | 19 | ### Operator 20 | 21 | * Changes for the operator v2 release [#2212](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2212) 22 | * Ensure operator uses static names for PVC [#2213](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2213) 23 | * Ensure that the ConfigMap name for the cluster can't be modified [#2215](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2215) 24 | -------------------------------------------------------------------------------- /docs/changelog/v2.1.0.md: -------------------------------------------------------------------------------- 1 | # v2.1.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Allow to modify the default CPU and memory for pods [#2236](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2236) 8 | * Remove the 3DH setup from e2e pipeline to reduce required resources [#2231](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2231) 9 | * Avoid panics when merging custom annotation/labels [#2227](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2227) 10 | * Fix PR action for docker build [#2225](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2225) 11 | * Update the e2e tests to reflect the new defaults [#2222](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2222) 12 | * Don't run backup tests for bad version [#2221](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2221) 13 | * Add a new label for running a quick upgrade test case [#2201](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2201) 14 | -------------------------------------------------------------------------------- /docs/changelog/v2.2.0.md: -------------------------------------------------------------------------------- 1 | # v2.2.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Update golang and xnet [#2251](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2251) 8 | * Ensure that pods are replaced if we change the Pod IP family [#2247](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2247) 9 | * Ensure that the operator checks if the processes for newly created pods are up and running for the update pod config reconciler [#2244](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2244) 10 | * Fix a bug in the connection string parser when a cluster has a single letter as name [#2240](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2240) 11 | * Correct check for incompatible clients if the coordinator pod hosted more than one process [#2238](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2238) 12 | * Changes in update database configuration to detect if the database was configured [#2237](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2237) 13 | * Check the current cluster status before removing maintenance mode [#2235](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2235) 14 | * Improvements to e2e tests and documentation [#2233](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2233) 15 | * Change the ordering of the coordinator change and the exclusion [#2232](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2232) 16 | * Update cluster file usage. [#2230](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2230) 17 | -------------------------------------------------------------------------------- /docs/changelog/v2.3.0.md: -------------------------------------------------------------------------------- 1 | # v2.3.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Ensure that the cordon command doesn't stop when a node doesn't host any pods [#2260](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2260) 8 | * Implement changes for Multi-Cluster coordination between multiple operator instances. [#2259](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2259) 9 | * Add a dedicated condition for wrong pod metadata [#2258](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2258) 10 | * Remove the last usage of the pvc map method [#2257](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2257) 11 | * Fix test case for Pod IP family change [#2256](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2256) 12 | * Add support for using patch to update pods instead of update [#2253](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2253) 13 | -------------------------------------------------------------------------------- /docs/changelog/v2.4.0.md: -------------------------------------------------------------------------------- 1 | # v2.4.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add additional fields to the model for the FDB database status. [#2267](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2267) 8 | * Bump golang.org/x/net from 0.36.0 to 0.38.0 [#2265](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2265) 9 | -------------------------------------------------------------------------------- /docs/changelog/v2.5.0.md: -------------------------------------------------------------------------------- 1 | # v2.5.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Update the operator example deployments to reflect current supported FDB versions [#2275](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2275) 8 | * Correct the handling of images in different scenarios [#2268](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2268) 9 | * Update test case to set correct resource quota and work with multi-cluster setup [#2264](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2264) 10 | -------------------------------------------------------------------------------- /docs/changelog/v2.6.0.md: -------------------------------------------------------------------------------- 1 | # v2.6.0 2 | 3 | ## Changes 4 | 5 | * Add support for the operator to run on ARM [#2276](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2276) 6 | * Fix crash in findFoundationDBClusterForNode when in global mode [#2273](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2273) 7 | * Remove maintenance information if process group doesn't exist [#2279](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2279) 8 | * Update the go version to 1.23.9 [#2281](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2281) 9 | * Add support management api [#2261](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2261) 10 | * Run the addPods reconciler before connecting to FDB in case we use DNS entries in the cluster file [#2283](https:///github.com/FoundationDB/fdb-kubernetes-operator/pull/2283) -------------------------------------------------------------------------------- /docs/changelog/v2.7.0.md: -------------------------------------------------------------------------------- 1 | # v2.7.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Allow bypassing the downgrade check with the IgnoreUpgradabilityChecks flag. [#2278](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2278) 8 | -------------------------------------------------------------------------------- /docs/changelog/v2.8.0.md: -------------------------------------------------------------------------------- 1 | # v2.8.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Add support for arm based builds with the operator [#2305](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2305) 8 | * Update the release version in the CRD [#2304](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2304) 9 | * Disable the local client per default and only make use of the external clients [#2303](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2303) 10 | * Fix the operator plugin e2e test [#2302](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2302) 11 | * Set logger in e2e tests to remove the stack trace [#2300](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2300) 12 | * Update paths and goreleaser version [#2299](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2299) 13 | * Refactor code to allow controller-runtime updates [#2296](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2296) 14 | * Remove the use-process-group-id flag and validate the process group ID [#2280](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2280) 15 | -------------------------------------------------------------------------------- /docs/changelog/v2.9.0.md: -------------------------------------------------------------------------------- 1 | # v2.9.0 2 | 3 | ## Changes 4 | 5 | ### Operator 6 | 7 | * Disable test for unified image, since the unified image doesn't have a check for this [#2323](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2323) 8 | * Fix format after linter change [#2322](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2322) 9 | * Improve the handling of random Pod picks [#2319](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2319) 10 | * Enable additional linters [#2318](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2318) 11 | * Update typos and change the rollout strategy for the operator pods [#2316](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2316) 12 | * Improve the pod spec change handling during version incompatible upgrades [#2313](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2313) 13 | * Add workaround for cases where the operator gets stuck because of coordinator restarts [#2312](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2312) 14 | * Only pick running pods and pods with an empty deletion timestamp [#2309](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2309) 15 | * Bump github.com/go-viper/mapstructure/v2 from 2.2.1 to 2.3.0 [#2308](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2308) 16 | * Enable TLS conversion for e2e tests [#2307](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2307) 17 | * Encryption for backup and restore [#2301](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2301) 18 | * Enable global sync mode in e2e tests again [#2284](https://github.com/FoundationDB/fdb-kubernetes-operator/pull/2284) 19 | -------------------------------------------------------------------------------- /docs/design/Readme.md: -------------------------------------------------------------------------------- 1 | # Design Docs 2 | 3 | This folder contains open design docs. 4 | If you want to provide a new feature or change a behavior in the operator that requires large or risky changes please create a design doc for it. 5 | We have a design doc [template](template.md) that must be used for creating a new design doc. 6 | All implemented design docs are saved in [implemented](implemented). 7 | -------------------------------------------------------------------------------- /docs/design/template.md: -------------------------------------------------------------------------------- 1 | # Design Doc Template 2 | 3 | ## Metadata 4 | 5 | * Authors: Github usernames for the primary authors of the design, including major revisions. 6 | * Created: Date when the first draft of the design was created, in ISO 8601 format. 7 | * Updated: Date when the last change was made to the design, in ISO 8601 format. 8 | 9 | ## Background 10 | 11 | Explanation of the problem you are trying to solve. 12 | 13 | ## General Design Goals 14 | 15 | Quick summary of what your goals with the new design, including what you want to enable, and what you want to avoid. 16 | 17 | ## Current Implementation 18 | 19 | Additional information about the current state of the world that is relevant to the proposed design. 20 | 21 | ## Proposed Design 22 | 23 | Details of how your design works. 24 | 25 | ## Related Links 26 | 27 | Links to other pages that inform or relate to this design. 28 | -------------------------------------------------------------------------------- /docs/manual/index.md: -------------------------------------------------------------------------------- 1 | # FoundationDB Kubernetes Operator User Manual 2 | 3 | This document provides practical examples of how to use the FoundationDB Kubernetes Operator to accomplish common tasks, and additional information and areas to consider when you are managing these tasks in a real environment. 4 | 5 | This document assumes that you are generally familiar with Kubernetes. 6 | For more information on that area, see the [Kubernetes documentation](https://kubernetes.io/docs/home/). 7 | 8 | ## Table of Contents 9 | 10 | 1. [Getting Started](getting_started.md) 11 | 1. [Warnings](warnings.md) 12 | 1. [Resources Managed by the Operator](resources.md) 13 | 1. [Lifecycle Operations](operations.md) 14 | 1. [Scaling](scaling.md) 15 | 1. [Customizing Your Deployments](customization.md) 16 | 1. [Customizing the Operator](operator_customization.md). 17 | 1. [Replacements and Deletions](replacements_and_deletions.md) 18 | 1. [Controlling Fault Domains](fault_domains.md) 19 | 1. [Running with TLS](tls.md) 20 | 1. [Backup](backup.md) 21 | 1. [Technical Design](technical_design.md) 22 | 1. [Upgrades](upgrades.md) 23 | 1. [Debugging](debugging.md) 24 | 1. [More References](more.md) 25 | -------------------------------------------------------------------------------- /docs/manual/more.md: -------------------------------------------------------------------------------- 1 | # More References 2 | 3 | If you have finished reading the manual, there are more reference docs you can read to get a better understanding of how to use the operator and how to run FoundationDB. 4 | 5 | * [Cluster Resource Definition](/docs/cluster_spec.md) 6 | * [Backup Resource Definition](/docs/backup_spec.md) 7 | * [Restore Resource Definition](/docs/restore_spec.md) 8 | * [FoundationDB Administration documentation](https://apple.github.io/foundationdb/administration.html) 9 | 10 | [Go back to the table of contents](index.md) 11 | -------------------------------------------------------------------------------- /docs/monitoring.md: -------------------------------------------------------------------------------- 1 | # Monitoring 2 | 3 | The FoundationDB Kubernetes operator provides a metrics endpoint in the [Prometheus format](https://prometheus.io/docs/concepts/data_model). 4 | The collected metrics can be used to understand the current state of the operator and state of the cluster from the operators view. 5 | The operator metrics are not a replacement for the collection of the [FoundationDB metrics](https://forums.foundationdb.org/t/what-do-you-monitor/184). 6 | Per default the operator expose the metrics under `$POD_IP:8080/metrics`. 7 | 8 | ## Metrics 9 | 10 | The operator exposes the `controller-runtime` and `golang` metrics. 11 | Besides, these metrics the operator also exposes operator specific metrics, the metric prefix is `fdb_operator`. 12 | The operator specific metrics contain information about: 13 | 14 | - The process groups 15 | - The reconciliation status 16 | - The cluster status 17 | - How many `processGroupsToRemove` are currently in the list 18 | 19 | This list is not complete and will be extended over time. 20 | -------------------------------------------------------------------------------- /e2e/.gitignore: -------------------------------------------------------------------------------- 1 | fdb-kubernetes-tests 2 | *.xml 3 | *.test 4 | -------------------------------------------------------------------------------- /e2e/chaos-mesh/Readme.md: -------------------------------------------------------------------------------- 1 | # Fork of the chaos-mesh struct 2 | 3 | Original code from: https://github.com/chaos-mesh/chaos-mesh/tree/v2.6.7 4 | 5 | We copied the structs inside this repository to decouple the dependencies as only the structs are required for our e2e test cases. 6 | Before this separation it was hard/impossible to upgrade the `controller-runtime` dependency independent of the chaos-mesh release. 7 | 8 | Steps to update the dependencies: 9 | 10 | ```bash 11 | cd chaos-mesh 12 | # Replace the tag with the desired version 13 | git clone --depth 1 --branch v2.6.7 git@github.com:chaos-mesh/chaos-mesh.git 14 | # Remove the current API version and copy the new version. 15 | rm -rf ./api 16 | mv ./chaos-mesh/api . 17 | rm -rf chaos-mesh 18 | # Delete all webhook files, we don't use them 19 | rm -rf ./api/genericwebhook 20 | find ./api/v1alpha1 -name "*webhook*" -delete 21 | # Delete all test files 22 | find ./api/v1alpha1 -name "*test.go" -delete 23 | # Delete the go mod files 24 | rm ./chaos-mesh/api/go.mod ./chaos-mesh/api/go.sum 25 | ``` 26 | -------------------------------------------------------------------------------- /e2e/chaos-mesh/api/v1alpha1/common_errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 Chaos Mesh Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | package v1alpha1 17 | 18 | import ( 19 | "github.com/pkg/errors" 20 | ) 21 | 22 | var ( 23 | errUnknownAction = errors.New("unknown action") 24 | errInvalidValue = errors.New("invalid value") 25 | ) 26 | -------------------------------------------------------------------------------- /e2e/chaos-mesh/api/v1alpha1/groupversion_info.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Chaos Mesh Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | // Package v1alpha1 contains API Schema definitions for the chaosmesh v1alpha1 API group 17 | // +groupName=chaos-mesh.org 18 | package v1alpha1 19 | 20 | import ( 21 | "k8s.io/apimachinery/pkg/runtime/schema" 22 | "sigs.k8s.io/controller-runtime/pkg/scheme" 23 | ) 24 | 25 | var ( 26 | // GroupVersion is group version used to register these objects 27 | GroupVersion = schema.GroupVersion{Group: "chaos-mesh.org", Version: "v1alpha1"} 28 | 29 | // SchemeBuilder is used to add go types to the GroupVersionKind scheme 30 | SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} 31 | 32 | // AddToScheme adds the types in this group-version to the given scheme. 33 | AddToScheme = SchemeBuilder.AddToScheme 34 | ) 35 | -------------------------------------------------------------------------------- /e2e/chaos-mesh/api/v1alpha1/physical_machine_types.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Chaos Mesh Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | package v1alpha1 17 | 18 | import ( 19 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 20 | ) 21 | 22 | // +chaos-mesh:base 23 | 24 | // PhysicalMachine is the Schema for the physical machine API 25 | type PhysicalMachine struct { 26 | metav1.TypeMeta `json:",inline"` 27 | metav1.ObjectMeta `json:"metadata,omitempty"` 28 | 29 | // Spec defines the behavior of a physical machine 30 | Spec PhysicalMachineSpec `json:"spec"` 31 | } 32 | 33 | // PhysicalMachineSpec defines the desired state of PhysicalMachine 34 | type PhysicalMachineSpec struct { 35 | 36 | // Address represents the address of the physical machine 37 | Address string `json:"address"` 38 | } 39 | 40 | // PhysicalMachineList contains a list of PhysicalMachine 41 | type PhysicalMachineList struct { 42 | metav1.TypeMeta `json:",inline"` 43 | metav1.ListMeta `json:"metadata,omitempty"` 44 | Items []PhysicalMachine `json:"items"` 45 | } 46 | -------------------------------------------------------------------------------- /e2e/chaos-mesh/api/v1alpha1/schedule_item.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Chaos Mesh Authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | package v1alpha1 17 | 18 | type ScheduleItem struct { 19 | EmbedChaos `json:",inline"` 20 | Workflow *WorkflowSpec `json:"workflow,omitempty"` 21 | } 22 | -------------------------------------------------------------------------------- /e2e/fixtures/images.go: -------------------------------------------------------------------------------- 1 | /* 2 | * images.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fixtures 22 | 23 | import ( 24 | "strings" 25 | ) 26 | 27 | // prependRegistry if a registry is defined the registry will be prepended. 28 | func prependRegistry(registry string, container string) string { 29 | if registry == "" { 30 | return container 31 | } 32 | 33 | return registry + "/" + container 34 | } 35 | 36 | // GetBaseImageAndTag returns the base image and if present the tag. 37 | func GetBaseImageAndTag(image string) (string, string) { 38 | parts := strings.Split(image, ":") 39 | 40 | if len(parts) == 1 { 41 | return parts[0], "" 42 | } 43 | 44 | return parts[0], parts[1] 45 | } 46 | -------------------------------------------------------------------------------- /e2e/fixtures/random_string.go: -------------------------------------------------------------------------------- 1 | /* 2 | * random_string.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fixtures 22 | 23 | var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz123456789") 24 | 25 | // RandStringRunes randomly generates a string of length n. 26 | func (factory *Factory) RandStringRunes(n int) string { 27 | b := make([]rune, n) 28 | for i := range b { 29 | b[i] = letterRunes[factory.randomGenerator.Intn(len(letterRunes))] 30 | } 31 | return string(b) 32 | } 33 | -------------------------------------------------------------------------------- /e2e/fixtures/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fixtures 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB e2e test fixtures") 33 | } 34 | -------------------------------------------------------------------------------- /e2e/fixtures/versions.go: -------------------------------------------------------------------------------- 1 | /* 2 | * versions.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fixtures 22 | 23 | import ( 24 | fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" 25 | 26 | "github.com/onsi/gomega" 27 | ) 28 | 29 | // VersionsAreProtocolCompatible returns true if versionA and versionB are protocol compatible e.g. a patch upgrade. 30 | func VersionsAreProtocolCompatible(versionA string, versionB string) bool { 31 | aFdbVersion, err := fdbv1beta2.ParseFdbVersion(versionA) 32 | gomega.Expect(err).NotTo(gomega.HaveOccurred()) 33 | bFdbVersion, err := fdbv1beta2.ParseFdbVersion(versionB) 34 | gomega.Expect(err).NotTo(gomega.HaveOccurred()) 35 | 36 | return aFdbVersion.IsProtocolCompatible(bFdbVersion) 37 | } 38 | -------------------------------------------------------------------------------- /e2e/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "log" 4 | 5 | func main() { 6 | log.Println("Run ginkgo test_dir instead.") 7 | } 8 | -------------------------------------------------------------------------------- /e2e/scripts/remove_namespaces: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | if [ $# -eq 0 ] 6 | then 7 | echo -e "Usage: ./remove_namespaces username [namespace prefix]" 8 | exit 9 | fi 10 | 11 | USERNAME=$1 12 | NAMESPACE=${2:-""} 13 | 14 | for ns in $(kubectl get ns --no-headers -o name -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" | awk -F/ '{print $2}'); 15 | do 16 | ( 17 | if [ -n "${NAMESPACE}" ] && [[ "${ns}" != "${NAMESPACE}"* ]] 18 | then 19 | echo skip deleting namespace "${ns}" owned by "${USERNAME}" 20 | continue 21 | fi 22 | 23 | echo "start deleting namespace ${ns}" 24 | 25 | kubectl delete ns --ignore-not-found "${ns}" 26 | ) & 27 | done 28 | wait 29 | 30 | echo "remove all chaos experiments for user" 31 | 32 | kubectl -n chaos-testing delete schedules -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 33 | kubectl -n chaos-testing delete networkchaos -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 34 | kubectl -n chaos-testing delete iochaos -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 35 | kubectl -n chaos-testing delete podchaos -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 36 | kubectl delete clusterrolebinding -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 37 | kubectl delete clusterrole -l "foundationdb.org/user=$USERNAME,foundationdb.org/testing=chaos" --wait=false --ignore-not-found 38 | -------------------------------------------------------------------------------- /e2e/test_operator/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operator 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperator(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-test") 34 | fixtures.RunGinkgoTests(t, "Operator test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_backups/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2018-2024 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorbackup 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperator(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-backup-test") 34 | fixtures.RunGinkgoTests(t, "Operator Backup test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_creation_velocity/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorcreationvelocity 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorCreationVelocity(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-creation-velocity") 34 | fixtures.RunGinkgoTests(t, "Operator creation velocity suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_ha/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorha 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorHA(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-ha") 34 | fixtures.RunGinkgoTests(t, "Operator HA test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_ha_failure/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2018-2024 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorhafailure 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorHA(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-ha-failure") 34 | fixtures.RunGinkgoTests(t, "Operator HA failure test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_ha_flaky_upgrades/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorhaflakyupgrades 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | . "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorHaFlakyUpgrade(t *testing.T) { 32 | SetDefaultEventuallyTimeout(3 * time.Minute) 33 | fixtures.SetTestSuiteName("operator-ha-flaky") 34 | fixtures.RunGinkgoTests(t, "FDB Operator HA Upgrade Test Suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_ha_upgrades/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorhaupgrades 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorHaUpgrade(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(3 * time.Minute) 33 | fixtures.SetTestSuiteName("operator-ha-upgrades") 34 | fixtures.RunGinkgoTests(t, "FDB Operator HA Upgrade Test Suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_maintenance_mode/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2024 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorha 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorMaintenanceMode(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-maintenance-mode") 34 | fixtures.RunGinkgoTests(t, "Operator maintenance mode test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_migrate_image_type/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operator 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorMigrateImageType(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-migrate-image-type") 34 | fixtures.RunGinkgoTests(t, "Operator Migrate Image Type test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_migrations/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatormigration 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorMigrations(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-migrations") 34 | fixtures.RunGinkgoTests(t, "Operator Migration test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_plugin/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operator 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperator(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-plugin-test") 34 | fixtures.RunGinkgoTests(t, "Operator plugin test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_stress/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorstress 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | . "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorStress(t *testing.T) { 32 | SetDefaultEventuallyTimeout(180 * time.Second) 33 | fixtures.SetTestSuiteName("operator-stress") 34 | fixtures.RunGinkgoTests(t, "FDB Operator stress test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_three_data_hall/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2018-2024 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operator 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperator(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-test-3dh") 34 | fixtures.RunGinkgoTests(t, "Operator three data hall test suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_upgrades/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorupgrades 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | . "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorUpgrade(t *testing.T) { 32 | SetDefaultEventuallyTimeout(3 * time.Minute) 33 | fixtures.SetTestSuiteName("operator-upgrades") 34 | fixtures.RunGinkgoTests(t, "FDB Operator Upgrade Test Suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_upgrades_variations/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorupgradesvariations 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | . "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorUpgradesVariations(t *testing.T) { 32 | SetDefaultEventuallyTimeout(3 * time.Minute) 33 | fixtures.SetTestSuiteName("operator-upgrades-variations") 34 | fixtures.RunGinkgoTests(t, "FDB Operator Upgrade variations Test Suite") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_upgrades_with_chaos/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorupgradeschaosmesh 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | . "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorUpgradesWithChaos(t *testing.T) { 32 | SetDefaultEventuallyTimeout(3 * time.Minute) 33 | fixtures.SetTestSuiteName("operator-upgrades-with-chaos") 34 | fixtures.RunGinkgoTests(t, "FDB Operator Upgrade Test Suite with chaos-mesh") 35 | } 36 | -------------------------------------------------------------------------------- /e2e/test_operator_velocity/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package operatorvelocity 22 | 23 | import ( 24 | "testing" 25 | "time" 26 | 27 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures" 28 | "github.com/onsi/gomega" 29 | ) 30 | 31 | func TestOperatorVelocity(t *testing.T) { 32 | gomega.SetDefaultEventuallyTimeout(10 * time.Second) 33 | fixtures.SetTestSuiteName("operator-velocity") 34 | fixtures.RunGinkgoTests(t, "Operator velocity test Suite") 35 | } 36 | -------------------------------------------------------------------------------- /fdbclient/doc.go: -------------------------------------------------------------------------------- 1 | // Package fdbclient provides code for interacting with a real FoundationDB 2 | // cluster. 3 | package fdbclient 4 | -------------------------------------------------------------------------------- /fdbclient/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fdbclient 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB client") 33 | } 34 | -------------------------------------------------------------------------------- /foundationdb-kubernetes-sidecar/Readme.md: -------------------------------------------------------------------------------- 1 | # FoundationDB Kubernetes sidecar 2 | 3 | The FoundationDB Kubernetes sidecar moved to the [official FoundationDB repository](https://github.com/apple/foundationdb/blob/main/packaging/docker/sidecar.py). 4 | For any modifications please raise an issue against the current release branch. 5 | If you want to see if a specific change is in a version of the FoundationDB Kubernetes sidecar just use the corresponding tag. 6 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2020 FoundationDB project authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /internal/Readme.md: -------------------------------------------------------------------------------- 1 | # Internal package 2 | 3 | This package can't be included by external repositories. 4 | We will maintain methods/functions here that should be shared between our different implementations (e.g. `kubectl-fdb` and the `controller`). 5 | We mark these methods internal to prevent external usage, since we don't give any guarantees for backwards compatibility. 6 | -------------------------------------------------------------------------------- /internal/buggify/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2022 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package buggify 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB buggify") 33 | } 34 | -------------------------------------------------------------------------------- /internal/coordination/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2018-2025 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package coordination 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB Coordination") 33 | } 34 | -------------------------------------------------------------------------------- /internal/locality/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2022 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package locality 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB locality") 33 | } 34 | -------------------------------------------------------------------------------- /internal/maintenance/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2024 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package maintenance 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "maintenance") 33 | } 34 | -------------------------------------------------------------------------------- /internal/process_class.go: -------------------------------------------------------------------------------- 1 | /* 2 | * process_class.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package internal 22 | 23 | import ( 24 | fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" 25 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | ) 27 | 28 | // ProcessClassFromLabels extracts the ProcessClass label from the metav1.ObjectMeta.Labels map 29 | func ProcessClassFromLabels( 30 | cluster *fdbv1beta2.FoundationDBCluster, 31 | labels map[string]string, 32 | ) fdbv1beta2.ProcessClass { 33 | return fdbv1beta2.ProcessClass(labels[cluster.GetProcessClassLabel()]) 34 | } 35 | 36 | // GetProcessClassFromMeta fetches the process class from an object's metadata. 37 | func GetProcessClassFromMeta( 38 | cluster *fdbv1beta2.FoundationDBCluster, 39 | metadata v1.ObjectMeta, 40 | ) fdbv1beta2.ProcessClass { 41 | return ProcessClassFromLabels(cluster, metadata.Labels) 42 | } 43 | -------------------------------------------------------------------------------- /internal/removals/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package removals 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "removals") 33 | } 34 | -------------------------------------------------------------------------------- /internal/replacements/suite_test.go: -------------------------------------------------------------------------------- 1 | package replacements 2 | 3 | import ( 4 | "testing" 5 | 6 | fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" 7 | mockclient "github.com/FoundationDB/fdb-kubernetes-operator/v2/mock-kubernetes-client/client" 8 | "k8s.io/client-go/kubernetes/scheme" 9 | logf "sigs.k8s.io/controller-runtime/pkg/log" 10 | "sigs.k8s.io/controller-runtime/pkg/log/zap" 11 | 12 | . "github.com/onsi/ginkgo/v2" 13 | . "github.com/onsi/gomega" 14 | ) 15 | 16 | func TestCmd(t *testing.T) { 17 | RegisterFailHandler(Fail) 18 | RunSpecs(t, "Replacements Suite") 19 | } 20 | 21 | var k8sClient *mockclient.MockClient 22 | 23 | var _ = BeforeSuite(func() { 24 | logf.SetLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(GinkgoWriter))) 25 | 26 | Expect(scheme.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) 27 | Expect(fdbv1beta2.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) 28 | k8sClient = mockclient.NewMockClient(scheme.Scheme) 29 | }) 30 | 31 | var _ = AfterEach(func() { 32 | k8sClient.Clear() 33 | }) 34 | -------------------------------------------------------------------------------- /internal/restarts/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2022 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package restarts 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "Restarts Suite") 33 | } 34 | -------------------------------------------------------------------------------- /internal/service_helper.go: -------------------------------------------------------------------------------- 1 | /* 2 | * service_helper.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package internal 22 | 23 | import ( 24 | fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2" 25 | corev1 "k8s.io/api/core/v1" 26 | ) 27 | 28 | // GetHeadlessService builds a headless service for a FoundationDB cluster. 29 | func GetHeadlessService(cluster *fdbv1beta2.FoundationDBCluster) *corev1.Service { 30 | if !cluster.NeedsHeadlessService() { 31 | return nil 32 | } 33 | 34 | service := &corev1.Service{ 35 | ObjectMeta: GetObjectMetadata(cluster, nil, "", ""), 36 | } 37 | service.ObjectMeta.Name = cluster.ObjectMeta.Name 38 | service.Spec.ClusterIP = "None" 39 | service.Spec.Selector = cluster.GetMatchLabels() 40 | 41 | if cluster.IsPodIPFamily6() { 42 | service.Spec.IPFamilies = []corev1.IPFamily{corev1.IPv6Protocol} 43 | } 44 | 45 | return service 46 | } 47 | -------------------------------------------------------------------------------- /internal/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package internal 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB internal") 33 | } 34 | -------------------------------------------------------------------------------- /kubectl-fdb/cmd/get.go: -------------------------------------------------------------------------------- 1 | /* 2 | * get.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package cmd 22 | 23 | import ( 24 | "k8s.io/cli-runtime/pkg/genericclioptions" 25 | 26 | "github.com/spf13/cobra" 27 | ) 28 | 29 | func newGetCmd(streams genericclioptions.IOStreams) *cobra.Command { 30 | o := newFDBOptions(streams) 31 | 32 | cmd := &cobra.Command{ 33 | Use: "get", 34 | Short: "Subcommand to get resources from a given cluster", 35 | Long: "Subcommand to get resources from a given cluster", 36 | RunE: func(c *cobra.Command, _ []string) error { 37 | return c.Help() 38 | }, 39 | Example: ` 40 | # Get the configuration string from cluster c1 41 | kubectl fdb get configuration c1 42 | 43 | # Get the configuration string from cluster c1 in the namespace default 44 | kubectl fdb -n default get configuration c1 45 | `, 46 | } 47 | cmd.SetOut(o.Out) 48 | cmd.SetErr(o.ErrOut) 49 | cmd.SetIn(o.In) 50 | 51 | cmd.AddCommand(newConfigurationCmd(streams)) 52 | cmd.AddCommand(newExclusionStatusCmd(streams)) 53 | o.configFlags.AddFlags(cmd.Flags()) 54 | 55 | return cmd 56 | } 57 | -------------------------------------------------------------------------------- /kubectl-fdb/cmd/restart_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * restart_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package cmd 22 | 23 | import ( 24 | "bytes" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | "k8s.io/cli-runtime/pkg/genericclioptions" 29 | ) 30 | 31 | var _ = Describe("[plugin] root command", func() { 32 | When("running the root command without args", func() { 33 | var outBuffer bytes.Buffer 34 | var errBuffer bytes.Buffer 35 | var inBuffer bytes.Buffer 36 | 37 | BeforeEach(func() { 38 | // We use these buffers to check the input/output 39 | outBuffer = bytes.Buffer{} 40 | errBuffer = bytes.Buffer{} 41 | inBuffer = bytes.Buffer{} 42 | }) 43 | 44 | It("should not throw an error", func() { 45 | cmd := NewRootCmd( 46 | genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, 47 | &MockVersionChecker{}, 48 | ) 49 | 50 | args := []string{"restart", "-c", "sample"} 51 | cmd.SetArgs(args) 52 | Expect(cmd.Execute()).NotTo(HaveOccurred()) 53 | }) 54 | }) 55 | }) 56 | -------------------------------------------------------------------------------- /kubectl-fdb/cmd/root_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * root_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package cmd 22 | 23 | import ( 24 | "bytes" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | "k8s.io/cli-runtime/pkg/genericclioptions" 29 | ) 30 | 31 | var _ = Describe("[plugin] root command", func() { 32 | When("running the root command without args", func() { 33 | var outBuffer bytes.Buffer 34 | var errBuffer bytes.Buffer 35 | var inBuffer bytes.Buffer 36 | 37 | BeforeEach(func() { 38 | // We use these buffers to check the input/output 39 | outBuffer = bytes.Buffer{} 40 | errBuffer = bytes.Buffer{} 41 | inBuffer = bytes.Buffer{} 42 | }) 43 | 44 | It("should not throw an error", func() { 45 | cmd := NewRootCmd( 46 | genericclioptions.IOStreams{In: &inBuffer, Out: &outBuffer, ErrOut: &errBuffer}, 47 | &MockVersionChecker{}, 48 | ) 49 | cmd.SetArgs([]string{}) 50 | Expect(cmd.Execute()).NotTo(HaveOccurred()) 51 | }) 52 | }) 53 | }) 54 | -------------------------------------------------------------------------------- /kubectl-fdb/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * main.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2020 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package main 22 | 23 | import ( 24 | "os" 25 | 26 | "github.com/FoundationDB/fdb-kubernetes-operator/v2/kubectl-fdb/cmd" 27 | "github.com/spf13/pflag" 28 | "k8s.io/cli-runtime/pkg/genericclioptions" 29 | _ "k8s.io/client-go/plugin/pkg/client/auth" 30 | ) 31 | 32 | func main() { 33 | flags := pflag.NewFlagSet("kubectl-fdb", pflag.ExitOnError) 34 | pflag.CommandLine = flags 35 | root := cmd.NewRootCmd( 36 | genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}, 37 | &cmd.RealVersionChecker{}, 38 | ) 39 | if err := root.Execute(); err != nil { 40 | os.Exit(1) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /logs/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | -------------------------------------------------------------------------------- /mock-kubernetes-client/client/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * doc.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | // Package client provides a mock Kubernetes client for use in testing 22 | // controllers. 23 | package client 24 | -------------------------------------------------------------------------------- /mock-kubernetes-client/client/suite_test.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestCmd(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Mock Kubernetes client") 13 | } 14 | -------------------------------------------------------------------------------- /pkg/fdbstatus/fdb_status_helper.go: -------------------------------------------------------------------------------- 1 | /* 2 | * fdb_status_helper.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2022 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fdbstatus 22 | 23 | import ( 24 | "fmt" 25 | "strings" 26 | ) 27 | 28 | // RemoveWarningsInJSON removes any warning messages that might appear in the status output from the fdbcli and returns 29 | // the JSON output without the warning message. 30 | func RemoveWarningsInJSON(jsonString string) ([]byte, error) { 31 | idx := strings.Index(jsonString, "{") 32 | if idx == -1 { 33 | return nil, fmt.Errorf("the JSON string doesn't contain a starting '{'") 34 | } 35 | 36 | return []byte(strings.TrimSpace(jsonString[idx:])), nil 37 | } 38 | -------------------------------------------------------------------------------- /pkg/fdbstatus/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package fdbstatus 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "FDB status") 33 | } 34 | -------------------------------------------------------------------------------- /pkg/podclient/pod_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | * pod_client.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2018-2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package podclient 22 | 23 | // FdbPodClient provides methods for working with a FoundationDB pod 24 | type FdbPodClient interface { 25 | // IsPresent checks whether a file is present. 26 | IsPresent(path string) (bool, error) 27 | 28 | // UpdateFile checks if a file is up-to-date and tries to update it. 29 | UpdateFile(name string, contents string) (bool, error) 30 | 31 | // GetVariableSubstitutions gets the current keys and values that this 32 | // process group will substitute into its monitor conf. 33 | GetVariableSubstitutions() (map[string]string, error) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/podmanager/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2021 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package podmanager 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "Pod manager") 33 | } 34 | -------------------------------------------------------------------------------- /sample-apps/data-loader/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.io/library/python:3.13-slim 2 | 3 | ARG TARGETARCH 4 | 5 | COPY app.py /usr/local/bin 6 | 7 | RUN pip install foundationdb==7.1.67 8 | RUN groupadd --gid 4059 fdb && \ 9 | useradd --gid 4059 --uid 4059 --shell /usr/sbin/nologin fdb 10 | 11 | RUN apt-get update && \ 12 | apt-get install -y --no-install-recommends curl && \ 13 | curl -L https://github.com/krallin/tini/releases/download/v0.19.0/tini-${TARGETARCH} -o tini-${TARGETARCH} && \ 14 | echo "93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c tini-amd64\n07952557df20bfd2a95f9bef198b445e006171969499a1d361bd9e6f8e5e0e81 tini-arm64" > tini-sha.txt && \ 15 | sha256sum --quiet --ignore-missing -c tini-sha.txt && \ 16 | chmod +x tini-${TARGETARCH} && \ 17 | mv tini-${TARGETARCH} /usr/bin/tini && \ 18 | rm -rf /tmp/* 19 | 20 | # Set to the numeric UID of fdb user to satisfy PodSecurityPolices which enforce runAsNonRoot 21 | USER 4059 22 | 23 | ENTRYPOINT [ "/usr/bin/tini", "-g", "--", "python", "/usr/local/bin/app.py" ] 24 | -------------------------------------------------------------------------------- /sample-apps/data-loader/app.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | 3 | """ 4 | This file provides a sample app for loading data into FDB. 5 | 6 | To use it to load data into one of the sample clusters in this repo, 7 | you can build the image by running `docker build -t fdb-data-loader sample-apps/data-loader`, 8 | and then run the data loader by running `kubectl apply -f sample-apps/data-loader/job.yaml` 9 | """ 10 | 11 | import argparse 12 | import random 13 | import uuid 14 | import fdb 15 | 16 | fdb.api_version(600) 17 | 18 | 19 | @fdb.transactional 20 | def write_batch(tr, batch_size, value_size): 21 | prefix = uuid.uuid4() 22 | for index in range(1, batch_size + 1): 23 | tr[fdb.tuple.pack((prefix, index))] = random.randbytes(value_size) 24 | 25 | 26 | def load_data(keys, batch_size, value_size): 27 | batch_count = int(keys / batch_size) 28 | 29 | db = fdb.open() 30 | for batch in range(1, batch_count + 1): 31 | print("Writing batch %d" % batch) 32 | write_batch(db, batch_size, value_size) 33 | 34 | 35 | if __name__ == "__main__": 36 | parser = argparse.ArgumentParser(description="Load random data into FDB") 37 | parser.add_argument( 38 | "--keys", type=int, help="Number of keys to generate", default=100000 39 | ) 40 | parser.add_argument( 41 | "--batch-size", 42 | type=int, 43 | help="Number of keys to write in each transaction", 44 | default=10, 45 | ) 46 | parser.add_argument( 47 | "--value-size", 48 | type=int, 49 | help="Number of bytes to include in each value", 50 | default=1000, 51 | ) 52 | args = parser.parse_args() 53 | 54 | load_data(args.keys, args.batch_size, args.value_size) 55 | -------------------------------------------------------------------------------- /sample-apps/data-loader/job.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1 2 | kind: Job 3 | metadata: 4 | name: fdb-data-loader 5 | spec: 6 | backoffLimit: 2 7 | template: 8 | spec: 9 | containers: 10 | - image: foundationdb/fdb-data-loader:latest 11 | imagePullPolicy: IfNotPresent 12 | name: fdb-data-loader 13 | env: 14 | - name: FDB_CLUSTER_FILE 15 | value: /var/dynamic-conf/fdb.cluster 16 | - name: FDB_NETWORK_OPTION_TRACE_LOG_GROUP 17 | value: fdb-data-loader 18 | - name: FDB_NETWORK_OPTION_EXTERNAL_CLIENT_DIRECTORY 19 | value: /var/dynamic-conf/lib/multiversion 20 | - name: LD_LIBRARY_PATH 21 | value: /var/dynamic-conf/lib 22 | volumeMounts: 23 | - name: dynamic-conf 24 | mountPath: /var/dynamic-conf 25 | initContainers: 26 | - name: foundationdb-kubernetes-init 27 | image: foundationdb/foundationdb-kubernetes-sidecar:6.3.3-1 28 | args: 29 | - "--copy-file" 30 | - "fdb.cluster" 31 | - "--copy-library" 32 | - "6.3" 33 | - "--copy-library" 34 | - "6.2" 35 | - "--init-mode" 36 | - "--require-not-empty" 37 | - "fdb.cluster" 38 | volumeMounts: 39 | - name: config-map 40 | mountPath: /var/input-files 41 | - name: dynamic-conf 42 | mountPath: /var/output-files 43 | restartPolicy: Never 44 | volumes: 45 | - name: config-map 46 | configMap: 47 | name: test-cluster-config 48 | items: 49 | - key: cluster-file 50 | path: fdb.cluster 51 | - name: dynamic-conf 52 | emptyDir: {} 53 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | *.kubeconfig 2 | -------------------------------------------------------------------------------- /scripts/cluster1.yml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | networking: 4 | podSubnet: "10.10.0.0/16" 5 | serviceSubnet: "10.11.0.0/16" 6 | nodes: 7 | - role: control-plane 8 | image: kindest/node:${KUBE_VERSION} 9 | -------------------------------------------------------------------------------- /scripts/cluster2.yml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | networking: 4 | podSubnet: "10.12.0.0/16" 5 | serviceSubnet: "10.13.0.0/16" 6 | nodes: 7 | - role: control-plane 8 | image: kindest/node:${KUBE_VERSION} 9 | -------------------------------------------------------------------------------- /scripts/cluster3.yml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | networking: 4 | podSubnet: "10.14.0.0/16" 5 | serviceSubnet: "10.15.0.0/16" 6 | nodes: 7 | - role: control-plane 8 | image: kindest/node:${KUBE_VERSION} 9 | -------------------------------------------------------------------------------- /scripts/cluster4.yml: -------------------------------------------------------------------------------- 1 | kind: Cluster 2 | apiVersion: kind.x-k8s.io/v1alpha4 3 | networking: 4 | podSubnet: "10.16.0.0/16" 5 | serviceSubnet: "10.17.0.0/16" 6 | nodes: 7 | - role: control-plane 8 | image: kindest/node:${KUBE_VERSION} 9 | -------------------------------------------------------------------------------- /scripts/setup_container.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | 4 | # We have to install the FDB client libraries 5 | export FDB_VERSION=6.2.29 6 | export FDB_WEBSITE=https://github.com/apple/foundationdb/releases/download 7 | curl --fail -L ${FDB_WEBSITE}/${FDB_VERSION}/foundationdb-clients_${FDB_VERSION}-1_amd64.deb -o /tmp/fdb.deb && dpkg -i /tmp/fdb.deb && rm /tmp/fdb.deb 8 | # Some tests require the presence of kubectl, for more information about the installation see: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/ 9 | curl -L "https://dl.k8s.io/release/v1.24.3/bin/linux/amd64/kubectl" -o /tmp/kubectl 10 | curl -L "https://dl.k8s.io/v1.24.3/bin/linux/amd64/kubectl.sha256" -o /tmp/kubectl.sha256 11 | echo "$(cat /tmp/kubectl.sha256) /tmp/kubectl" | sha256sum --check 12 | install -o root -g root -m 0755 /tmp/kubectl /usr/local/bin/kubectl 13 | # Install Kind to run a Kubernetes cluster inside the container 14 | # TODO (johscheuer): We have to add some additional steps to make that work. 15 | curl -Lo /tmp/kind https://kind.sigs.k8s.io/dl/v0.14.0/kind-linux-amd64 16 | chmod +x /tmp/kind 17 | mv /tmp/kind /usr/local/bin/kind 18 | 19 | exec bash 20 | -------------------------------------------------------------------------------- /setup/suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * suite_test.go 3 | * 4 | * This source file is part of the FoundationDB open source project 5 | * 6 | * Copyright 2023 Apple Inc. and the FoundationDB project authors 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package setup 22 | 23 | import ( 24 | "testing" 25 | 26 | . "github.com/onsi/ginkgo/v2" 27 | . "github.com/onsi/gomega" 28 | ) 29 | 30 | func TestCmd(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "setup") 33 | } 34 | --------------------------------------------------------------------------------