Skip to content

feat(kubevirt): add additionalSpec for unmapped spec fields#240

Open
Hector295 wants to merge 1 commit intosuse-edge:mainfrom
Hector295:feature/kubevirt-additional-spec
Open

feat(kubevirt): add additionalSpec for unmapped spec fields#240
Hector295 wants to merge 1 commit intosuse-edge:mainfrom
Hector295:feature/kubevirt-additional-spec

Conversation

@Hector295
Copy link
Copy Markdown

The KubeVirt CR spec has many fields. Rather than mapping every field explicitly, this adds an additionalSpec escape hatch that:

  1. Allows users to configure any KubeVirt spec field not exposed in values.yaml
  2. Uses mergeOverwrite to combine with explicitly mapped fields
  3. Gives priority to additionalSpec values when there are conflicts

Example:

$ cat values.yaml 
kubevirt:
  monitorAccount: rancher-monitoring-prometheus
  monitorNamespace: cattle-monitoring-system
  additionalSpec:
    serviceMonitorNamespace: cattle-monitoring-system
    infra:
      nodePlacement:
        tolerations:
          - key: "node-role.kubernetes.io/etcd"
            operator: "Exists"
            effect: "NoExecute"
    configuration:
      developerConfiguration:
        featureGates: ["ExpandDisks"]
        
$ helm template kubevirt assets/kubevirt/kubevirt-0.6.2.tgz -f values.yaml | grep -A22 "# Source: kubevirt/templates/kubevirt.yaml"
# Source: kubevirt/templates/kubevirt.yaml
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
  name: kubevirt
  namespace: default
spec:

  configuration:
    developerConfiguration:
      featureGates:
      - ExpandDisks
  imagePullPolicy: IfNotPresent
  infra:
    nodePlacement:
      tolerations:
      - effect: NoExecute
        key: node-role.kubernetes.io/etcd
        operator: Exists
  monitorAccount: rancher-monitoring-prometheus
  monitorNamespace: cattle-monitoring-system
  serviceMonitorNamespace: cattle-monitoring-system

Signed-off-by: hector <hectorvc0295@gmail.com>
@Hector295
Copy link
Copy Markdown
Author

Hi @atanasdinov , could you please review this PR when you have a moment?

@Hector295
Copy link
Copy Markdown
Author

@atanasdinov @hardys - just a friendly reminder on this one when you have time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant