-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - use a RAW values.yaml for a Helm release #445
Comments
If you want to use the apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: mongodb
spec:
chart:
spec:
chart: mongodb
sourceRef:
kind: HelmRepository
name: bitnami
valuesFile: "values-production.yaml"
All Kubernetes manifests should be in the Git repository, you can place the raw production-values.yaml inside the repo and use Kustomize to generate the configmap: apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- mongo-namespace.yaml
- mongo-helm-release.yaml
configMapGenerator:
- name: mongo-config
files:
- values.yaml=configs/production-values.yaml Then in mongo-helm-release.yaml: apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: mongodb
spec:
chart:
spec:
chart: mongodb
sourceRef:
kind: HelmRepository
name: bitnami
valuesFrom:
- kind: ConfigMap
name: mongo-config |
Thank you very much! works with the additional option
otherwise there will be a suffix mongo-config-234234234 and the config map can not be found in the release
|
I know you had this conversation a few months ago, but just wanted to add: You don't have to use create a file called
|
I try with this configuration : ---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../namespace
- ./cert-manager.yaml
configMapGenerator:
- name: cert-manager-values
files:
- values.yaml=cert-manager-values.yaml
configurations:
- kustomizeconfig.yaml apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cert-manager
namespace: cert-manager
spec:
chart:
spec:
# renovate: registryUrl=https://charts.jetstack.io/
chart: cert-manager
version: v1.3.0
sourceRef:
kind: HelmRepository
name: jetstack
namespace: flux-system
interval: 5m0s
releaseName: cert-manager
targetNamespace: cert-manager
valuesFrom:
- kind: ConfigMap
name: cert-manager-values nameReference:
- kind: ConfigMap
version: v1
fieldSpecs:
- path: spec/valuesFrom/name
kind: HelmRelease installCRDs: true
# extraArgs:
# - --enable-certificate-owner-ref=true
# - --dns01-recursive-nameservers=1.1.1.1:53
# - --dns01-recursive-nameservers-only
prometheus:
enabled: true
servicemonitor:
enabled: true
labels:
release: kube-prometheus-stack Then build :
With this fix : apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cert-manager
# namespace: cert-manager
... It works : kustomize build kubernetes/base/cert-manager/cert-manager/
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
---
apiVersion: v1
data:
values.yaml: |
installCRDs: true
prometheus:
enabled: true
servicemonitor:
enabled: true
labels:
release: kube-prometheus-stack
kind: ConfigMap
metadata:
name: cert-manager-values-2f6c4747hh
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: cert-manager
spec:
chart:
spec:
chart: cert-manager
sourceRef:
kind: HelmRepository
name: jetstack
namespace: flux-system
version: v1.3.0
interval: 5m0s
releaseName: cert-manager
targetNamespace: cert-manager
valuesFrom:
- kind: ConfigMap
name: cert-manager-values-2f6c4747hh Perhaps due to : kubernetes-sigs/kustomize#1301 @stefanprodan @potto007 ? |
Hey guys,
like flux so far but I struggle a bit at the moment with integrating big value.yaml config files
For example for bitnami MongoDB Chart the production-values.yaml is very long (500 lines).
I do not want to copy paste this into the helm release yaml file
What is the best way to do that?
there is this section with
BUT I do not want to create a ConfigMap for every Helm chart. In my opinion this would be a bit confusing to have the values somewhere outside the git repo
is there kustomize magic which merges the "production-values.yaml" (without changing it) into helm-release-yaml?
The text was updated successfully, but these errors were encountered: