Gerk Elznik created FLINK-40509:
-----------------------------------

             Summary: Move operator defaults out of the Helm chart so 
config.yaml carries only user-supplied content
                 Key: FLINK-40509
                 URL: https://issues.apache.org/jira/browse/FLINK-40509
             Project: Flink
          Issue Type: Improvement
          Components: Kubernetes Operator
    Affects Versions: kubernetes-operator-1.16.0
            Reporter: Gerk Elznik


h2. Background

On PR #1126 (FLINK-39791) [~dciupitu] proposed a cleanup so that the operator's 
{{config.yaml}} on disk contains only user-supplied content. With no shipped 
seed there is no duplicate-key collision surface between the seed and a user's 
flat override, which was the residual risk noted in that PR. The approach was 
agreed as a follow-up rather than folded into #1126, but it was never filed. 
This ticket tracks it.
h2. Proposal
 # Drop the operator overrides from {{values.yaml}} (the SLF4J reporter class 
and interval, {{kubernetes.operator.reconcile.interval}} and 
{{{}kubernetes.operator.observer.progress-check.interval{}}}) and let the 
compiled {{ConfigOption}} defaults apply.
 # Move the Java 17 opts 
({{{}kubernetes.operator.default-configuration.flink-version.*{}}}) out of the 
chart's {{conf/config.yaml}} into compiled defaults, leaving that file empty or 
a commented example.
 # Stop text-writing {{watchNamespaces}} and {{operatorHealth}} into the 
operator ConfigMap and set them as env vars instead, mirroring how 
{{WATCH_NAMESPACES}} already works.

h2. What was measured while prototyping

Verified in a kind cluster:
 * Removing the {{values.yaml}} overrides changes the reconcile cadence from 
*15s to 60s* on a default install, because the compiled defaults are 60s and 
10s while the chart ships 15s and 5s. Progress check would go from 5s to 10s. 
Dropping the SLF4J reporter is also a default-install behavior change, since 
operator metrics stop being logged every 5 minutes.
 * {{WATCH_NAMESPACES}} scopes the watch with no code change, but it has to be 
set on *both* containers. The webhook resolves watched namespaces through the 
same config path and has its own {{env:}} block. With the var on the operator 
container only and the ConfigMap line removed, the webhook informers stay 
cluster-scoped. They are created lazily, so nothing fails at startup and the 
first {{FlinkSessionJob}} apply then fails admission with {{{}cannot list 
flinkdeployments at the cluster scope{}}}.
 * Shipping namespaces through the env var silently disables 
{{{}kubernetes.operator.dynamic.namespaces.enabled{}}}. The reload still logs 
the new namespace list, but no {{Changing namespaces}} event fires, the webhook 
does not rescope, nothing warns, and a FlinkDeployment created in the newly 
listed namespace is never reconciled.
 * Nothing reads {{KUBERNETES_OPERATOR_HEALTH_PROBE_ENABLED}} or 
{{KUBERNETES_OPERATOR_HEALTH_PROBE_PORT}} today, so that half needs new 
operator code mirroring {{{}ENV_WATCH_NAMESPACES{}}}. It is only needed to keep 
non-default ports and disablement working: the compiled defaults ({{{}true{}}} 
and {{{}8085{}}}) already match what the chart writes, so removing those two 
ConfigMap lines is behavior-neutral for a default install. The Helm value stays 
regardless, since it also wires the containerPort and the liveness and startup 
probes.
 * The Java 17 opts are dynamic string prefixes resolved at runtime by 
{{{}FlinkConfigManager#getRelevantVersionPrefixes{}}}, so they cannot be 
expressed as plain {{ConfigOption}} defaults.

h2. Open decisions
 # Intervals: change the compiled defaults to 15s and 5s, which also affects 
non-Helm deployments and the generated config docs, or let default installs 
slow down and carry a release note.
 # Where the compiled Java 17 seed gets injected, since user configuration has 
to keep winning over it.
 # {{defaultConfiguration.append: false}} currently produces a config with no 
Java 17 opts at all. Compiled defaults cannot be shed by omitting text, so an 
explicit off-switch is probably needed to preserve that escape hatch.
 # Whether losing no-restart namespace updates is an acceptable trade for env 
vars, given that changing an env var through helm upgrade forces a rolling 
restart anyway.

h2. Suggested sequencing

Three separate PRs, smallest blast radius first: the env vars, then the Java 17 
opts, then the intervals and SLF4J removal last, since that is the one carrying 
a user-visible behavior change and a release note.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to