Skip to content

Commit

Permalink
Added base helm chart for k8s
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Dubey <[email protected]>
  • Loading branch information
iamabhishek-dubey committed Jan 13, 2025
1 parent 57fbc49 commit 472f061
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 0 deletions.
21 changes: 21 additions & 0 deletions charts/base/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: v1
description: A base helm chart which will be used by different helm charts
engine: gotpl
maintainers:
- name: iamabhishek-dubey
email: "[email protected]"
url: https://github.com/iamabhishek-dubey
name: base
sources:
- https://github.com/ot-container-kit/helm-charts
version: 0.1.0
appVersion: "0.1.0"
home: https://github.com/ot-container-kit/helm-charts
keywords:
- deployment
- base
- opstree
- kubernetes
- openshift
icon: https://raw.githubusercontent.com/OT-CONTAINER-KIT/helm-charts/main/static/helm-chart-logo.svg
28 changes: 28 additions & 0 deletions charts/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# base

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

A base helm chart which will be used by different helm charts.

**Homepage:** <https://github.com/ot-container-kit/helm-charts>

## Maintainers

| Name | Email | Url |
|-------------------|----------------------------|----------------------------------------|
| iamabhishek-dubey | [email protected] | <https://github.com/iamabhishek-dubey> |

## Source Code

* <https://github.com/ot-container-kit/helm-charts>

## Values

| Key | Type | Default | Description |
|----------------------------|--------|---------|--------------------------------------------------------------------------------|
| config | object | `{}` | ConfigMap key value pair to create configs |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
13 changes: 13 additions & 0 deletions charts/base/templates/_configmap.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- define "configmap" -}}
{{- if .Values.base.config -}}
{{- $top := . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "base.fullname" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
data:
{{- toYaml .Values.base.config | nindent 2 -}}
{{- end -}}
{{- end -}}
42 changes: 42 additions & 0 deletions charts/base/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{/*
Create a default fully qualified app name.
We truncate service name aka .Release.Name at 59 chars because some Kubernetes name fields are limited to 63 (by the DNS naming spec).
We append 4 characters for chart type at the end which is -web or -crn or -wrk or -job or -sts.
*/}}
{{- define "base.fullname" -}}
{{- $name := .Release.Name | trunc 59 | trimSuffix "-" }}
{{- printf "%s-%s" $name .Chart.Name }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "base.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "base.labels" -}}
helm.sh/chart: {{ include "base.chart" . }}
{{ include "base.selectorLabels" . }}
{{- if .Release.Revision }}
app.kubernetes.io/version: {{ .Release.Revision | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "base.selectorLabels" -}}
app.kubernetes.io/name: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "base.serviceAccountName" -}}
{{- default (include "base.fullname" .) .Values.base.serviceAccount.name }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/base/templates/_serviceaccount.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "serviceAccount" -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "base.serviceAccountName" . }}
labels:
{{- include "base.labels" . | nindent 4 }}
{{- with .Values.base.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/base/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Default values for base template.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

serviceAccount:
# -- Annotations to add to the service account
annotations: {}
# -- The name of the service account to use.
# -- If not set and create is true, a name is generated using the fullname template
name: ""

# -- ConfigMap key value pair to create configs
config: {}

0 comments on commit 472f061

Please sign in to comment.