Skip to content

Commit 1e61cd3

Browse files
committed
feat(charts): [kubernetes-manifests] add the first version
1 parent c7740a8 commit 1e61cd3

File tree

10 files changed

+319
-0
lines changed

10 files changed

+319
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Remove release files
2+
release.json
3+
# Remove ignore files
4+
.gitignore
5+
.helmignore
6+
7+
# Remove all shell scripts
8+
*.sh
9+
10+
# Remove all resulting packages
11+
./*.tgz
12+
./.
13+
./..
14+
.cache
15+
# Just in case if someone forgets to remove their local.properties file
16+
*.properties
17+
18+
# Internal cluster values
19+
values/
20+
21+
# Rendered templates
22+
rendered/
23+
24+
# Got it from the Internet
25+
# Patterns to ignore when building packages.
26+
# This supports shell glob matching, relative path matching, and
27+
# negation (prefixed with !). Only one pattern per line.
28+
.DS_Store
29+
# Common VCS dirs
30+
.git/
31+
.bzr/
32+
.bzrignore
33+
.hg/
34+
.hgignore
35+
.svn/
36+
# Common backup files
37+
*.swp
38+
*.bak
39+
*.tmp
40+
*~
41+
# Various IDEs
42+
.project
43+
.idea/
44+
*.tmproj
45+
.vscode/
46+
.helm-docs
47+
.helm_output
48+
*.md
49+
.env
50+
Makefile
51+
*.lock
52+
examples/
53+
unittests/
54+
tests/
55+
values.schema.json
56+
schema.values.json
57+
# Docs related
58+
#README.md
59+
LICENSE
60+
61+
ct.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v2
2+
name: kubernetes-manifests
3+
description: A Generic Helm chart for packaging Kubernetes manifests
4+
type: application
5+
version: 1.0.0
6+
appVersion: 1.0.0
7+
icon: https://avatars.githubusercontent.com/u/878437?s=200&v=4
8+
home: https://jetbrains.com/
9+
annotations:
10+
category: Infrastructure
11+
keywords:
12+
- jetbrains
13+
- template
14+
maintainers:
15+
- name: JetBrains
16+
url: https://www.jetbrains.com/support

charts/kubernetes-manifests/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include ../../lib/Makefiles/Helm.mk
2+
3+

charts/kubernetes-manifests/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Kubernetes Manifests
2+
3+
`kubernetes-manifests` is a generic Helm chart to use for the packaging of ad-hoc Kubernetes manifests in one bundle.
4+
5+
## Use Cases
6+
7+
Use this chart to package Kubernetes manifests that are not part of a Helm chart during a Helm to deploy in Kubernetes,
8+
and the main application chart does not include a parameter in the values.yaml for passing custom Kubernetes manifests.
9+
10+
## How to use this chart
11+
12+
This chart is formatted as an OCI package. Include it as a dependency from `https://public.jetbrains.space/p/helm/packages/container/library`.
13+
14+
Add it to your Chart.yaml file of your Helm package.
15+
16+
```yaml
17+
dependencies:
18+
- name: kubernetes-manifests
19+
repository: oci://public.registry.jetbrains.space/p/helm/library
20+
version: 1.x.x
21+
alias: app
22+
```
23+
24+
## Repository
25+
26+
Checkout the [release.json](release.json) for details about where the chart is hosted.
27+
28+
## Prerequisites
29+
30+
- Kubernetes 1.24+;
31+
32+
- Helm 3+.
33+
34+
## Parameters
35+
36+
### Global parameters
37+
38+
| Name | Description | Value |
39+
| --------- | ----------------------------------------------------------- | ------ |
40+
| `global` | Provide a map of global values to be used in the templates | `{}` |
41+
| `include` | Includes/Excludes the manifests packaged by this Helm chart | `true` |
42+
43+
### Manifests to package
44+
45+
| Name | Description | Value |
46+
| ----------------------------------- | ------------------------------------------------------- | ----- |
47+
| `kubernetesYamlResources` | Kubernetes objects to add to the package | `[]` |
48+
| `additionalKubernetesYamlResources` | Add additional Kubernetes objects to add to the package | `[]` |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"metadata": {
3+
"name": "kubernetes-manifests",
4+
"description": "Find more details about this chart in its Chart.yaml file."
5+
},
6+
"spec": {
7+
"repositories": [
8+
{
9+
"name": "helm-library",
10+
"description": "Repository for Kubernetes charts",
11+
"url": "public.registry.jetbrains.space/p/helm/library",
12+
"type": "oci",
13+
"env": {
14+
"nameSelector": "HELM_CHARTS_REGISTRY"
15+
}
16+
}
17+
]
18+
}
19+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kubernetes-manifests
2+
====================
3+
Chart Version: {{ .Chart.Version }}
4+
Support contact: it is outlined in the Chart.yaml file
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{- if .Values.include -}}
2+
{{- $kubernetesResources := concat .Values.kubernetesYamlResources .Values.additionalKubernetesYamlResources -}}
3+
{{- if $kubernetesResources -}}
4+
apiVersion: v1
5+
kind: List
6+
items:
7+
{{- tpl ($kubernetesResources | toYaml) $ | nindent 4 }}
8+
{{- end -}}
9+
{{- end -}}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
suite: app kubernetes resources
2+
templates:
3+
- kubernetesresources/manifest.yaml
4+
tests:
5+
- it: should not be created by default
6+
asserts:
7+
- hasDocuments:
8+
count: 0
9+
- it: should not be generated when include is set to false
10+
set:
11+
include: false
12+
kubernetesYamlResources:
13+
- apiVersion: v1
14+
kind: Nameapp
15+
metadata:
16+
name: kong
17+
labels:
18+
app: kong
19+
asserts:
20+
- hasDocuments:
21+
count: 0
22+
- it: should allow to compose a set of custom YAML objects
23+
set:
24+
kubernetesYamlResources:
25+
- apiVersion: v1
26+
kind: Nameapp
27+
metadata:
28+
name: kong
29+
labels:
30+
app: kong
31+
- apiVersion: v1
32+
kind: ServiceAccount
33+
metadata:
34+
nameapp: kong
35+
name: kong
36+
labels:
37+
app: kong
38+
additionalKubernetesYamlResources:
39+
- apiVersion: autoscaling/v1
40+
kind: HorizontalPodAutoscaler
41+
metadata:
42+
name: kong-apigateway-weu-dev-ha
43+
nameapp: kong
44+
labels:
45+
app: kong
46+
spec:
47+
scaleTargetRef:
48+
apiVersion: apps/v1
49+
kind: Deployment
50+
name: kong-apigateway-weu-dev
51+
minReplicas: 1
52+
maxReplicas: 7
53+
targetCPUUtilizationPercentage: 71
54+
asserts:
55+
- equal:
56+
path: items
57+
value:
58+
- apiVersion: v1
59+
kind: Nameapp
60+
metadata:
61+
labels:
62+
app: kong
63+
name: kong
64+
- apiVersion: v1
65+
kind: ServiceAccount
66+
metadata:
67+
labels:
68+
app: kong
69+
name: kong
70+
nameapp: kong
71+
- apiVersion: autoscaling/v1
72+
kind: HorizontalPodAutoscaler
73+
metadata:
74+
labels:
75+
app: kong
76+
name: kong-apigateway-weu-dev-ha
77+
nameapp: kong
78+
spec:
79+
maxReplicas: 7
80+
minReplicas: 1
81+
scaleTargetRef:
82+
apiVersion: apps/v1
83+
kind: Deployment
84+
name: kong-apigateway-weu-dev
85+
targetCPUUtilizationPercentage: 71
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"title": "Chart Values",
3+
"type": "object",
4+
"properties": {
5+
"global": {
6+
"type": "object",
7+
"description": "Provide a map of global values to be used in the templates",
8+
"default": {}
9+
},
10+
"include": {
11+
"type": "boolean",
12+
"description": "Includes/Excludes the manifests packaged by this Helm chart",
13+
"default": true
14+
},
15+
"kubernetesYamlResources": {
16+
"type": "array",
17+
"description": "Kubernetes objects to add to the package",
18+
"default": [],
19+
"items": {}
20+
},
21+
"additionalKubernetesYamlResources": {
22+
"type": "array",
23+
"description": "Add additional Kubernetes objects to add to the package",
24+
"default": [],
25+
"items": {}
26+
}
27+
}
28+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
##
2+
## This is a YAML-formatted file.
3+
##
4+
5+
## @section Global parameters
6+
##
7+
## @param global Provide a map of global values to be used in the templates
8+
global: {}
9+
10+
11+
## @param include Includes/Excludes the manifests packaged by this Helm chart
12+
##
13+
include: true
14+
## @section Manifests to package
15+
##
16+
## @param kubernetesYamlResources Kubernetes objects to add to the package
17+
##
18+
## Example:
19+
## - apiVersion: v1
20+
## kind: ServiceAccount
21+
## metadata:
22+
## namespace: '{{ .Release.namespace }}'
23+
## name: '{{ include "lib.appName" . }}'-newsa
24+
## labels:
25+
## app.kubernetes.io/component: '{{ include "lib.componentName" . }}'
26+
## '{{- include "lib.labels" . | nindent 4 }}'
27+
##
28+
kubernetesYamlResources: []
29+
## @param additionalKubernetesYamlResources Add additional Kubernetes objects to add to the package
30+
##
31+
## Example:
32+
## - apiVersion: v1
33+
## kind: ResourceQuota
34+
## metadata:
35+
## name: '{{ include "lib.appName" $ }}'
36+
## namespace: '{{ include "lib.namespace" $ }}'
37+
## labels:
38+
## app.kubernetes.io/component: '{{ include "lib.componentName" $ }}'
39+
## spec:
40+
## hard:
41+
## requests.cpu: "4"
42+
## requests.memory: 4Gi
43+
## limits.cpu: "4"
44+
## limits.memory: 4Gi
45+
##
46+
additionalKubernetesYamlResources: []

0 commit comments

Comments
 (0)