Skip to content

feat(chart): chart-owned PVCs, HTTPRoute filters and extraManifests - #173

Merged
cilindrox merged 3 commits into
plexinc:masterfrom
aaronspruit:feat/chart-owned-pvcs-route-filters-extra-manifests
Sep 7, 2026
Merged

feat(chart): chart-owned PVCs, HTTPRoute filters and extraManifests#173
cilindrox merged 3 commits into
plexinc:masterfrom
aaronspruit:feat/chart-owned-pvcs-route-filters-extra-manifests

Conversation

@aaronspruit

Copy link
Copy Markdown
Contributor

Four additions. Every one is default-off or defaults to today's behaviour, so rendered output is unchanged unless a value is set.

httpRoute gains the ability to set matches, filters, timeouts, additionalRules and name to make it more customizable instead of disabling the httpRoute in the chart and applying it beside the release.

pms.configPersistence renders the config volume as a chart-owned PersistentVolumeClaim instead of a StatefulSet volumeClaimTemplate. A volumeClaimTemplate claim is named pms-config-- and is owned by the StatefulSet, so it cannot be given a stable name and cannot carry helm.sh/resource-policy: keep. That left configExistingClaim as the only way to attach a deliberately-named claim, so the claim had to be created and kept in sync outside the chart. configExistingClaim still takes precedence.

extraPersistentVolumeClaims creates additional claims the release owns, for volumes other than the config one - a backups share, a media library, etc - that otherwise have to be applied out of band and then referenced with extraVolumes.

extraManifests renders arbitrary objects with the release. The chart templates a Service, a StatefulSet, an Ingress and an HTTPRoute; anything else belonging to the deployment (Gateway API policies, NetworkPolicy, ServiceMonitor, ExternalSecret, etc) has to be applied beside the chart today, so helm uninstall leaves it behind.

Both extra* values and additionalRules accept a list or a map, and are passed through tpl so they can reference values and the chart's named templates.

README.md is regenerated with helm-docs 1.14.2.

@aaronspruit
aaronspruit requested a review from a team as a code owner August 14, 2026 03:22
@aaronspruit
aaronspruit requested review from MarshallAsch and cookandy and removed request for a team August 14, 2026 03:22
@cilindrox cilindrox self-assigned this Aug 24, 2026

@cilindrox cilindrox 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.

Thanks @aaronspruit - left some comments. Would you consider opening separate PRs for the features so we can keep discussion focused?

Comment thread charts/plex-media-server/templates/persistentvolumeclaim.yaml Outdated
Comment thread charts/plex-media-server/values.yaml
Comment thread charts/plex-media-server/templates/extra-manifests.yaml Outdated
Comment thread charts/plex-media-server/templates/extra-manifests.yaml Outdated
Comment thread charts/plex-media-server/templates/extra-manifests.yaml
Comment thread charts/plex-media-server/values.yaml Outdated
@aaronspruit

Copy link
Copy Markdown
Contributor Author

Thanks @aaronspruit - left some comments. Would you consider opening separate PRs for the features so we can keep discussion focused?

Based on the comments, basically you're asking to re-look at how PVCs are handled in general right? I know my PR was just a quick hack to get my use case working, but want to be sure we are on the same page.

@cilindrox

Copy link
Copy Markdown
Member

The pvcs can be added via extraManifests - I think the use case for the new feature covers these.

httpRoutes can be a dict, so we don't have to do any additional name checks - but I think that one can be a follow-up PR.

@aaronspruit
aaronspruit force-pushed the feat/chart-owned-pvcs-route-filters-extra-manifests branch from cb2ea75 to bae6c05 Compare August 30, 2026 05:12
@aaronspruit

aaronspruit commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, totally misread these initially. I agree on the PVCs. Both templates are removed.

extraManifests and configExistingClaim together cover the case that I wrote them for. When configExistingClaim is set, the StatefulSet already omits volumeClaimTemplates, so no new template is necessary. values.yaml now documents the config claim as an extraManifests example, as you suggested.

I rebased on master and reduced this PR to extraManifests only. The chart is 1.8.0 and the change is four files. The default render is byte-identical to master, except for the chart version label. HTTPRoute follows in its own PR. The title and body above still describe all four features. Do you want me to rewrite them for extraManifests only, or would you prefer a fresh PR?

I applied the other three comments. I took your suggestion exactly. I moved the list-or-map and tpl description from the template to the values.yaml entry. The stanza now follows the whole extraContainers block, and it no longer splits that block.

I disagree on one point: the kindIs "string" branch. toYaml does not cover a string entry. It renders a string as a YAML scalar, not as a document. The entry then renders as a quoted string instead of an object.

The branch also matters for the PVC example that you asked for. Only a string entry can carry a template of more than one line. values.yaml parses as YAML before tpl runs. As an object, this does not parse:

extraManifests:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      labels:
        {{- include "pms-chart.labels" . | nindent 8 }}
Error: failed to parse values.yaml: error converting YAML to JSON:
yaml: line 6: did not find expected node content

As a string, the same text renders correctly. This is the form that the documented PVC example uses, so dropping the branch would take the example with it. Happy to drop string support entirely if you'd rather have the simpler template, but then the example has to inline the labels by hand.

On httpRoute as a dict with the name as the key: I agree. It is better than a name field, and it also supports more than one route. It is a breaking change to the values shape. I will do it in its own PR, together with the matches, filters, and timeouts work.

The chart templates a Service, a StatefulSet, an Ingress and an HTTPRoute.
Anything else belonging to the deployment - Gateway API policies,
NetworkPolicy, ServiceMonitor, ExternalSecret - has to be applied beside the
release today, so it is not pruned on `helm uninstall` and has to be kept in
sync by hand.

extraManifests renders arbitrary objects with the release. It may be a list or
a map, and each entry is either a YAML object or a string; both are passed
through `tpl`, so entries can reference values and the chart's named templates.

Default is `[]`, so rendered output is unchanged unless a value is set.

values.yaml documents two entries: a config PersistentVolumeClaim the release
owns, paired with pms.configExistingClaim, and a policy object given as YAML
rather than as a string.

README.md is regenerated with helm-docs 1.14.2.
@cilindrox
cilindrox force-pushed the feat/chart-owned-pvcs-route-filters-extra-manifests branch from bae6c05 to 55cb287 Compare September 7, 2026 20:01

@cilindrox cilindrox 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.

LGTM 👍

Comment thread charts/plex-media-server/Chart.yaml Outdated
Comment thread charts/plex-media-server/README.md Outdated
@cilindrox
cilindrox merged commit 96d3923 into plexinc:master Sep 7, 2026
3 checks passed
@cilindrox

Copy link
Copy Markdown
Member

thanks @aaronspruit !

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants