diff --git a/Makefile b/Makefile index 61db7b5..b88d6c4 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,9 @@ charts: manifests kustomize helm-tool yq dist $(YQ) e 'select(.kind != "CustomResourceDefinition")' dist/recommended.yaml > $(CHART_DIR)/templates/all.yaml cp hack/helm/Chart.yaml $(CHART_DIR)/ cp hack/helm/NOTES.txt $(CHART_DIR)/templates/ - touch $(CHART_DIR)/values.yaml + cp hack/helm/values.yaml $(CHART_DIR)/ + # Replace hardcoded manager container resources with Helm-configurable values + perl -i -0777 -pe 's/( resources:\n) limits:\n cpu: 100m\n memory: 256Mi\n requests:\n cpu: 100m\n memory: 256Mi/$$1 {{- toYaml .Values.resources | nindent 12 }}/g' $(CHART_DIR)/templates/all.yaml helm package $(CHART_DIR) --version $(VERSION) deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. diff --git a/hack/helm/values.yaml b/hack/helm/values.yaml new file mode 100644 index 0000000..6975918 --- /dev/null +++ b/hack/helm/values.yaml @@ -0,0 +1,7 @@ +resources: + limits: + cpu: 100m + memory: 256Mi + requests: + cpu: 100m + memory: 256Mi