Skip to content

Add resource overrides to openadservice - #23

Merged
lukaszanger merged 9 commits into
mainfrom
feature/openadservice-resource-overrides
Nov 26, 2026
Merged

lukaszanger merged 9 commits into
mainfrom
feature/openadservice-resource-overrides

Conversation

@lreiher

@lreiher lreiher commented Oct 30, 2026

Copy link
Copy Markdown
Member

Services occasionally need Kubernetes fields that the base chart does not expose. Add resource overrides so these fields can be configured without introducing a dedicated chart value for each one.

The chart renders each resource, then applies mergeOverwrite before emitting YAML. Override values take precedence: maps merge recursively, while lists are replaced in full. Overrides also work under instances.

overrides.deployment targets the Deployment, overrides.service applies to both internal and external Services, and overrides.configMap applies to all generated ConfigMaps. Overrides modify resources that the chart already generates; they do not enable otherwise absent resources.

Examples

These values are shown under openadservice as used by a dependent chart. When installing the base chart directly, omit that wrapper.

Access the node's network namespace while retaining Kubernetes service DNS:

openadservice:
  overrides:
    deployment:
      spec:
        template:
          spec:
            hostNetwork: true
            dnsPolicy: ClusterFirstWithHostNet

Resulting Deployment fragment:

spec:
  template:
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet

The generated containers, volumes, and other Deployment fields are preserved.

Enable client-IP session affinity on generated Services:

openadservice:
  overrides:
    service:
      spec:
        sessionAffinity: ClientIP

Each generated Service gains spec.sessionAffinity: ClientIP, preserving its existing type, selectors, and ports.

Make generated ConfigMaps immutable:

openadservice:
  overrides:
    configMap:
      immutable: true

Each generated ConfigMap gains top-level immutable: true, preserving its generated data. Subsequent data changes require replacing the ConfigMap.

Validation

Helm lint and rendering checks passed for the examples above, both Service types, all three ConfigMap sources, exact ConfigMap data preservation, per-instance inheritance/isolation, and list replacement.

This PR is based on main and is independent of the dedicated host-network value in #22.

@lukaszanger

lukaszanger commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

I just tested it for my use case as described in #25 and it works!
So, I would approve this PR 🙂

test-service:
  openadservice:
    ...
    overrides:
      deployment:
        spec:
          template:
            spec:
              hostIPC: true
              serviceAccountName: test-account

@lreiher

lreiher commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

@cgeller, would you like to review?

Comment thread charts/openadservice/values.yaml Resolved

@cgeller cgeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested within a cluster but conceptionally looks good! We should also bump the version to at least 1.2.1 right?

@cgeller

cgeller commented Nov 11, 2026

Copy link
Copy Markdown
Member

@cgeller, would you like to review?

Already done .. I only forgot to submit the review .. sorry

@lreiher

lreiher commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

Not tested within a cluster but conceptionally looks good! We should also bump the version to at least 1.2.1 right?

Would even go for 1.3.0. Question remains, how do we handle all downstream services? Prepare a PR to dev environment, but potentially keep that merge on hold until the crowd is ready? Or directly push it down all people's throats? 😄

@cgeller

cgeller commented Nov 11, 2026

Copy link
Copy Markdown
Member

Not tested within a cluster but conceptionally looks good! We should also bump the version to at least 1.2.1 right?

Would even go for 1.3.0. Question remains, how do we handle all downstream services? Prepare a PR to dev environment, but potentially keep that merge on hold until the crowd is ready? Or directly push it down all people's throats? 😄

Do we really need these changes immediately in all downstream services? If yes, we should stay with 1.2.0 .. if not, I would move to 1.3.0 but would not force the update right now! Otherwise we will lost the crowd ;-)

@lukaszanger

Copy link
Copy Markdown
Member

Not tested within a cluster but conceptionally looks good! We should also bump the version to at least 1.2.1 right?

Would even go for 1.3.0. Question remains, how do we handle all downstream services? Prepare a PR to dev environment, but potentially keep that merge on hold until the crowd is ready? Or directly push it down all people's throats? 😄

Do we really need these changes immediately in all downstream services? If yes, we should stay with 1.2.0 .. if not, I would move to 1.3.0 but would not force the update right now! Otherwise we will lost the crowd ;-)

Isn't is okay to move to 1.3.0 but only update those downstream services where this implementation is needed? Or what are the disadvantages of updating only selected services?

If we did it this way, then we could already continue the implementation in those services where we need this feature. 🙂

@lreiher

lreiher commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

The problem is that the consistency check demand 1.2.0 right now. Services already switching to 1.3.0 on their own would therefore run into consistency errors. They could, however, disable that check.

@cgeller

cgeller commented Nov 12, 2026

Copy link
Copy Markdown
Member

The problem is that the consistency check demand 1.2.0 right now. Services already switching to 1.3.0 on their own would therefore run into consistency errors. They could, however, disable that check.

Would it make sense to change the check and check for versions higher than a given version, e.g. vX.Y ?

@lreiher

lreiher commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

Yes, I like the idea.

@lreiher

lreiher commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

FYI @cgeller @lukaszanger

Helmfile also has the strategicMergePatches option, which allows similar things. Still makes sense to continue this PR though in my opinion.

Comment thread charts/zenoh-router/Chart.yaml Resolved
@lukaszanger

Copy link
Copy Markdown
Member

@cgeller, would you like to review?

Already done .. I only forgot to submit the review .. sorry

@cgeller your review comments are adressed now. I still need to run some tests. Other than that, it should be ready.

@cgeller

cgeller commented Nov 25, 2026

Copy link
Copy Markdown
Member

Yes, I like the idea.

Implemented here, feel free to review!

Comment thread charts/zenoh-router/Chart.yaml Resolved
Comment thread charts/zenoh-router/Chart.yaml Resolved
@lukaszanger

Copy link
Copy Markdown
Member

@cgeller, would you like to review?

Already done .. I only forgot to submit the review .. sorry

@cgeller your review comments are adressed now. I still need to run some tests. Other than that, it should be ready.

The tests were succesful. It is ready to merge now.

Comment thread README.md Resolved
Comment thread README.md Resolved
Co-authored-by: Christian Geller <88664444+cgeller@users.noreply.github.com>
@lukaszanger
lukaszanger merged commit ae3f5a9 into main Nov 26, 2026
2 of 4 checks passed
@lukaszanger
lukaszanger deleted the feature/openadservice-resource-overrides branch November 26, 2026 08:47
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.

3 participants