@intentius/chant-lexicon-helm 0.41.19 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/integrity.json +3 -3
- package/dist/manifest.json +1 -1
- package/dist/okf/index.md +39 -0
- package/dist/okf/rules/WHM001.md +15 -0
- package/dist/okf/rules/WHM002.md +15 -0
- package/dist/okf/rules/WHM003.md +15 -0
- package/dist/okf/rules/WHM004.md +15 -0
- package/dist/okf/rules/WHM005.md +15 -0
- package/dist/okf/rules/WHM101.md +15 -0
- package/dist/okf/rules/WHM102.md +15 -0
- package/dist/okf/rules/WHM103.md +11 -0
- package/dist/okf/rules/WHM104.md +15 -0
- package/dist/okf/rules/WHM105.md +11 -0
- package/dist/okf/rules/WHM201.md +11 -0
- package/dist/okf/rules/WHM202.md +11 -0
- package/dist/okf/rules/WHM203.md +15 -0
- package/dist/okf/rules/WHM204.md +15 -0
- package/dist/okf/rules/WHM301.md +16 -0
- package/dist/okf/rules/WHM302.md +15 -0
- package/dist/okf/rules/WHM401.md +15 -0
- package/dist/okf/rules/WHM402.md +15 -0
- package/dist/okf/rules/WHM403.md +15 -0
- package/dist/okf/rules/WHM404.md +11 -0
- package/dist/okf/rules/WHM405.md +15 -0
- package/dist/okf/rules/WHM406.md +15 -0
- package/dist/okf/rules/WHM407.md +15 -0
- package/dist/okf/rules/WHM501.md +15 -0
- package/dist/okf/rules/WHM502.md +11 -0
- package/dist/okf/types/Chart.md +19 -0
- package/dist/okf/types/HelmCRD.md +9 -0
- package/dist/okf/types/HelmNotes.md +9 -0
- package/dist/okf/types/HelmTest.md +13 -0
- package/dist/okf/types/Values.md +24 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/skills/chant-helm.md +2 -2
- package/package.json +2 -2
- package/src/render.test.ts +85 -0
- package/src/render.ts +3 -0
- package/src/skills/chant-helm.md +2 -2
package/README.md
CHANGED
|
@@ -10,6 +10,10 @@ npm install --save-dev @intentius/chant @intentius/chant-lexicon-helm
|
|
|
10
10
|
|
|
11
11
|
**[Documentation →](https://intentius.io/chant/lexicons/helm/)**
|
|
12
12
|
|
|
13
|
+
## Supported Helm versions
|
|
14
|
+
|
|
15
|
+
The lexicon targets Helm 4 and CI runs against a pinned Helm 4 release. Rendering also works with a Helm 3 CLI on PATH.
|
|
16
|
+
|
|
13
17
|
## Related Packages
|
|
14
18
|
|
|
15
19
|
| Package | Role |
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "3976c2ad819dd2c486f6a141a635f08c3d75c487616c66acd17ed1a7dd2dd08c",
|
|
5
5
|
"meta.json": "14243c5730a07c6a6edc35ddd351438547d58df5cf345f2233a355b0c7611ccc",
|
|
6
6
|
"types/index.d.ts": "5377696ca8698cd2999e4680feb8e8e4b54a7b49fb603a87b2f27356114d1794",
|
|
7
7
|
"rules/chart-metadata.ts": "8f3377e893d5e2828460b7fe5924fca098334245a9a2fdb90f6b67e490eaf091",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"rules/whm407.ts": "200190f5de2d86d2bcc5aee0b5ce4807919ec727b1fc14576ea17b9b3073838b",
|
|
31
31
|
"rules/whm501.ts": "e6afa7c0eface9820380bf189fe8be58f4a6997dd5b74f76335022650616d080",
|
|
32
32
|
"rules/whm502.ts": "c3ed7b4b5215d96e46eba758aca2171928d8f8fb1eb20452ea6b4393672755b0",
|
|
33
|
-
"skills/chant-helm.md": "
|
|
33
|
+
"skills/chant-helm.md": "89edaffd63b549045414ecdecf380daddb042b3b41a5d04754c2953ab7c5e70a",
|
|
34
34
|
"skills/chant-helm-patterns.md": "9e79e6a46391da46709d8aa57e2825a7cd9eb981cd923f02ad60836c49b2561e",
|
|
35
35
|
"skills/chant-helm-security.md": "bfc367eabceed2e84f1cf94501b407df78aeed963cec104f24a321d0962063c9"
|
|
36
36
|
},
|
|
37
|
-
"composite": "
|
|
37
|
+
"composite": "44227a56d4cf67f74bdcbda4aeb8afa90c559d1fb0f995d02143bdadf73b5ede"
|
|
38
38
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
okf_version: '0.2'
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Resource types
|
|
6
|
+
|
|
7
|
+
* [Chart](/types/Chart.md) - Helm::Chart
|
|
8
|
+
* [HelmCRD](/types/HelmCRD.md) - Helm::CRD
|
|
9
|
+
* [HelmNotes](/types/HelmNotes.md) - Helm::Notes
|
|
10
|
+
* [HelmTest](/types/HelmTest.md) - Helm::Test
|
|
11
|
+
* [Values](/types/Values.md) - Helm::Values
|
|
12
|
+
|
|
13
|
+
# Rules
|
|
14
|
+
|
|
15
|
+
* [WHM001](/rules/WHM001.md) - Chart Metadata Required
|
|
16
|
+
* [WHM002](/rules/WHM002.md) - Values Should Not Contain Bare Secrets
|
|
17
|
+
* [WHM003](/rules/WHM003.md) - Container Images Should Use Values References
|
|
18
|
+
* [WHM004](/rules/WHM004.md) - HelmTpl Expression Has No Effect in Values Constructor
|
|
19
|
+
* [WHM005](/rules/WHM005.md) - Chart with sub-chart dependencies but no templates should deploy upstream chart directly
|
|
20
|
+
* [WHM101](/rules/WHM101.md) - Chart.yaml must have required fields (apiVersion v2, name, version)
|
|
21
|
+
* [WHM102](/rules/WHM102.md) - values.schema.json should be present when Values are non-empty
|
|
22
|
+
* [WHM103](/rules/WHM103.md) - Go template syntax must be valid (balanced braces)
|
|
23
|
+
* [WHM104](/rules/WHM104.md) - NOTES.txt should exist for application charts
|
|
24
|
+
* [WHM105](/rules/WHM105.md) - _helpers.tpl must exist in templates/
|
|
25
|
+
* [WHM201](/rules/WHM201.md) - K8s resources should include standard Helm labels
|
|
26
|
+
* [WHM202](/rules/WHM202.md) - Hook weights should be defined when multiple hooks exist
|
|
27
|
+
* [WHM203](/rules/WHM203.md) - Values entries should be documented via schema or comments
|
|
28
|
+
* [WHM204](/rules/WHM204.md) - Chart dependencies should use semver ranges, not pinned versions
|
|
29
|
+
* [WHM301](/rules/WHM301.md) - Application charts should include at least one Helm test
|
|
30
|
+
* [WHM302](/rules/WHM302.md) - Container resources (limits/requests) should be set via values or defaults
|
|
31
|
+
* [WHM401](/rules/WHM401.md) - Container images should not use :latest tag or omit tag entirely
|
|
32
|
+
* [WHM402](/rules/WHM402.md) - Containers should set runAsNonRoot in security context
|
|
33
|
+
* [WHM403](/rules/WHM403.md) - Containers should set readOnlyRootFilesystem in security context
|
|
34
|
+
* [WHM404](/rules/WHM404.md) - Containers must not run in privileged mode
|
|
35
|
+
* [WHM405](/rules/WHM405.md) - Resource specs should include cpu and memory in limits/requests
|
|
36
|
+
* [WHM406](/rules/WHM406.md) - CRDs in crds/ directory are never upgraded or deleted by Helm
|
|
37
|
+
* [WHM407](/rules/WHM407.md) - Secrets with inline data should use ExternalSecret or SealedSecret
|
|
38
|
+
* [WHM501](/rules/WHM501.md) - Detect values keys that are defined but never referenced in templates
|
|
39
|
+
* [WHM502](/rules/WHM502.md) - Detect deprecated or invalid Kubernetes API versions
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: WHM001
|
|
4
|
+
description: Chart Metadata Required
|
|
5
|
+
id: WHM001
|
|
6
|
+
severity: error
|
|
7
|
+
category: correctness
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Chart Metadata Required
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: WHM002
|
|
4
|
+
description: Values Should Not Contain Bare Secrets
|
|
5
|
+
id: WHM002
|
|
6
|
+
severity: warning
|
|
7
|
+
category: security
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Values Should Not Contain Bare Secrets
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: WHM003
|
|
4
|
+
description: Container Images Should Use Values References
|
|
5
|
+
id: WHM003
|
|
6
|
+
severity: warning
|
|
7
|
+
category: correctness
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Container Images Should Use Values References
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: lint-rule
|
|
3
|
+
title: WHM004
|
|
4
|
+
description: HelmTpl Expression Has No Effect in Values Constructor
|
|
5
|
+
id: WHM004
|
|
6
|
+
severity: warning
|
|
7
|
+
category: correctness
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
HelmTpl Expression Has No Effect in Values Constructor
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM005
|
|
4
|
+
description: Chart with sub-chart dependencies but no templates should deploy upstream chart directly
|
|
5
|
+
id: WHM005
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Chart with sub-chart dependencies but no templates should deploy upstream chart directly
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM101
|
|
4
|
+
description: Chart.yaml must have required fields (apiVersion v2, name, version)
|
|
5
|
+
id: WHM101
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Chart.yaml must have required fields (apiVersion v2, name, version)
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM102
|
|
4
|
+
description: values.schema.json should be present when Values are non-empty
|
|
5
|
+
id: WHM102
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
values.schema.json should be present when Values are non-empty
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM103
|
|
4
|
+
description: Go template syntax must be valid (balanced braces)
|
|
5
|
+
id: WHM103
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Go template syntax must be valid (balanced braces)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM104
|
|
4
|
+
description: NOTES.txt should exist for application charts
|
|
5
|
+
id: WHM104
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
NOTES.txt should exist for application charts
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM105
|
|
4
|
+
description: _helpers.tpl must exist in templates/
|
|
5
|
+
id: WHM105
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
_helpers.tpl must exist in templates/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM201
|
|
4
|
+
description: K8s resources should include standard Helm labels
|
|
5
|
+
id: WHM201
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
K8s resources should include standard Helm labels
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM202
|
|
4
|
+
description: Hook weights should be defined when multiple hooks exist
|
|
5
|
+
id: WHM202
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Hook weights should be defined when multiple hooks exist
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM203
|
|
4
|
+
description: Values entries should be documented via schema or comments
|
|
5
|
+
id: WHM203
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Values entries should be documented via schema or comments
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM204
|
|
4
|
+
description: Chart dependencies should use semver ranges, not pinned versions
|
|
5
|
+
id: WHM204
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Chart dependencies should use semver ranges, not pinned versions
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM301
|
|
4
|
+
description: Application charts should include at least one Helm test
|
|
5
|
+
id: WHM301
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Application charts should include at least one Helm test
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
16
|
+
- [HelmTest](/types/HelmTest.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM302
|
|
4
|
+
description: Container resources (limits/requests) should be set via values or defaults
|
|
5
|
+
id: WHM302
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Container resources (limits/requests) should be set via values or defaults
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM401
|
|
4
|
+
description: Container images should not use :latest tag or omit tag entirely
|
|
5
|
+
id: WHM401
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Container images should not use :latest tag or omit tag entirely
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM402
|
|
4
|
+
description: Containers should set runAsNonRoot in security context
|
|
5
|
+
id: WHM402
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Containers should set runAsNonRoot in security context
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM403
|
|
4
|
+
description: Containers should set readOnlyRootFilesystem in security context
|
|
5
|
+
id: WHM403
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Containers should set readOnlyRootFilesystem in security context
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM404
|
|
4
|
+
description: Containers must not run in privileged mode
|
|
5
|
+
id: WHM404
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Containers must not run in privileged mode
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM405
|
|
4
|
+
description: Resource specs should include cpu and memory in limits/requests
|
|
5
|
+
id: WHM405
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Resource specs should include cpu and memory in limits/requests
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM406
|
|
4
|
+
description: CRDs in crds/ directory are never upgraded or deleted by Helm
|
|
5
|
+
id: WHM406
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
CRDs in crds/ directory are never upgraded or deleted by Helm
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Chart](/types/Chart.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM407
|
|
4
|
+
description: Secrets with inline data should use ExternalSecret or SealedSecret
|
|
5
|
+
id: WHM407
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Secrets with inline data should use ExternalSecret or SealedSecret
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM501
|
|
4
|
+
description: Detect values keys that are defined but never referenced in templates
|
|
5
|
+
id: WHM501
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Detect values keys that are defined but never referenced in templates
|
|
12
|
+
|
|
13
|
+
## Applies to
|
|
14
|
+
|
|
15
|
+
- [Values](/types/Values.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: WHM502
|
|
4
|
+
description: Detect deprecated or invalid Kubernetes API versions
|
|
5
|
+
id: WHM502
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: helm
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/helm/rules/
|
|
10
|
+
---
|
|
11
|
+
Detect deprecated or invalid Kubernetes API versions
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: Chart
|
|
4
|
+
description: Chart.yaml metadata — defines the chart identity, version, and type.
|
|
5
|
+
name: Chart
|
|
6
|
+
lexicon: helm
|
|
7
|
+
resource_type: Helm::Chart
|
|
8
|
+
---
|
|
9
|
+
Chart.yaml metadata — defines the chart identity, version, and type.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [WHM001](/rules/WHM001.md): Chart Metadata Required
|
|
14
|
+
- [WHM005](/rules/WHM005.md): Chart with sub-chart dependencies but no templates should deploy upstream chart directly
|
|
15
|
+
- [WHM101](/rules/WHM101.md): Chart.yaml must have required fields (apiVersion v2, name, version)
|
|
16
|
+
- [WHM104](/rules/WHM104.md): NOTES.txt should exist for application charts
|
|
17
|
+
- [WHM204](/rules/WHM204.md): Chart dependencies should use semver ranges, not pinned versions
|
|
18
|
+
- [WHM301](/rules/WHM301.md): Application charts should include at least one Helm test
|
|
19
|
+
- [WHM406](/rules/WHM406.md): CRDs in crds/ directory are never upgraded or deleted by Helm
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: HelmTest
|
|
4
|
+
description: 'Helm test pod — annotated with helm.sh/hook: test.'
|
|
5
|
+
name: HelmTest
|
|
6
|
+
lexicon: helm
|
|
7
|
+
resource_type: Helm::Test
|
|
8
|
+
---
|
|
9
|
+
Helm test pod — annotated with helm.sh/hook: test.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [WHM301](/rules/WHM301.md): Application charts should include at least one Helm test
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: Values
|
|
4
|
+
description: Typed values definition — emits values.yaml and values.schema.json.
|
|
5
|
+
name: Values
|
|
6
|
+
lexicon: helm
|
|
7
|
+
resource_type: Helm::Values
|
|
8
|
+
---
|
|
9
|
+
Typed values definition — emits values.yaml and values.schema.json.
|
|
10
|
+
|
|
11
|
+
## Governed by
|
|
12
|
+
|
|
13
|
+
- [WHM002](/rules/WHM002.md): Values Should Not Contain Bare Secrets
|
|
14
|
+
- [WHM003](/rules/WHM003.md): Container Images Should Use Values References
|
|
15
|
+
- [WHM004](/rules/WHM004.md): HelmTpl Expression Has No Effect in Values Constructor
|
|
16
|
+
- [WHM102](/rules/WHM102.md): values.schema.json should be present when Values are non-empty
|
|
17
|
+
- [WHM203](/rules/WHM203.md): Values entries should be documented via schema or comments
|
|
18
|
+
- [WHM302](/rules/WHM302.md): Container resources (limits/requests) should be set via values or defaults
|
|
19
|
+
- [WHM401](/rules/WHM401.md): Container images should not use :latest tag or omit tag entirely
|
|
20
|
+
- [WHM402](/rules/WHM402.md): Containers should set runAsNonRoot in security context
|
|
21
|
+
- [WHM403](/rules/WHM403.md): Containers should set readOnlyRootFilesystem in security context
|
|
22
|
+
- [WHM405](/rules/WHM405.md): Resource specs should include cpu and memory in limits/requests
|
|
23
|
+
- [WHM407](/rules/WHM407.md): Secrets with inline data should use ExternalSecret or SealedSecret
|
|
24
|
+
- [WHM501](/rules/WHM501.md): Detect values keys that are defined but never referenced in templates
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAeH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAeH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAuHD,eAAO,MAAM,UAAU,8GA8BP,CAAC"}
|
|
@@ -292,7 +292,7 @@ const lifecycle = HelmCRDLifecycle({
|
|
|
292
292
|
|
|
293
293
|
## OCI registry workflow
|
|
294
294
|
|
|
295
|
-
Helm
|
|
295
|
+
Helm 4 supports OCI registries as first-class chart repositories.
|
|
296
296
|
|
|
297
297
|
```bash
|
|
298
298
|
# Login to an OCI registry
|
|
@@ -407,7 +407,7 @@ helm uninstall my-app --keep-history # preserve history for rollback
|
|
|
407
407
|
### Common errors
|
|
408
408
|
|
|
409
409
|
#### "apiVersion must be v2"
|
|
410
|
-
Helm
|
|
410
|
+
Helm requires `apiVersion: v2` in Chart.yaml. Update your Chart metadata.
|
|
411
411
|
|
|
412
412
|
#### "unbalanced template braces"
|
|
413
413
|
A Go template expression has mismatched `{{` / `}}`. Check your intrinsic usage.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-helm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"description": "Helm chart lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/js-yaml": "^4.0.9"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@intentius/chant": "^0.
|
|
84
|
+
"@intentius/chant": "^0.42.1",
|
|
85
85
|
"typescript": "^5.9.3"
|
|
86
86
|
}
|
|
87
87
|
}
|
package/src/render.test.ts
CHANGED
|
@@ -87,6 +87,80 @@ spec:
|
|
|
87
87
|
`,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
+
// CRDs shipped in the chart's crds/ directory — helm template drops these
|
|
91
|
+
// unless --include-crds is passed.
|
|
92
|
+
mkdirSync(join(CHART_DIR, "crds"), { recursive: true });
|
|
93
|
+
writeFileSync(
|
|
94
|
+
join(CHART_DIR, "crds", "widgets.yaml"),
|
|
95
|
+
`apiVersion: apiextensions.k8s.io/v1
|
|
96
|
+
kind: CustomResourceDefinition
|
|
97
|
+
metadata:
|
|
98
|
+
name: widgets.example.com
|
|
99
|
+
spec:
|
|
100
|
+
group: example.com
|
|
101
|
+
names:
|
|
102
|
+
kind: Widget
|
|
103
|
+
listKind: WidgetList
|
|
104
|
+
plural: widgets
|
|
105
|
+
singular: widget
|
|
106
|
+
scope: Namespaced
|
|
107
|
+
versions:
|
|
108
|
+
- name: v1
|
|
109
|
+
served: true
|
|
110
|
+
storage: true
|
|
111
|
+
schema:
|
|
112
|
+
openAPIV3Schema:
|
|
113
|
+
type: object
|
|
114
|
+
`,
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
// A subchart with its own crds/ directory — must also survive the render.
|
|
118
|
+
const SUBCHART_DIR = join(CHART_DIR, "charts", "tiny-sub");
|
|
119
|
+
mkdirSync(join(SUBCHART_DIR, "crds"), { recursive: true });
|
|
120
|
+
mkdirSync(join(SUBCHART_DIR, "templates"), { recursive: true });
|
|
121
|
+
writeFileSync(
|
|
122
|
+
join(SUBCHART_DIR, "Chart.yaml"),
|
|
123
|
+
`apiVersion: v2
|
|
124
|
+
name: tiny-sub
|
|
125
|
+
description: Subchart fixture with its own CRD
|
|
126
|
+
type: application
|
|
127
|
+
version: 0.1.0
|
|
128
|
+
`,
|
|
129
|
+
);
|
|
130
|
+
writeFileSync(
|
|
131
|
+
join(SUBCHART_DIR, "crds", "gadgets.yaml"),
|
|
132
|
+
`apiVersion: apiextensions.k8s.io/v1
|
|
133
|
+
kind: CustomResourceDefinition
|
|
134
|
+
metadata:
|
|
135
|
+
name: gadgets.example.com
|
|
136
|
+
spec:
|
|
137
|
+
group: example.com
|
|
138
|
+
names:
|
|
139
|
+
kind: Gadget
|
|
140
|
+
listKind: GadgetList
|
|
141
|
+
plural: gadgets
|
|
142
|
+
singular: gadget
|
|
143
|
+
scope: Namespaced
|
|
144
|
+
versions:
|
|
145
|
+
- name: v1
|
|
146
|
+
served: true
|
|
147
|
+
storage: true
|
|
148
|
+
schema:
|
|
149
|
+
openAPIV3Schema:
|
|
150
|
+
type: object
|
|
151
|
+
`,
|
|
152
|
+
);
|
|
153
|
+
writeFileSync(
|
|
154
|
+
join(SUBCHART_DIR, "templates", "configmap.yaml"),
|
|
155
|
+
`apiVersion: v1
|
|
156
|
+
kind: ConfigMap
|
|
157
|
+
metadata:
|
|
158
|
+
name: {{ .Release.Name }}-tiny-sub
|
|
159
|
+
data:
|
|
160
|
+
role: subchart
|
|
161
|
+
`,
|
|
162
|
+
);
|
|
163
|
+
|
|
90
164
|
// Package the chart into a .tgz and create a repo index.yaml.
|
|
91
165
|
execFileSync("helm", ["package", CHART_DIR, "-d", REPO_DIR], { stdio: "ignore" });
|
|
92
166
|
execFileSync("helm", ["repo", "index", REPO_DIR], { stdio: "ignore" });
|
|
@@ -118,6 +192,17 @@ describe.skipIf(!fixtureAvailable)("HelmRender", () => {
|
|
|
118
192
|
expect(service).toBeDefined();
|
|
119
193
|
});
|
|
120
194
|
|
|
195
|
+
test("CRDs from crds/ directories are included (top level + subchart)", () => {
|
|
196
|
+
const result = HelmRender({
|
|
197
|
+
name: "rel",
|
|
198
|
+
chart: CHART_DIR,
|
|
199
|
+
noCache: true,
|
|
200
|
+
});
|
|
201
|
+
const keys = Object.keys(result.members as Record<string, unknown>);
|
|
202
|
+
expect(keys).toContain("CustomResourceDefinition_widgets_example_com");
|
|
203
|
+
expect(keys).toContain("CustomResourceDefinition_gadgets_example_com");
|
|
204
|
+
});
|
|
205
|
+
|
|
121
206
|
test("createNamespace adds a Namespace declarable", () => {
|
|
122
207
|
const result = HelmRender({
|
|
123
208
|
name: "rel",
|
package/src/render.ts
CHANGED
|
@@ -121,6 +121,9 @@ function renderViaHelm(props: HelmRenderProps): string {
|
|
|
121
121
|
"template",
|
|
122
122
|
props.name,
|
|
123
123
|
props.chart,
|
|
124
|
+
// Without this, `helm template` silently drops manifests shipped in the
|
|
125
|
+
// chart's (or a subchart's) crds/ directory.
|
|
126
|
+
"--include-crds",
|
|
124
127
|
...fetchArgs,
|
|
125
128
|
...isolationArgs,
|
|
126
129
|
...(props.namespace ? ["--namespace", props.namespace] : []),
|
package/src/skills/chant-helm.md
CHANGED
|
@@ -292,7 +292,7 @@ const lifecycle = HelmCRDLifecycle({
|
|
|
292
292
|
|
|
293
293
|
## OCI registry workflow
|
|
294
294
|
|
|
295
|
-
Helm
|
|
295
|
+
Helm 4 supports OCI registries as first-class chart repositories.
|
|
296
296
|
|
|
297
297
|
```bash
|
|
298
298
|
# Login to an OCI registry
|
|
@@ -407,7 +407,7 @@ helm uninstall my-app --keep-history # preserve history for rollback
|
|
|
407
407
|
### Common errors
|
|
408
408
|
|
|
409
409
|
#### "apiVersion must be v2"
|
|
410
|
-
Helm
|
|
410
|
+
Helm requires `apiVersion: v2` in Chart.yaml. Update your Chart metadata.
|
|
411
411
|
|
|
412
412
|
#### "unbalanced template braces"
|
|
413
413
|
A Go template expression has mismatched `{{` / `}}`. Check your intrinsic usage.
|