feat(charts): expose extra* values and podSpec/container patches on the plane charts - #314
Open
lemaitre-aneo wants to merge 1 commit into
Open
lemaitre-aneo wants to merge 1 commit into
lemaitre-aneo wants to merge 1 commit into
Conversation
… charts Also wires affinity and per-workload imagePullSecrets, which shipped as values no template read; chart and global imagePullSecrets now both apply instead of one shadowing the other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The plane charts enumerate pod and container fields one by one, so anything not enumerated is unreachable: a
topologySpreadConstraint, ahostAlias, a sidecar, asecurityContextthe chart got wrong. Every such need is currently a PR against this repo and a wait for a release.Description
Three mechanisms, with one rule dividing them:
extra*(additive):extraEnv,extraEnvFrom,extraVolumes,extraVolumeMounts,extraContainers,extraInitContainers. Appended to what the chart builds, never replacing it. Extras go last so container 0 stays the chart's own, which is whatkubectl logspicks by default.podSpecPatch/containerPatch(overriding): a map merged over the rendered fragment, last and winning. Names mirror the API types (you patch aPodSpec, and aContainer, which has noContainerSpec), matching Argo Workflows'podSpecPatch. On the compute plane they sit onpartitionCommon, so per-partition override works through the existing merge with no new machinery.podSpecPatchtargetsspec.template.spec, neverspec.template: pod labels have to stay a superset of the immutablespec.selector.matchLabels.Three limits follow from
armonik.utils.merge, the first enforced by the newarmonik.utils.patch:commandandargsare exempt.""being absent to the merge.helm --post-rendereror ArgoCD's kustomize post-render, which give real strategic-merge semantics. Documented incharts/best-practices.mdrather than reimplemented.armonik.utils.patchparses what it patches and printed text cannot be patched, so each patchable object moved into adefineof literal YAML in a new_deployment.tpl, leaving the Deployment envelope in place.armonik-compute-plane/templates/deployment.yamlgoes from 215 lines to 88.Fixes carried along, all in lines this PR rewrites:
affinityshipped inarmonik-control-plane/values.yamlthree times and no template read any of them;armonik-compute-planeshipped none at all. Now rendered on all five workloads across both charts.metricsExporter.imagePullSecretsandinit.imagePullSecretswere likewise dead. Now wired, layered most-specific-first.global.imagePullSecretsrendered invalid YAML:armonik.utils.indexreturns a string, sotoYamlre-encoded it as a scalar (imagePullSecrets: '- name: cred'). Replaced by a plain concat of both inputs.armonik-compute-plane/templates/deployment.yaml:113had{{- . toYaml }}(missing pipe), so any non-emptyagent.readinessProbeaborted the render. Unreachable because the value ships{}.Testing
./test/unittest.sh,./test/matrix.sh(with kubeconform),helm linton all 11 charts,helm-docsandpre-commitall pass locally.The refactor is byte-identical to the previous render on every existing fixture: compute-plane defaults and both
ci/fixtures, the fluent-bit sidecar path, control-plane defaults and both fixtures, and the full umbrella againstci/minimal-values.yaml. Verified by rendering baseline charts built fromfeat/revamp-helmand diffing document by document after normalising key order.Added:
armonik.utils.patchcontract suite intest/harness/common-harness(8 tests), per-chart patch suites (11 + 9), a compute-plane scheduling suite for the affinity and pull-secret fixes (5), two control-plane tests for the same, one pinning thereadinessProbefix, twoci/patch-values.yamlrender fixtures, and two expected-failure fixtures withmatrix.shcases for the list guard.Impact
globalimagePullSecretsnow both apply rather than one shadowing the other. Intended: the kubelet tries each in turn, so a global registry credential no longer silently discards a chart-level one. Anyone relying on the old shadowing gets an extra secret in the list, which is harmless.toYamlsorts keys, so rendered manifests are now alphabetical rather thanname-first. Cosmetic, and whatkubectl get -o yamlshows anyway, buthelm templatediffs against the current output will be noisy once.charts/best-practices.mdgains an "Exposing arbitrary parameters" section stating the convention and how to add a patch point.Additional Information
deployment.yamland the diff reads better against a settled base.partitionCommon.agent.ports.containerPort, which the list guard already protects from being moved by a patch, and its pod selector usesarmonik.selectorLabels, whichpodSpecPatchcannot reach.hostNetworkis deliberately allowed. An earlier revision refused it because it escapes the NetworkPolicies feat: add network policies #303 adds; that was paternalistic. The guard's job is to stop a patch silently destroying what the chart built, not to second-guess a field the user set on purpose. A test pins the pass-through.extraEnvintentionally has no collision check. Setting a name the conf layers already set emits it twice. Kubernetes accepts that (validation was proposed in Do not allow duplicate environment variable definitions kubernetes/kubernetes#59593 and closed unmerged over backward compatibility), butnameis thepatchMergeKey, so removing one duplicate later removes both. Noted inbest-practices.md; not enforced, sinceenvFromcan collide the same way with no way to check.armonik-ingress, the metrics-exporter Deployment and the init Jobs have no patch points yet. The first is where feat: custom/shared issuer support #313 and feat: add network policies #303 both touch the pod spec; the others are straightforward follow-ups.Checklist