Skip to content

Commit

Permalink
feat: Make it possible to customize k8s resources
Browse files Browse the repository at this point in the history
Currently there is no way for plugins to customize Kubernetes resources
defined in Tutor deployment manifests.
This change makes that possible by taking advantage of the strategic
merge patching mechanism in `kustomization.yml`.
Any resource definition in a `k8s-override` patch in a plugin will
override the resource defined by Tutor, provided that their names match.

Reference: overhangio#675
  • Loading branch information
foadlind committed Jun 7, 2022
1 parent 57cb956 commit 851f9e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Every user-facing change should have an entry in this changelog. Please respect
-->

## Unreleased
- [Improvement] Make it possible to override k8s resources in plugins using `k8s-override` patch. (by @foadlind)

## v13.3.1 (2022-06-06)

Expand Down
1 change: 1 addition & 0 deletions tutor/templates/k8s/override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ patch("k8s-override") }}
4 changes: 4 additions & 0 deletions tutor/templates/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ configMapGenerator:
app.kubernetes.io/name: redis
{{ patch("kustomization-configmapgenerator") }}

patchesStrategicMerge:
- k8s/override.yml
{{ patch("kustomization-patches-strategic-merge") }}

{{ patch("kustomization") }}

0 comments on commit 851f9e9

Please sign in to comment.