MAIA.maia_admin module#

MAIA.maia_admin.create_harbor_values(config_folder, project_id, cluster_config_dict)[source]#

Create and save Harbor values configuration for a given project and cluster configuration.

Parameters:
  • config_folder (str) – The path to the configuration folder where the Harbor values file will be saved.

  • project_id (str) – The unique identifier for the project.

  • cluster_config_dict (dict) –

    A dictionary containing cluster configuration details, including:
    • domain (str): The domain name for the Harbor registry.

    • ingress_class (str): The ingress class to be used (e.g., “maia-core-traefik”, “nginx”).

    • traefik_resolver (str, optional): The Traefik resolver to be used if ingress_class is “maia-core-traefik”.

Returns:

dict – A dictionary containing the following keys: - namespace (str): The Kubernetes namespace for Harbor. - release (str): The release name for the Harbor Helm chart. - chart (str): The name of the Harbor Helm chart. - repo (str): The URL of the Harbor Helm chart repository. - version (str): The version of the Harbor Helm chart. - values (str): The path to the generated Harbor values YAML file.

MAIA.maia_admin.create_keycloak_values(config_folder, project_id, cluster_config_dict)[source]#

Generates Keycloak Helm chart values and writes them to a YAML file.

Parameters:
  • config_folder (str) – The path to the configuration folder where the YAML file will be saved.

  • project_id (str) – The project identifier used to create a unique namespace and release name.

  • cluster_config_dict (dict) – A dictionary containing cluster configuration details such as domain, ingress class, and traefik resolver.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_maia_admin_toolkit_values(config_folder, project_id, cluster_config_dict)[source]#

Creates and writes the MAIA admin toolkit values to a YAML file.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The project identifier.

  • cluster_config_dict (dict) – Dictionary containing cluster configuration values.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_maia_dashboard_values(config_folder, project_id, cluster_config_dict)[source]#

Create MAIA dashboard values for Helm chart deployment.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The project identifier.

  • cluster_config_dict (dict) – Dictionary containing cluster configuration details.

Returns:

dict – A dictionary containing the namespace, release name, chart name, repository URL, chart version, and the path to the generated values YAML file.

MAIA.maia_admin.create_rancher_values(config_folder, project_id, cluster_config_dict)[source]#

Generates Rancher values configuration and writes it to a YAML file.

Parameters:
  • config_folder (str) – The path to the configuration folder.

  • project_id (str) – The project identifier.

  • cluster_config_dict (dict) – A dictionary containing cluster configuration details.

Returns:

dict – A dictionary containing Rancher deployment details including namespace, repo URL, chart version, values file path, release name, and chart name.

MAIA.maia_admin.get_maia_toolkit_apps(group_id, password, argo_cd_host)[source]#

Retrieve and print information about a specific project and its associated applications from Argo CD.

Parameters:
  • group_id (str) – The group identifier used to construct project and application names.

  • password (str) – The authorization token for accessing the Argo CD API.

  • argo_cd_host (str) – The host URL of the Argo CD server.

Returns:

list – A list of dictionaries containing the name and version of each application. Each dictionary has the following keys: - name (str): The name of the application. - version (str): The version of the application.

Example

apps = get_maia_toolkit_apps(“maia-core”, “password”, “http://localhost:8080”) logger.info(f”Apps: {apps}”)

async MAIA.maia_admin.install_maia_project(group_id, values_file, argo_cd_namespace, project_chart, project_repo=None, project_version=None, json_key_path=None)[source]#

Installs or upgrades a MAIA project using the specified Helm chart and values file.

Parameters:
  • group_id (str) – The group ID for the project. This will be used as the release name.

  • values_file (str) – Path to the YAML file containing the values for the Helm chart.

  • argo_cd_namespace (str) – The namespace in which to install the project.

  • project_chart (str) – The name of the Helm chart to use for the project.

  • project_repo (str, optional) – The repository URL where the Helm chart is located. Defaults to None.

  • project_version (str, optional) – The version of the Helm chart to use. Defaults to None.

  • json_key_path (str, optional) – Path to the JSON key file for authentication with the Helm registry. Defaults to None.

Returns:

None

Raises:
  • FileNotFoundError – If the values file does not exist.

  • yaml.YAMLError – If there is an error parsing the values file.

  • Exception – If there is an error during the installation or upgrade process.