Using HelmChart
See the HelmChart resource reference for the API, example, and field definitions.
Chart Reference Methods
Section titled “Chart Reference Methods”Local Path
Section titled “Local Path”Reference a chart by filesystem path (absolute or relative) using the name field:
apiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: nginx namespace: defaultspec: chart: name: ./charts/nginxChart Name
Section titled “Chart Name”Reference a chart by name (without path separators), searched in configured search paths:
apiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: nginx namespace: defaultspec: chart: name: nginxConfigure search paths in nyl.toml:
[project]helm_chart_search_paths = ["./charts", "/opt/helm-charts"]Git Repository
Section titled “Git Repository”Reference a chart from a Git repository using the git+ protocol prefix:
apiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: nginx namespace: defaultspec: chart: repository: git+https://github.com/bitnami/charts.git version: main name: bitnami/nginxGit Parameters:
repository(required): Git repository URL withgit+prefix (HTTPS or SSH)version(optional): Branch, tag, or commit SHA (default:HEAD)name(optional): Subdirectory within the repository containing the chart
Helm Dependencies:
Charts from Git repositories with dependencies are automatically handled. If your chart has a Chart.yaml with dependencies or a Chart.lock file, Nyl will automatically run helm dependency build to fetch and build the dependencies before rendering the chart.
Examples:
# Latest from main branchchart: repository: git+https://github.com/example/charts.git version: main name: charts/myapp
# Specific version tagchart: repository: git+https://github.com/example/charts.git version: v2.1.0 name: charts/myapp
# Specific commitchart: repository: git+https://github.com/example/charts.git version: abc123def456 name: charts/myapp
# Root of repository (no subpath)chart: repository: git+https://github.com/example/simple-chart.git version: main
# SSH URLchart: repository: git+git@github.com:example/charts.git version: main name: charts/myappSee Git Integration for more details on Git support.
Release Configuration
Section titled “Release Configuration”The Helm release is configured via the metadata fields:
metadata: name: myapp # Helm release name namespace: production # Target namespaceDefaults:
namespace: Usesdefaultif not specified
Creating Namespaces
Section titled “Creating Namespaces”If you need to create the namespace before deploying the chart, add a Namespace resource:
apiVersion: v1kind: Namespacemetadata: name: production---apiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: myapp namespace: productionspec: chart: name: ./charts/myapp values: replicas: 3When using ArgoCD, you can alternatively enable automatic namespace creation:
apiVersion: argoproj.io/v1alpha1kind: Applicationspec: syncPolicy: syncOptions: - CreateNamespace=trueValues
Section titled “Values”Chart values can be provided in multiple ways:
Inline Values
Section titled “Inline Values”spec: values: image: repository: nginx tag: "1.25" replicas: 3 service: type: LoadBalancerCluster and target values
Section titled “Cluster and target values”Cluster and DeploymentTarget values are Nyl template inputs. They are not passed to Helm implicitly. This keeps strict chart schemas effective and prevents an unrelated target value from overriding or extending a chart’s values.
Pass a target-aware value explicitly from the Nyl template context:
spec: values: environment: "{{ values.environment }}"Helm receives only HelmChart.spec.values. Component resources follow the same
rule and pass only their spec payload to Helm.
Templating in Values
Section titled “Templating in Values”Values support Jinja2 templating:
spec: values: image: tag: "{{ env.NYL_IMAGE_TAG }}" environment: "{{ values.environment }}"Complete Example
Section titled “Complete Example”apiVersion: k8s.nyl/v1kind: Releasemetadata: name: myapp namespace: production---apiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: myapp namespace: productionspec: chart: repository: git+https://github.com/company/charts.git version: v2.1.0 name: applications/myapp values: replicas: 3 image: repository: company/myapp tag: "{{ env.VERSION }}" ingress: enabled: true host: myapp.example.com resources: requests: cpu: 500m memory: 512Mi limits: cpu: 1000m memory: 1GiMulti-Environment Deployments
Section titled “Multi-Environment Deployments”Use the same chart with different values per environment:
# base manifestapiVersion: k8s.nyl/v1kind: HelmChartmetadata: name: myappspec: chart: repository: git+https://github.com/company/charts.git version: stable name: myapp values: # Base values hereapiVersion: k8s.gitops.nyl/v1kind: DeploymentTargetmetadata: name: productionspec: clusterRef: name: primary values: replicas: 5 environment: production image: tag: v2.1.0 resources: requests: cpu: 1000m publication: repository: repoURL: https://git.example.com/platform/deploy.git revision: deploy/productionRender for specific environment:
nyl render --target production app.yamlSee Also
Section titled “See Also”- Git Integration - Git repository management
- Configuration - Search paths and settings
- Release - Release metadata