-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(charts): [kubernetes-manifests] add the first version
- Loading branch information
Showing
10 changed files
with
319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Remove release files | ||
release.json | ||
# Remove ignore files | ||
.gitignore | ||
.helmignore | ||
|
||
# Remove all shell scripts | ||
*.sh | ||
|
||
# Remove all resulting packages | ||
./*.tgz | ||
./. | ||
./.. | ||
.cache | ||
# Just in case if someone forgets to remove their local.properties file | ||
*.properties | ||
|
||
# Internal cluster values | ||
values/ | ||
|
||
# Rendered templates | ||
rendered/ | ||
|
||
# Got it from the Internet | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
.helm-docs | ||
.helm_output | ||
*.md | ||
.env | ||
Makefile | ||
*.lock | ||
examples/ | ||
unittests/ | ||
tests/ | ||
values.schema.json | ||
schema.values.json | ||
# Docs related | ||
#README.md | ||
LICENSE | ||
|
||
ct.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v2 | ||
name: kubernetes-manifests | ||
description: A Generic Helm chart for packaging Kubernetes manifests | ||
type: application | ||
version: 1.0.0 | ||
appVersion: 1.0.0 | ||
icon: https://avatars.githubusercontent.com/u/878437?s=200&v=4 | ||
home: https://jetbrains.com/ | ||
annotations: | ||
category: Infrastructure | ||
keywords: | ||
- jetbrains | ||
- template | ||
maintainers: | ||
- name: JetBrains | ||
url: https://www.jetbrains.com/support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include ../../lib/Makefiles/Helm.mk | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Kubernetes Manifests | ||
|
||
`kubernetes-manifests` is a generic Helm chart to use for the packaging of ad-hoc Kubernetes manifests in one bundle. | ||
|
||
## Use Cases | ||
|
||
Use this chart to package Kubernetes manifests that are not part of a Helm chart during a Helm to deploy in Kubernetes, | ||
and the main application chart does not include a parameter in the values.yaml for passing custom Kubernetes manifests. | ||
|
||
## How to use this chart | ||
|
||
This chart is formatted as an OCI package. Include it as a dependency from `https://public.jetbrains.space/p/helm/packages/container/library`. | ||
|
||
Add it to your Chart.yaml file of your Helm package. | ||
|
||
```yaml | ||
dependencies: | ||
- name: kubernetes-manifests | ||
repository: oci://public.registry.jetbrains.space/p/helm/library | ||
version: 1.x.x | ||
alias: app | ||
``` | ||
## Repository | ||
Checkout the [release.json](release.json) for details about where the chart is hosted. | ||
## Prerequisites | ||
- Kubernetes 1.24+; | ||
- Helm 3+. | ||
## Parameters | ||
### Global parameters | ||
| Name | Description | Value | | ||
| --------- | ----------------------------------------------------------- | ------ | | ||
| `global` | Provide a map of global values to be used in the templates | `{}` | | ||
| `include` | Includes/Excludes the manifests packaged by this Helm chart | `true` | | ||
|
||
### Manifests to package | ||
|
||
| Name | Description | Value | | ||
| ----------------------------------- | ------------------------------------------------------- | ----- | | ||
| `kubernetesYamlResources` | Kubernetes objects to add to the package | `[]` | | ||
| `additionalKubernetesYamlResources` | Add additional Kubernetes objects to add to the package | `[]` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"metadata": { | ||
"name": "kubernetes-manifests", | ||
"description": "Find more details about this chart in its Chart.yaml file." | ||
}, | ||
"spec": { | ||
"repositories": [ | ||
{ | ||
"name": "helm-library", | ||
"description": "Repository for Kubernetes charts", | ||
"url": "public.registry.jetbrains.space/p/helm/library", | ||
"type": "oci", | ||
"env": { | ||
"nameSelector": "HELM_CHARTS_REGISTRY" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
kubernetes-manifests | ||
==================== | ||
Chart Version: {{ .Chart.Version }} | ||
Support contact: it is outlined in the Chart.yaml file |
9 changes: 9 additions & 0 deletions
9
charts/kubernetes-manifests/templates/kubernetesresources/manifest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{- if .Values.include -}} | ||
{{- $kubernetesResources := concat .Values.kubernetesYamlResources .Values.additionalKubernetesYamlResources -}} | ||
{{- if $kubernetesResources -}} | ||
apiVersion: v1 | ||
kind: List | ||
items: | ||
{{- tpl ($kubernetesResources | toYaml) $ | nindent 4 }} | ||
{{- end -}} | ||
{{- end -}} |
85 changes: 85 additions & 0 deletions
85
charts/kubernetes-manifests/tests/kubernetesresources/mainfest_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
suite: app kubernetes resources | ||
templates: | ||
- kubernetesresources/manifest.yaml | ||
tests: | ||
- it: should not be created by default | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should not be generated when include is set to false | ||
set: | ||
include: false | ||
kubernetesYamlResources: | ||
- apiVersion: v1 | ||
kind: Nameapp | ||
metadata: | ||
name: kong | ||
labels: | ||
app: kong | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
- it: should allow to compose a set of custom YAML objects | ||
set: | ||
kubernetesYamlResources: | ||
- apiVersion: v1 | ||
kind: Nameapp | ||
metadata: | ||
name: kong | ||
labels: | ||
app: kong | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
nameapp: kong | ||
name: kong | ||
labels: | ||
app: kong | ||
additionalKubernetesYamlResources: | ||
- apiVersion: autoscaling/v1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: kong-apigateway-weu-dev-ha | ||
nameapp: kong | ||
labels: | ||
app: kong | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: kong-apigateway-weu-dev | ||
minReplicas: 1 | ||
maxReplicas: 7 | ||
targetCPUUtilizationPercentage: 71 | ||
asserts: | ||
- equal: | ||
path: items | ||
value: | ||
- apiVersion: v1 | ||
kind: Nameapp | ||
metadata: | ||
labels: | ||
app: kong | ||
name: kong | ||
- apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: kong | ||
name: kong | ||
nameapp: kong | ||
- apiVersion: autoscaling/v1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
labels: | ||
app: kong | ||
name: kong-apigateway-weu-dev-ha | ||
nameapp: kong | ||
spec: | ||
maxReplicas: 7 | ||
minReplicas: 1 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: kong-apigateway-weu-dev | ||
targetCPUUtilizationPercentage: 71 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"title": "Chart Values", | ||
"type": "object", | ||
"properties": { | ||
"global": { | ||
"type": "object", | ||
"description": "Provide a map of global values to be used in the templates", | ||
"default": {} | ||
}, | ||
"include": { | ||
"type": "boolean", | ||
"description": "Includes/Excludes the manifests packaged by this Helm chart", | ||
"default": true | ||
}, | ||
"kubernetesYamlResources": { | ||
"type": "array", | ||
"description": "Kubernetes objects to add to the package", | ||
"default": [], | ||
"items": {} | ||
}, | ||
"additionalKubernetesYamlResources": { | ||
"type": "array", | ||
"description": "Add additional Kubernetes objects to add to the package", | ||
"default": [], | ||
"items": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## | ||
## This is a YAML-formatted file. | ||
## | ||
|
||
## @section Global parameters | ||
## | ||
## @param global Provide a map of global values to be used in the templates | ||
global: {} | ||
|
||
|
||
## @param include Includes/Excludes the manifests packaged by this Helm chart | ||
## | ||
include: true | ||
## @section Manifests to package | ||
## | ||
## @param kubernetesYamlResources Kubernetes objects to add to the package | ||
## | ||
## Example: | ||
## - apiVersion: v1 | ||
## kind: ServiceAccount | ||
## metadata: | ||
## namespace: '{{ .Release.namespace }}' | ||
## name: '{{ include "lib.appName" . }}'-newsa | ||
## labels: | ||
## app.kubernetes.io/component: '{{ include "lib.componentName" . }}' | ||
## '{{- include "lib.labels" . | nindent 4 }}' | ||
## | ||
kubernetesYamlResources: [] | ||
## @param additionalKubernetesYamlResources Add additional Kubernetes objects to add to the package | ||
## | ||
## Example: | ||
## - apiVersion: v1 | ||
## kind: ResourceQuota | ||
## metadata: | ||
## name: '{{ include "lib.appName" $ }}' | ||
## namespace: '{{ include "lib.namespace" $ }}' | ||
## labels: | ||
## app.kubernetes.io/component: '{{ include "lib.componentName" $ }}' | ||
## spec: | ||
## hard: | ||
## requests.cpu: "4" | ||
## requests.memory: 4Gi | ||
## limits.cpu: "4" | ||
## limits.memory: 4Gi | ||
## | ||
additionalKubernetesYamlResources: [] |