jiangzho opened a new pull request, #446:
URL: https://github.com/apache/spark-kubernetes-operator/pull/446
## What changes were proposed in this pull request?
This PR allows user to config the labels and annotations for the operator
configuration `ConfigMaps`, which hold operator configuration properties files.
Also added schema validation for the new fields in `values.schema.json`.
### Why are the changes needed?
Users may need to add custom labels and annotations to the operator
configuration ConfigMaps for various operational purposes, or need toolings
that rely on labels or annotations on resources.
Currently, the Helm chart doesn't provide a good way to customize labels and
annotations for the operator `ConfigMap` - it only support annotations for
dynamic `ConfigMap`.
### Does this PR introduce _any_ user-facing change?
Users can now specify custom labels and annotations for the operator
configuration ConfigMap in their `values.yaml`:
```yaml
operatorConfiguration:
configMap:
annotations:
example.com/annotation: "value"
labels:
example.com/label: "value"
```
### How was this patch tested?
Self-contained linters, also validated manually.
Without explicitly configured labels or annotations, the `ConfigMap` renders
as
```yaml
# Source: spark-kubernetes-operator/templates/spark-operator.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: spark-kubernetes-operator-configuration
namespace: spark-demo
labels:
app.kubernetes.io/name: spark-kubernetes-operator
app.kubernetes.io/component: "operator-config"
app.kubernetes.io/version: "0.7.0-SNAPSHOT"
app.kubernetes.io/managed-by: Helm
helm.sh/chart: spark-kubernetes-operator-1.5.0-dev
spark-role: operator
data:
log4j2.properties: |+
# ...
```
With value override
```yaml
operatorConfiguration:
configMap:
annotations:
foo1: bar1
foo2: bar2
labels:
foo3: bar3
```
The `ConfigMap` renders as
```yaml
# Source: spark-kubernetes-operator/templates/spark-operator.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: spark-kubernetes-operator-configuration
namespace: spark-demo
labels:
app.kubernetes.io/name: spark-kubernetes-operator
app.kubernetes.io/component: "operator-config"
app.kubernetes.io/version: "0.7.0-SNAPSHOT"
app.kubernetes.io/managed-by: Helm
helm.sh/chart: spark-kubernetes-operator-1.5.0-dev
spark-role: operator
foo3: bar3
annotations:
foo1: bar1
foo2: bar2
data:
log4j2.properties: |+
# ...
```
### Was this patch authored or co-authored using generative AI tooling?
No
--
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]