csviri commented on code in PR #707:
URL: 
https://github.com/apache/spark-kubernetes-operator/pull/707#discussion_r3465809500


##########
spark-operator/src/main/java/org/apache/spark/k8s/operator/config/SparkOperatorConf.java:
##########
@@ -235,32 +235,71 @@ public final class SparkOperatorConf {
           .build();
 
   /**
-   * When enabled, operator would use config map as source of truth for config 
property override.
-   * The config map need to be created in spark.kubernetes.operator.namespace, 
and labeled with
-   * operator name.
+   * When enabled, operator would load config property overrides dynamically 
at runtime. The source
+   * of the overrides is controlled by 
spark.kubernetes.operator.dynamicConfig.source.
    */
   public static final ConfigOption<Boolean> DYNAMIC_CONFIG_ENABLED =
       ConfigOption.<Boolean>builder()
           .key("spark.kubernetes.operator.dynamicConfig.enabled")
           .enableDynamicOverride(false)
           .description(
-              "When enabled, operator would use config map as source of truth 
for config "
-                  + "property override. The config map need to be created in "
-                  + "spark.kubernetes.operator.namespace, and labeled with 
operator name.")
+              "When enabled, operator would load config property overrides 
dynamically at "
+                  + "runtime. The source of the overrides is controlled by "
+                  + "spark.kubernetes.operator.dynamicConfig.source.")
           .typeParameterClass(Boolean.class)
           .defaultValue(false)
           .build();
 
-  /** The selector str applied to dynamic config map. */
+  /** Source of dynamic config overrides: {@code configMap} (informer) or 
{@code file} (mount). */
+  public static final ConfigOption<String> DYNAMIC_CONFIG_SOURCE =
+      ConfigOption.<String>builder()
+          .key("spark.kubernetes.operator.dynamicConfig.source")
+          .enableDynamicOverride(false)
+          .description(
+              "Source of dynamic config overrides when "
+                  + "spark.kubernetes.operator.dynamicConfig.enabled is true. 
Supported values: "
+                  + "'configMap' (default) watches a ConfigMap via a 
Kubernetes informer and "
+                  + "requires RBAC to read ConfigMaps; 'file' periodically 
reloads a properties "
+                  + "file mounted from a ConfigMap and requires no extra 
RBAC.")
+          .typeParameterClass(String.class)
+          .defaultValue("configMap")
+          .build();
+
+  /** The selector str applied to dynamic config map (used by the {@code 
configMap} source). */
   public static final ConfigOption<String> DYNAMIC_CONFIG_SELECTOR =
       ConfigOption.<String>builder()
           .key("spark.kubernetes.operator.dynamicConfig.selector")
           .enableDynamicOverride(false)
-          .description("The selector str applied to dynamic config map.")
+          .description(
+              "The selector str applied to dynamic config map. Used by the 
'configMap' source.")
           .typeParameterClass(String.class)
           .defaultValue(Utils.labelsAsStr(Utils.defaultOperatorConfigLabels()))
           .build();
 
+  /** Path of the properties file that holds dynamic config overrides. */
+  public static final ConfigOption<String> DYNAMIC_CONFIG_FILE_PATH =
+      ConfigOption.<String>builder()
+          .key("spark.kubernetes.operator.dynamicConfig.filePath")
+          .enableDynamicOverride(false)
+          .description(
+              "Path of the properties file holding dynamic configuration 
overrides. Used by the "
+                  + "'file' source, typically populated by mounting a 
ConfigMap as a volume.")
+          .typeParameterClass(String.class)
+          
.defaultValue("/opt/spark-operator/dynamic-conf/spark-operator-dynamic.properties")
+          .build();
+
+  /** Interval at which the dynamic config file is re-read (used by the {@code 
file} source). */
+  public static final ConfigOption<Long> 
DYNAMIC_CONFIG_RELOAD_INTERVAL_SECONDS =
+      ConfigOption.<Long>builder()
+          .key("spark.kubernetes.operator.dynamicConfig.reloadIntervalSeconds")

Review Comment:
   I added check! thx!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to