initial commit
This commit is contained in:
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
max_line_length = 1024
|
||||||
|
tab_width = 2
|
||||||
11
.gitea/workflows/release.yaml
Normal file
11
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
name: Publish Helm Chart
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
call-helm-ci:
|
||||||
|
uses: helm/common-workflows/.gitea/workflows/release.yaml@master
|
||||||
|
secrets:
|
||||||
|
CI_BOT_USERNAME: ${{ secrets.CI_BOT_USERNAME }}
|
||||||
|
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.idea/
|
||||||
28
README.md
Normal file
28
README.md
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Lulz Ltd Common Library Chart
|
||||||
|
|
||||||
|
A [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm) for grouping common logic between charts.
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
This chart provides a common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager.
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
The following table lists the helpers available in the library which are scoped in different sections.
|
||||||
|
|
||||||
|
### Labels
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------|-----------------------------------------------------------------------------|-------------------|
|
||||||
|
| `common.labels.matchLabels` | Labels to use on `deploy.spec.selector.matchLabels` and `svc.spec.selector` | `.` Chart context |
|
||||||
|
| `common.labels.standard` | Return Kubernetes standard labels | `.` Chart context |
|
||||||
|
|
||||||
|
### Names
|
||||||
|
|
||||||
|
| Helper identifier | Description | Expected Input |
|
||||||
|
|-----------------------------------|-----------------------------------------------------------------------|-------------------|
|
||||||
|
| `common.names.chart` | Chart name plus version | `.` Chart context |
|
||||||
|
| `common.names.fullname` | Create a default fully qualified app name. | `.` Chart context |
|
||||||
|
| `common.names.fullname.namespace` | Create a fully qualified app name adding the installation's namespace | `.` Chart context |
|
||||||
|
| `common.names.name` | Expand the name of the chart or use `.Values.nameOverride` | `.` Chart context |
|
||||||
|
| `common.names.namespace` | Allow the release namespace to be overridden | `.` Chart context |
|
||||||
26
helm/.helmignore
Normal file
26
helm/.helmignore
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
||||||
|
# img folder
|
||||||
|
img/
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
12
helm/Chart.yaml
Normal file
12
helm/Chart.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Always have the same value for appVersion and version.
|
||||||
|
apiVersion: v2
|
||||||
|
appVersion: 0.1.0
|
||||||
|
description: A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself.
|
||||||
|
keywords:
|
||||||
|
- common
|
||||||
|
- helper
|
||||||
|
- template
|
||||||
|
- function
|
||||||
|
name: common
|
||||||
|
type: library
|
||||||
|
version: 0.1.0
|
||||||
15
helm/templates/_labels.tpl
Normal file
15
helm/templates/_labels.tpl
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
{{- define "common.labels.standard" }}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- with .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "common.labels.matchLabels" }}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
31
helm/templates/_names.tpl
Normal file
31
helm/templates/_names.tpl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{{/* We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}}
|
||||||
|
|
||||||
|
{{- define "common.names.chart" }}
|
||||||
|
{{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "common.names.name" }}
|
||||||
|
{{ default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "common.names.namespace" }}
|
||||||
|
{{ default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "common.names.fullname" }}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{ .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{ $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- $releaseName := regexReplaceAll "(-?[^a-z\\d\\-])+-?" (lower .Release.Name) "-" }}
|
||||||
|
{{- if contains $name $releaseName }}
|
||||||
|
{{ $releaseName | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{ printf "%s-%s" $releaseName $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{- define "common.names.fullname.namespace" }}
|
||||||
|
{{ printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
Reference in New Issue
Block a user