ワンクリックで
helm-chart
Guidelines for modifying the Helm chart. Use when changing values.yaml, templates, or adding new configuration options.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guidelines for modifying the Helm chart. Use when changing values.yaml, templates, or adding new configuration options.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Prepare and publish a new release. Use when the user asks to release, cut a release, or publish a new version.
Guidelines for documenting reusable patterns discovered during work. Use when completing tasks that reveal non-obvious workflows or project conventions.
Guidelines for creating and maintaining example YAML files in the cmd/examples directory. Use when adding new CRD fields or modifying example code.
| name | helm-chart |
| description | Guidelines for modifying the Helm chart. Use when changing values.yaml, templates, or adding new configuration options. |
When modifying the Helm chart at charts/kaniop/, follow this checklist to ensure completeness.
Add or modify the value with proper YAML doc comments:
## Kubernetes cluster domain used for DNS resolution.
## Change this if your cluster uses a non-default DNS domain.
clusterDomain: "cluster.local"
Always update when adding or modifying a value. Add a matching JSON schema entry:
"clusterDomain": {
"type": "string",
"description": "Kubernetes cluster domain used for DNS resolution.",
"default": "cluster.local"
}
Find the right location by searching for neighboring values (e.g., add after idmReconcileIntervalSeconds).
Update the relevant template(s) to use the new value. For env vars:
- name: CLUSTER_DOMAIN
value: {{ .Values.clusterDomain }}
For conditional rendering:
{{- if .Values.tracing.enabled }}
All Helm chart changes must include unit tests. Tests live in charts/kaniop/tests/.
{resource}_test.yaml (e.g., deployment_test.yaml, webhook-certificate_test.yaml)# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: test deployment
templates:
- templates/deployment.yaml
tests:
- it: Should render with default values
release:
name: kaniop
namespace: kaniop
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: CLUSTER_DOMAIN
value: cluster.local
any: true
- it: Should render with custom value
release:
name: kaniop
namespace: kaniop
set:
clusterDomain: mycluster.example.com
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: CLUSTER_DOMAIN
value: mycluster.example.com
any: true
When a template renders multiple documents (e.g., cert-manager.yaml renders Issuer + Certificate), use documentIndex or provide an issuerRef to limit rendering:
# With issuerRef, only the Certificate is rendered (1 document)
set:
webhook.certManager.enabled: true
webhook.certManager.issuerRef.name: selfsigned-issuer
webhook.certManager.issuerRef.kind: ClusterIssuer
asserts:
- hasDocuments:
count: 1
helm unittest charts/kaniop
All tests must pass before committing.
When adding a new operator configuration via env var, follow this pattern:
cmd/operator/src/main.rs:#[arg(long, default_value = "cluster.local", env)]
cluster_domain: String,
The env attribute auto-maps to uppercase field name (CLUSTER_DOMAIN). Use env = "CUSTOM_NAME" for different names.
libs/operator/src/controller/mod.rs:const DEFAULT_CLUSTER_DOMAIN: &str = "cluster.local";
static CLUSTER_DOMAIN: OnceLock<String> = OnceLock::new();
pub fn set_cluster_domain(domain: String) {
let _ = CLUSTER_DOMAIN.set(domain);
}
pub fn cluster_domain() -> &'static str {
CLUSTER_DOMAIN.get_or_init(|| DEFAULT_CLUSTER_DOMAIN.to_string())
}
cmd/operator/src/main.rs:set_cluster_domain(args.cluster_domain);
use crate::controller::cluster_domain;
let host = format!("{}.{}.svc.{}", service, namespace, cluster_domain());
| Pitfall | Fix |
|---|---|
| Forgetting values.schema.json | Always update schema when changing values |
| No unit test for new feature | Add test with default AND custom value cases |
Hardcoded cluster.local | Use .Values.clusterDomain in templates |
| Multi-document template test failures | Use issuerRef or documentIndex to scope assertions |
| Env var not passed to deployment | Add to env list in templates/deployment.yaml |