Switch kustomize base from helmCharts to pre-rendered manifests

kustomize 5.4.3 (bundled in ArgoCD) removed localChartPath and chartPath
from its JSON schema, making helmCharts: with a local chart path invalid.
Pre-render the base manifests with 'make render-helm' instead; overlays
patch the plain YAML as before. ServiceMonitor excluded until Prometheus
is installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rod
2026-05-17 13:09:35 +02:00
parent bd3c6b5e25
commit 5d9a159e07
4 changed files with 97 additions and 6 deletions
+19
View File
@@ -0,0 +1,19 @@
IMAGE := git.samidare.dev/rod/hello-svc
CHART_DIR := helm/hello-svc
BASE_DIR := k8s/base
.PHONY: build push render-helm
build:
docker build -t $(IMAGE):latest .
push: build
docker push $(IMAGE):latest
# Re-render k8s/base/manifest.yaml from the Helm chart.
# Run this whenever helm/hello-svc/ templates or values.yaml change.
render-helm:
helm template hello-svc $(CHART_DIR) \
-f $(BASE_DIR)/values.yaml \
--set serviceMonitor.enabled=false \
> $(BASE_DIR)/manifest.yaml
+2 -5
View File
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: hello-svc
releaseName: hello-svc
localChartPath: ../../helm/hello-svc
valuesFile: values.yaml
resources:
- manifest.yaml
+74
View File
@@ -0,0 +1,74 @@
---
# Source: hello-svc/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: hello-svc
labels:
helm.sh/chart: hello-svc-0.1.0
app.kubernetes.io/name: hello-svc
app.kubernetes.io/instance: hello-svc
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: hello-svc
app.kubernetes.io/instance: hello-svc
ports:
- port: 80
targetPort: 8080
---
# Source: hello-svc/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-svc
labels:
helm.sh/chart: hello-svc-0.1.0
app.kubernetes.io/name: hello-svc
app.kubernetes.io/instance: hello-svc
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: hello-svc
app.kubernetes.io/instance: hello-svc
template:
metadata:
labels:
app.kubernetes.io/name: hello-svc
app.kubernetes.io/instance: hello-svc
spec:
containers:
- name: hello-svc
image: "git.samidare.dev/rod/hello-svc:latest"
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: APP_ENV
value: "production"
- name: APP_VERSION
value: "unknown"
- name: LOG_LEVEL
value: "info"
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
+2 -1
View File
@@ -1,4 +1,5 @@
# Base Helm values — overlays patch on top of this via strategic merge.
# Helm values used to render k8s/base/manifest.yaml.
# Run 'make render-helm' after changing these or the chart templates.
replicaCount: 1
image: