GKERecoveryService#

class phalanx.services.gke_recovery.GKERecoveryService(*, source_cluster, destination_cluster, environment, git_branch, google_cloud_service, new_cluster_service, old_cluster_service, recovery_environment_service, source_environment_service, vault_credentials)#

Bases: object

Service to coordinate other services for cluster recovery.

Parameters:
  • source_cluster (str) – The Google Cloud name of the old cluster.

  • destination_cluster (str) – The Google Cloud name of the new cluster.

  • environment (str) – The name of the Phalanx environment to load config from.

  • git_branch (str) – The name of the Git branch to sync from in ArgoCD.

  • google_cloud_service (GoogleCloudService) – Performs operations on Google Cloud resources.

  • old_cluster_service (GKEPhalanxClusterService) – Performs kubectl operations against the old cluster.

  • new_cluster_service (GKEPhalanxClusterService) – Performs kubectl operations against the new cluster.

  • recovery_environment_service (RecoveryEnvironmentService) – Performs ArgoCD and Helm operations (and some kubectl operations) against the new cluster.

  • source_environment_service (RecoveryEnvironmentService) – Performs ArgoCD operations against the source cluster.

  • vault_credentials (VaultCredentials) – Credentials to read from the Vault instance that backs the cluster environment.

Methods Summary

preflight_check()

Check that everything is in a good state to start recovery.

recover()

Backup a GKE cluster and restore it to a new cluster.

Methods Documentation

preflight_check()#

Check that everything is in a good state to start recovery.

Returns:

Any errors that the preflight check found.

Return type:

list[str]

recover()#

Backup a GKE cluster and restore it to a new cluster.

This works by using Backup for GKE to back up the persistent data in the old cluster, then restore it to the new cluster, then using the Phalanx install functionality to install all of the workloads on the new cluster.

Return type:

None