1+ import pulumi
12from pulumi import ComponentResource , ResourceOptions
23from pulumi_kubernetes .core .v1 import (
34 Namespace ,
78)
89from pulumi_kubernetes .helm .v3 import Release , ReleaseArgs
910from pulumi_kubernetes .meta .v1 import ObjectMetaArgs
10- from pulumi_kubernetes . yaml import ConfigFile
11+
1112
1213from enums import K8sEnvironment
1314
1415
1516class MonitoringArgs :
16- def __init__ (self , k8s_environment : K8sEnvironment ):
17+ def __init__ (self , config : pulumi .config .Config , k8s_environment : K8sEnvironment ):
18+ self .config = config
1719 self .k8s_environment = k8s_environment
1820
1921
@@ -42,7 +44,7 @@ def __init__(
4244 "monitoring-operator" ,
4345 ReleaseArgs (
4446 chart = "kube-prometheus-stack" ,
45- version = "81.6.3 " ,
47+ version = "82.0.0 " ,
4648 repository_opts = {
4749 "repo" : "https://prometheus-community.github.io/helm-charts"
4850 },
@@ -62,8 +64,50 @@ def __init__(
6264 },
6365 namespace = monitoring_ns .metadata .name ,
6466 create_namespace = False ,
67+ values = {
68+ "deploymentMode" : "SingleBinary" ,
69+ "loki" : {
70+ "auth_enabled" : False ,
71+ "commonConfig" : {
72+ "replication_factor" : 1 ,
73+ },
74+ "singleBinary" : {
75+ "replicas" : 1 ,
76+ "resources" : {
77+ "requests" : {"cpu" : "500m" , "memory" : "512Mi" }
78+ },
79+ "persistence" : {
80+ "enabled" : True ,
81+ "size" : "10Gi" ,
82+ "storageClassName" : "default" ,
83+ },
84+ },
85+ "storage" : {
86+ "type" : "azure" ,
87+ "azure" : {
88+ "connectionString" : args .config .require (
89+ "azure_storage_connection_string"
90+ ),
91+ },
92+ "bucketNames" : {
93+ "chunks" : "loki-chunks" ,
94+ "ruler" : "loki-ruler" ,
95+ },
96+ },
97+ "useTestSchema" : True ,
98+ },
99+ "chunksCache" : {
100+ "enabled" : False ,
101+ },
102+ "resultsCache" : {
103+ "enabled" : False ,
104+ },
105+ },
106+ ),
107+ opts = ResourceOptions .merge (
108+ child_opts ,
109+ ResourceOptions (depends_on = [prometheus_operator ]),
65110 ),
66- opts = child_opts ,
67111 )
68112 case K8sEnvironment .DAWN :
69113 # The namespace is already created on Dawn
0 commit comments