Factory#
- class phalanx.factory.Factory(path)#
Bases:
objectFactory to create Phalanx components.
- Parameters:
path (
Path) – Path to the root of the Phalanx configuration tree.
Methods Summary
Create service for manipulating Phalanx applications.
Create storage layer for the Phalanx configuration.
Create service for manipulating Phalanx environments.
create_gke_phalanx_cluster_service(context)Create a service for manipulating Kubernetes clusters directly.
create_gke_recovery_service(*, ...)Create a service for recovering GKE Phalanx clusters from backups.
create_google_cloud_service(region, project, ...)Create a service for accessing the Google Cloud API.
create_kubernetes_storage([context])Create storage object for interacting with Kubernetes.
Create storage object for interacting with 1Password.
create_recovery_environment_service(context)Create service for help with recovering Phalanx environments.
Create service for manipulating Phalanx secrets.
Create service for managing Vault tokens and policies.
Methods Documentation
- create_application_service()#
Create service for manipulating Phalanx applications.
- Returns:
Service for manipulating applications.
- Return type:
- create_config_storage()#
Create storage layer for the Phalanx configuration.
- Returns:
Storage service for loading the Phalanx configuration.
- Return type:
- create_environment_service()#
Create service for manipulating Phalanx environments.
- Parameters:
context – The Kubernetes context to pass to all commands. If this is None, then the current context will be used.
- Returns:
Service for manipulating environments.
- Return type:
- create_gke_phalanx_cluster_service(context)#
Create a service for manipulating Kubernetes clusters directly.
- Parameters:
context (
str) – The Kubernetes context to pass to all kubectl commands.- Returns:
A service object for manipulating resources in a Phalanx cluster.
- Return type:
- create_gke_recovery_service(*, source_cluster, destination_cluster, git_branch, environment, vault_credentials, old_context, new_context, gke_project, gke_region, run_id)#
Create a service for recovering GKE Phalanx clusters from backups.
- Returns:
A service object for doing cluster recovery.
- Return type:
- Parameters:
- create_google_cloud_service(region, project, phalanx_run_id)#
Create a service for accessing the Google Cloud API.
This service is scoped to running operations in a single region and project.
- Parameters:
region (
str) – The Google Cloud region to run comands against.project (
str) – The Google Cloud project to run comands against.phalanx_run_id (
str) – An identifier to put in thephalanx-runlabel on every Google Cloud resource that is created with this service. This is helpful in resuming backup and restore process after a Google Cloud operation fails (which does happen intermittently), and in cleaning up these resources later.
- Returns:
A service object for manipulating Google Cloud resources.
- Return type:
- create_kubernetes_storage(context=None)#
Create storage object for interacting with Kubernetes.
- create_onepassword_storage()#
Create storage object for interacting with 1Password.
- Returns:
Storage object for interacting with 1Password.
- Return type:
- create_recovery_environment_service(context)#
Create service for help with recovering Phalanx environments.
- Parameters:
context (
str) – The Kubernetes context to pass to all commands.- Returns:
Service for helping to recover environments.
- Return type:
- create_secrets_service()#
Create service for manipulating Phalanx secrets.
- Returns:
Service for manipulating secrets.
- Return type:
- create_vault_service()#
Create service for managing Vault tokens and policies.
- Returns:
Service for managing Vault tokens and policies.
- Return type: