@@ -14,21 +14,23 @@ use stackable_operator::{
1414 kube:: { runtime:: reflector:: ObjectRef , CustomResource } ,
1515 product_config:: flask_app_config_writer:: { FlaskAppConfigOptions , PythonType } ,
1616 product_config_utils:: { ConfigError , Configuration } ,
17+ product_logging:: { self , spec:: Logging } ,
1718 role_utils:: { Role , RoleGroupRef } ,
1819 schemars:: { self , JsonSchema } ,
1920} ;
20- use std:: { collections:: BTreeMap , num :: ParseIntError } ;
21+ use std:: collections:: BTreeMap ;
2122use strum:: { Display , EnumIter , EnumString , IntoEnumIterator } ;
2223
2324pub const APP_NAME : & str = "superset" ;
24-
25+ pub const CONFIG_DIR : & str = "/stackable/config" ;
26+ pub const LOG_CONFIG_DIR : & str = "/stackable/log_config" ;
27+ pub const LOG_DIR : & str = "/stackable/log" ;
2528pub const PYTHONPATH : & str = "/stackable/app/pythonpath" ;
2629pub const SUPERSET_CONFIG_FILENAME : & str = "superset_config.py" ;
30+ pub const LOG_VOLUME_SIZE_IN_MIB : u32 = 10 ;
2731
2832#[ derive( Debug , Snafu ) ]
2933pub enum Error {
30- #[ snafu( display( "invalid int config value" ) ) ]
31- InvalidIntConfigValue { source : ParseIntError } ,
3234 #[ snafu( display( "unknown Superset role found {role}. Should be one of {roles:?}" ) ) ]
3335 UnknownSupersetRole { role : String , roles : Vec < String > } ,
3436 #[ snafu( display( "fragment validation failure" ) ) ]
@@ -44,6 +46,7 @@ pub enum SupersetConfigOptions {
4446 RowLimit ,
4547 MapboxApiKey ,
4648 SupersetWebserverTimeout ,
49+ LoggingConfigurator ,
4750 AuthType ,
4851 AuthUserRegistration ,
4952 AuthUserRegistrationRole ,
@@ -89,6 +92,7 @@ impl FlaskAppConfigOptions for SupersetConfigOptions {
8992 SupersetConfigOptions :: RowLimit => PythonType :: IntLiteral ,
9093 SupersetConfigOptions :: MapboxApiKey => PythonType :: Expression ,
9194 SupersetConfigOptions :: SupersetWebserverTimeout => PythonType :: IntLiteral ,
95+ SupersetConfigOptions :: LoggingConfigurator => PythonType :: Expression ,
9296 SupersetConfigOptions :: AuthType => PythonType :: Expression ,
9397 SupersetConfigOptions :: AuthUserRegistration => PythonType :: BoolLiteral ,
9498 SupersetConfigOptions :: AuthUserRegistrationRole => PythonType :: StringLiteral ,
@@ -136,6 +140,10 @@ pub struct SupersetClusterSpec {
136140 pub stopped : Option < bool > ,
137141 /// The Superset image to use
138142 pub image : ProductImage ,
143+ /// Name of the Vector aggregator discovery ConfigMap.
144+ /// It must contain the key `ADDRESS` with the address of the Vector aggregator.
145+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
146+ pub vector_aggregator_config_map_name : Option < String > ,
139147 pub credentials_secret : String ,
140148 pub mapbox_secret : Option < String > ,
141149 #[ serde( default ) ]
@@ -144,6 +152,8 @@ pub struct SupersetClusterSpec {
144152 pub authentication_config : Option < SupersetClusterAuthenticationConfig > ,
145153 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
146154 pub nodes : Option < Role < SupersetConfigFragment > > ,
155+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
156+ pub database_initialization : Option < supersetdb:: SupersetDbConfigFragment > ,
147157 /// Specify the type of the created kubernetes service.
148158 /// This attribute will be removed in a future release when listener-operator is finished.
149159 /// Use with caution.
@@ -258,6 +268,26 @@ pub enum SupersetRole {
258268) ]
259269pub struct SupersetStorageConfig { }
260270
271+ #[ derive(
272+ Clone ,
273+ Debug ,
274+ Deserialize ,
275+ Display ,
276+ Eq ,
277+ EnumIter ,
278+ JsonSchema ,
279+ Ord ,
280+ PartialEq ,
281+ PartialOrd ,
282+ Serialize ,
283+ ) ]
284+ #[ serde( rename_all = "kebab-case" ) ]
285+ #[ strum( serialize_all = "kebab-case" ) ]
286+ pub enum Container {
287+ Superset ,
288+ Vector ,
289+ }
290+
261291#[ derive( Clone , Debug , Default , Fragment , JsonSchema , PartialEq ) ]
262292#[ fragment_attrs(
263293 derive(
@@ -284,6 +314,8 @@ pub struct SupersetConfig {
284314 /// CPU and memory limits for Superset pods
285315 #[ fragment_attrs( serde( default ) ) ]
286316 pub resources : Resources < SupersetStorageConfig , NoRuntimeLimits > ,
317+ #[ fragment_attrs( serde( default ) ) ]
318+ pub logging : Logging < Container > ,
287319}
288320
289321impl SupersetConfig {
@@ -303,6 +335,7 @@ impl SupersetConfig {
303335 } ,
304336 storage : SupersetStorageConfigFragment { } ,
305337 } ,
338+ logging : product_logging:: spec:: default_logging ( ) ,
306339 ..Default :: default ( )
307340 }
308341 }
0 commit comments