Skip to content

Commit

Permalink
add prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat committed Sep 24, 2024
1 parent afa98f3 commit 40dbd8d
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 190 deletions.
33 changes: 9 additions & 24 deletions pulumi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pulumi
from pulumi_kubernetes import Provider

from core.deployment import initialize_pulumi, deploy_module
from core.deployment import initialize_pulumi, deploy_modules
from core.config import export_results

def main():
Expand All @@ -19,7 +19,14 @@ def main():
default_versions = init["default_versions"]
global_depends_on = init["global_depends_on"]

modules_to_deploy = ["cert_manager", "kubevirt", "multus", "hostpath_provisioner", "containerized_data_importer"]
modules_to_deploy = [
"cert_manager",
"kubevirt",
"multus",
"hostpath_provisioner",
"containerized_data_importer",
"prometheus"
]

deploy_modules(
modules_to_deploy,
Expand All @@ -38,27 +45,5 @@ def main():
pulumi.log.error(f"Deployment failed: {str(e)}")
raise

def deploy_modules(
modules: List[str],
config: pulumi.Config,
default_versions: Dict[str, Any],
global_depends_on: List[pulumi.Resource],
k8s_provider: Provider,
versions: Dict[str, str],
configurations: Dict[str, Dict[str, Any]],
) -> None:

for module_name in modules:
pulumi.log.info(f"Deploying module: {module_name}")
deploy_module(
module_name=module_name,
config=config,
default_versions=default_versions,
global_depends_on=global_depends_on,
k8s_provider=k8s_provider,
versions=versions,
configurations=configurations,
)

if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pulumi/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"multus": True,
"hostpath_provisioner": True,
"containerized_data_importer": True,
"prometheus": True,
}


Expand Down
22 changes: 22 additions & 0 deletions pulumi/core/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,25 @@ def discover_deploy_function(module_name: str) -> Callable:
if not deploy_function:
raise ValueError(f"No deploy function named '{function_name}' found in modules.{module_name}.deploy")
return deploy_function

def deploy_modules(
modules: List[str],
config: pulumi.Config,
default_versions: Dict[str, Any],
global_depends_on: List[pulumi.Resource],
k8s_provider: Provider,
versions: Dict[str, str],
configurations: Dict[str, Dict[str, Any]],
) -> None:

for module_name in modules:
pulumi.log.info(f"Deploying module: {module_name}")
deploy_module(
module_name=module_name,
config=config,
default_versions=default_versions,
global_depends_on=global_depends_on,
k8s_provider=k8s_provider,
versions=versions,
configurations=configurations,
)
Loading

0 comments on commit 40dbd8d

Please sign in to comment.