How-to guide / Adopt existing resources
Use Helm charts through the Kix Helm bridge
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Use kix.helmChart when you need to fetch, render, and deploy an upstream
Helm chart that does not have a native Kix package yet.
This guide uses the Reflector chart. You need the chart repository, chart name, version, and SRI hash.
Add the chart instance
Section titled “Add the chart instance”Declare the chart as the instance’s package:
16 instances.reflector-system.reflector = {17 package = kix.helmChart {18 repo = "https://emberstack.github.io/helm-charts";19 name = "reflector";20 version = "10.0.60";21 hash = "sha256-UdCVcUqJogyUYmGo1HnQ1fMxY7ZEV56+9wQSJfWOhVM=";22 releaseName = "reflector";23 };24 };The version and hash pin the chart archive. releaseName controls the release
name passed to Helm and therefore affects names generated by the chart.
Pass chart values under the instance’s config.values attribute, using the
option names and value types documented by the upstream chart.
Check the rendered chart
Section titled “Check the rendered chart”Evaluate the cluster and run Kix’s validation checks:
❱ kix check how-to-helm-bridge
TOOL RESULT DETAILS
eval pass 10 manifests evaluated
scorecard pass 0 errors, 3 warnings, 2 info
governance.hasOwner (warning), 1:
reflector-system/reflector: package 'reflector' has no meta.owner
reliability.boundedResources (warning), 1:
reflector-system/reflector/reflector: container 'reflector' is missing resource settings: requests.cpu, requests.memory, limits.cpu, limits.memory. Set CPU and memory requests and limits. Without a memory limit, a workload can exhaust the node's memory.
security.hasNetworkPolicy (warning), 1:
reflector-system: namespace 'reflector-system' has workloads but no network policy
2 info finding(s) not listed; run with -v to list them. Inspect one of the resources produced by the chart:
❱ kix build how-to-helm-bridge --output json
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "reflector",
"namespace": "reflector-system",
"labels": {
"app.kubernetes.io/instance": "reflector",
"app.kubernetes.io/managed-by": "kix",
"app.kubernetes.io/name": "reflector",
"app.kubernetes.io/version": "10.0.60"
}
},
"spec": {
"replicas": 1,
"serviceAccountName": "reflector",
"containers": [
{
"name": "reflector",
"image": "docker.io/emberstack/kubernetes-reflector:10.0.60"
}
]
}
} The rendered Deployment carries Kix’s cluster and package metadata. Kix also reconstructs dependencies between the chart’s ServiceAccounts, RBAC resources, Services, and workloads.
Deploy the chart
Section titled “Deploy the chart”Deploy and inspect the package instance:
❱ kix deploy how-to-helm-bridge❱ kix status how-to-helm-bridge❱ kubectl get deployment -n reflector-system reflector When you update the chart, change version and hash together, run kix check,
and review kix plan before deploying.
Kix picks the chart’s root resource: the only Service, or, with no
Service, the only Deployment, StatefulSet, or DaemonSet. When the chart
renders several, evaluation fails and lists them; name the one consumers
connect to with root = { kind = "Service"; name = "<name>"; }; in the
kix.helmChart arguments. Charts that need output builders or
cross-chart dependencies should use a dedicated Kix package built with
scope.helm.importChart.