From 15f943c976d278827f91a7bb22b3d95595cd916b Mon Sep 17 00:00:00 2001 From: 0zhu Date: Thu, 7 Nov 2024 22:09:44 +0200 Subject: [PATCH] feat: initial version --- .helmignore | 31 +++++ Chart.yaml | 4 + LICENSE | 177 +++++++++++++++++++++++++++ README.md | 78 ++++++++++++ index.yaml | 7 ++ templates/NOTES.txt | 1 + templates/_helpers.tpl | 62 ++++++++++ templates/_manifests.tpl | 59 +++++++++ templates/manifests.yaml | 1 + templates/manifests/_DaemonSet.tpl | 3 + templates/manifests/_Deployment.tpl | 25 ++++ templates/manifests/_Ingress.tpl | 43 +++++++ templates/manifests/_Service.tpl | 14 +++ templates/manifests/_StatefulSet.tpl | 3 + values.yaml | 128 +++++++++++++++++++ 15 files changed, 636 insertions(+) create mode 100644 .helmignore create mode 100644 Chart.yaml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.yaml create mode 100644 templates/NOTES.txt create mode 100644 templates/_helpers.tpl create mode 100644 templates/_manifests.tpl create mode 100644 templates/manifests.yaml create mode 100644 templates/manifests/_DaemonSet.tpl create mode 100644 templates/manifests/_Deployment.tpl create mode 100644 templates/manifests/_Ingress.tpl create mode 100644 templates/manifests/_Service.tpl create mode 100644 templates/manifests/_StatefulSet.tpl create mode 100644 values.yaml diff --git a/.helmignore b/.helmignore new file mode 100644 index 0000000..29a214e --- /dev/null +++ b/.helmignore @@ -0,0 +1,31 @@ +# 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/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + +# Chart repo +docs/ +_config.yaml +.helmignore +index.yaml +LICENSE* +README* diff --git a/Chart.yaml b/Chart.yaml new file mode 100644 index 0000000..166ac72 --- /dev/null +++ b/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: chary +version: 0.1.0 +home: https://github.com/0zhu/chary diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f433b1a --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md new file mode 100644 index 0000000..82def60 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +# Chary: A Generic Helm Chart +Chary is a flexible Helm chart that lets you create customized charts and templates directly from `values.yaml` or raw manifest files. +## Features +- Reuse one chart across multiple apps +- Modify resources and templates directly from `values.yaml` +- Customize resources using standard manifest structure +## Usage +### As remote chart +- Add repo + ```sh + helm repo add chary https://0zhu.github.io/chary + ``` +- Create `values.yaml` file with your manifests, [more examples here](values.yaml) + ``` + manifests: + - kind: Deployment + ``` +- Check what's rendered + ```sh + helm --debug template myapp chary/chary -f values.yaml + ``` +- Deploy + ```sh + helm install myapp chary/chary -f values.yaml + ``` +### As dependency subchart +- Set up your chart with `Chart.yaml` + ``` + apiVersion: v2 + name: myapp + version: 0.1.0 + appVersion: "1.16.0" + dependencies: + - name: chary + version: "*" # or certain version + repository: "https://0zhu.github.io/chary" + ``` +- Customize values in 2 possible ways + 1. Pass manifests to `Chary` subchart in `values.yaml` + ``` + chary: + manifests: + - kind: Deployment + ``` + 2. Use `Chary`'s helper functions + - In `templates/manifests.yaml` + ``` + {{ include "chary.manifests" . }} + ``` + - In `templates/NOTES.txt` (optional) + ``` + {{ include "chary.notes" . }} + ``` + - Then define manifests in `values.yaml` + ``` + manifests: + - kind: Deployment + # parent chart's files and context will become available for templating + - kind: ConfigMap + data: + config: | + {{- .Files.Get "config.txt" | nindent 4 }} + ``` + Optionally, store additional manifests as yaml files in `manifests/` + - `manifests/example.yaml` + ``` + kind: Deployment + ``` +- Check what's rendered + ```sh + helm --debug template myapp . -f values.yaml + ``` +- Deploy + ```sh + helm install myapp . -f values.yaml + ``` +## Contributing +Add predefined manifests to [templates/manifests](templates/manifests) and reference them in [templates/_manifests.tpl](templates/_manifests.tpl) diff --git a/index.yaml b/index.yaml new file mode 100644 index 0000000..c76dcb0 --- /dev/null +++ b/index.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +entries: + chary: + - name: chary + version: "0.1.0" + urls: + - https://github.com/0zhu/chary/archive/0.1.0.tar.gz diff --git a/templates/NOTES.txt b/templates/NOTES.txt new file mode 100644 index 0000000..7aba565 --- /dev/null +++ b/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "chary.notes" . }} \ No newline at end of file diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl new file mode 100644 index 0000000..8fa95be --- /dev/null +++ b/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "chary.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "chary.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "chary.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "chary.labels" -}} +helm.sh/chart: {{ include "chary.chart" . }} +{{ include "chary.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "chary.selectorLabels" -}} +app.kubernetes.io/name: {{ include "chary.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "chary.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "chary.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/templates/_manifests.tpl b/templates/_manifests.tpl new file mode 100644 index 0000000..cd6eb25 --- /dev/null +++ b/templates/_manifests.tpl @@ -0,0 +1,59 @@ +{{- /* Iterate over manifests defined in Values and Files and pass them to templating */}} +{{- define "chary.manifests" -}} + {{- range $index, $manifest := .Values.manifests }} + {{- include "chary.manifest" (set $ "Manifest" .) }} + {{- end }} + {{- range $path, $_ := .Files.Glob "manifests/*.yaml" }} + {{- include "chary.manifest" (set $ "Manifest" ($.Files.Get $path)) }} + {{- end }} +{{- end }} + +{{- /* Apply common and resource-specific templates to passed manifests */ -}} +{{- define "chary.manifest" -}} + {{- $manifests := list }} + {{- if kindIs "string" .Manifest }} + {{- range (regexSplit `(?m)^---\s*$` (tpl .Manifest .) -1) }} + {{- $manifests = append $manifests (fromYaml .) }} + {{- end }} + {{- else }} + {{- $manifests = list (fromYaml (tpl (toYaml .Manifest) (merge (deepCopy $) .Manifest))) }} + {{- end }} + {{- range $manifest := (compact $manifests) }} + {{- $context := merge (deepCopy $) $manifest }} + {{- if has $manifest.kind (list + "DaemonSet" + "Deployment" + "Ingress" + "Service" + "StatefulSet" + ) }} + {{- $manifest = merge (fromYaml (include (print "chary." $manifest.kind) $context)) $manifest }} + {{- $context = merge $context $manifest }} + {{- end }} + {{- $manifest = merge (fromYaml (include "chary.common" $context)) $manifest }} +--- + {{- toYaml $manifest }} + {{- end }} +{{- end }} + +{{- /* Common manifest fields */}} +{{- define "chary.common" -}} +apiVersion: {{ default "v1" .apiVersion }} +metadata: + labels: + {{- include "chary.labels" . | nindent 4 }} + {{- with dig "metadata" "labels" (dict) . }} + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ dig "metadata" "name" (include "chary.fullname" .) . }} + {{- if not (eq .kind "Namespace") }} + namespace: {{ dig "metadata" "namespace" .Release.Namespace . }} + {{- end }} +{{- end }} + +{{- /* Custom notes */}} +{{- define "chary.notes" -}} + {{- if .Values.notes }} + {{ tpl .Values.notes . }} + {{- end }} +{{- end }} diff --git a/templates/manifests.yaml b/templates/manifests.yaml new file mode 100644 index 0000000..5c2f016 --- /dev/null +++ b/templates/manifests.yaml @@ -0,0 +1 @@ +{{ include "chary.manifests" . }} \ No newline at end of file diff --git a/templates/manifests/_DaemonSet.tpl b/templates/manifests/_DaemonSet.tpl new file mode 100644 index 0000000..4a546e2 --- /dev/null +++ b/templates/manifests/_DaemonSet.tpl @@ -0,0 +1,3 @@ +{{- define "chary.DaemonSet" -}} +{{ include "chary.Deployment" . }} +{{- end }} \ No newline at end of file diff --git a/templates/manifests/_Deployment.tpl b/templates/manifests/_Deployment.tpl new file mode 100644 index 0000000..d2dceca --- /dev/null +++ b/templates/manifests/_Deployment.tpl @@ -0,0 +1,25 @@ +{{- define "chary.Deployment" -}} +{{- $image := default (dict) .Values.image -}} +apiVersion: {{ default "apps/v1" .apiVersion }} +spec: + selector: + matchLabels: + {{- include "chary.selectorLabels" . | nindent 6 }} + {{- with dig "spec" "selector" "matchLabels" (dict) . }} + {{- toYaml . | nindent 6 }} + {{- end }} + template: + metadata: + labels: + {{- include "chary.labels" . | nindent 8 }} + {{- with dig "spec" "template" "metadata" "labels" (dict) . }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + containers: + {{- range (dig "spec" "template" "spec" "containers" (list (dict "name" "")) .) }} + - {{- toYaml . | nindent 8 }} + image: {{ dig "repository" "nginx" $image }}:{{ dig "tag" (default "alpine" $.Chart.AppVersion) $image }} + name: {{ default (include "chary.name" $) .name }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/manifests/_Ingress.tpl b/templates/manifests/_Ingress.tpl new file mode 100644 index 0000000..40f5f6f --- /dev/null +++ b/templates/manifests/_Ingress.tpl @@ -0,0 +1,43 @@ +{{- define "chary.Ingress" -}} +{{- $fullName := include "chary.fullname" . -}} +{{- $svcPort := 80 -}} +{{- $className := dig "metadata" "annotations" "kubernetes.io/ingress.class" "" . -}} +{{- if .apiVersion -}} +apiVersion: {{ .apiVersion }} +{{- else if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +spec: + {{- if and $className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ $className }} + {{- end }} + rules: + {{- range (dig "spec" "rules" (list (dict "host" "")) . ) }} + - {{- toYaml . | nindent 4 }} + host: {{ default (printf "%s.local" $fullName) .host | quote }} + http: + paths: + {{- range (dig "http" "paths" (list (dict "path" "")) . ) }} + - {{- toYaml . | nindent 8 }} + path: {{ default "/" .path }} + {{- $pathType := default "ImplementationSpecific" .pathType -}} + {{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ $pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ dig "backend" "service" "name" $fullName . }} + port: + number: {{ dig "backend" "service" "port" "number" $svcPort . }} + {{- else }} + serviceName: {{ dig "backend" "serviceName" $fullName . }} + servicePort: {{ dig "backend" "servicePort" $svcPort . }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/manifests/_Service.tpl b/templates/manifests/_Service.tpl new file mode 100644 index 0000000..0214614 --- /dev/null +++ b/templates/manifests/_Service.tpl @@ -0,0 +1,14 @@ +{{- define "chary.Service" -}} +apiVersion: {{ default "v1" .apiVersion }} +spec: + ports: + {{- range (dig "spec" "ports" (list (dict "port" "")) .) }} + - {{- toYaml . | nindent 4 }} + port: {{ default "80" .port }} + {{- end }} + selector: + {{- include "chary.selectorLabels" . | nindent 4 }} + {{- with dig "spec" "selector" (dict) . }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/manifests/_StatefulSet.tpl b/templates/manifests/_StatefulSet.tpl new file mode 100644 index 0000000..1aad1bb --- /dev/null +++ b/templates/manifests/_StatefulSet.tpl @@ -0,0 +1,3 @@ +{{- define "chary.StatefulSet" -}} +{{ include "chary.Deployment" . }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml new file mode 100644 index 0000000..f426c3e --- /dev/null +++ b/values.yaml @@ -0,0 +1,128 @@ +# # Default values + +# nameOverride: "" # specify custom chart name +# fullnameOverride: "" # or overwrite completely (no release prefix) +# image: +# repository: nginx +# tag: alpine + +# # Declare manifests using list + +# manifests: + +# # Chart can generate basic manifests for some kinds + +# - kind: Deployment # enough to generate basic manifest +# apiVersion: apps/v1 +# metadata: +# labels: {} +# # {{- include "chary.labels" . | nindent 4 }} +# name: '{{ include "chary.fullname" . }}' +# namespace: '{{ .Release.Namespace }}' +# spec: +# selector: +# matchLabels: {} +# # {{- include "chary.selectorLabels" . | nindent 6 }} +# template: +# metadata: +# labels: {} +# # {{- include "chary.labels" . | nindent 8 }} +# spec: +# containers: +# - image: '{{ $.Values.image.repository }}:{{ default $.Values.image.tag $.Chart.AppVersion }}' +# name: '{{ include "chary.name" $ }}' +# # add any other required fields: +# # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#deployment-v1-apps + +# - kind: StatefulSet # enough to generate basic manifest, same as deployment +# # add any other required fields: +# # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#statefulset-v1-apps + +# - kind: Service # enough to generate basic manifest +# apiVersion: v1 +# metadata: +# labels: {} +# # {{- include "chary.labels" . | nindent 4 }} +# name: '{{ include "chary.fullname" . }}' +# namespace: '{{ .Release.Namespace }}' +# spec: +# ports: +# - port: 80 +# selector: {} +# # {{- include "chary.selectorLabels" . | nindent 4 }} +# # add any other required fields: +# # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#service-v1-core + +# - kind: Ingress # enough to generate basic manifest +# apiVersion: networking.k8s.io/v1 +# metadata: +# labels: {} +# # {{- include "chary.labels" . | nindent 4 }} +# name: '{{ include "chary.fullname" . }}' +# namespace: '{{ .Release.Namespace }}' +# spec: +# rules: +# - host: '{{ include "chary.fullname" . }}.local' +# http: +# paths: +# - backend: +# service: +# name: '{{ include "chary.fullname" . }}' +# port: +# number: 80 +# path: / +# pathType: ImplementationSpecific +# # add any other required fields: +# # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#service-v1-core + +# # For other kinds you can still declare custom manifests +# # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/ +# # they will have default fields: +# # apiVersion, .metadata.labels, .metadata.name, .metadata.namespace, +# # so you will need to define only your custom specs or overwrite defaults: + +# - kind: Namespace +# metadata: +# name: myns + +# - apiVersion: monitoring.coreos.com/v1 +# kind: ServiceMonitor +# spec: +# selector: +# matchLabels: +# app.kubernetes.io/name: '{{ include "chary.name" . }}' +# app.kubernetes.io/instance: '{{ .Release.Name }}' +# endpoints: +# - port: 80 + + +# # Declare manifests using dict if it'd be more convenient for templating, +# # e.g. reference .Values.manifests.svc.kind in dict vs. .Values.manifests[0].kind in list + +# manifests: +# deploy: +# kind: Deployment +# # ... +# svc: +# kind: Service +# # ... + +# # Declare manifests using strings should you need an advanced templating not available in yaml +# manifests: +# - | +# kind: Deployment +# metadata: +# labels: +# {{- include "chary.labels" . | nindent 4 }} +# manifests: +# deploy: | +# kind: Deployment +# metadata: +# labels: +# {{- include "chary.labels" . | nindent 4 }} + +# # .yaml templates placed into manifests/ folder will also be processed as if they are manifests: strings + +# # Customize NOTES.txt +# notes: | +# Thank you for installing {{ .Release.Name }}