Skip to content

Commit

Permalink
feat: initial draft of helm chart #64
Browse files Browse the repository at this point in the history
  • Loading branch information
98jan authored and d135-1r43 committed Nov 21, 2024
1 parent 94a2478 commit 3d1c757
Show file tree
Hide file tree
Showing 22 changed files with 1,467 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Charts

on:
push:
paths:
- 'charts/hopps/**'
branches:
- main
workflow_dispatch: # allow manual trigger

# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: read
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install Python dependencies
run: pip install pyyaml yq

- name: Get latest release version
id: get_latest_release
run: |
VERSION=$(yq '.version' charts/hopps/Chart.yaml)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version: $VERSION"
- name: Chart | push
uses: appany/[email protected]
with:
name: hopps
repository: ${{ github.repository }}
path: charts/hopps
tag: ${{ env.VERSION }}
registry: ghcr.io
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions charts/hopps/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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/
21 changes: 21 additions & 0 deletions charts/hopps/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dependencies:
- name: keycloak
repository: https://charts.bitnami.com/bitnami
version: 24.1.0
- name: openfga
repository: https://openfga.github.io/helm-charts
version: 0.2.16
- name: kafka-ui
repository: https://provectus.github.io/kafka-ui-charts
version: 0.7.6
- name: kafka
repository: https://charts.bitnami.com/bitnami
version: 31.0.0
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 16.2.1
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 16.2.1
digest: sha256:805d67991326d972a826255b81c0d74ef488843631cbddeb463d89e77a03accb
generated: "2024-11-17T16:45:08.263515+01:00"
56 changes: 56 additions & 0 deletions charts/hopps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: v2
name: hopps
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.1"

dependencies:
- condition: keycloak.enabled
name: keycloak
# ToDo: make version controllable by dependabot
version: 24.1.0
repository: https://charts.bitnami.com/bitnami
- condition: openfga.enabled
name: openfga
# ToDo: make version controllable by dependabot
version: 0.2.16
repository: https://openfga.github.io/helm-charts
- condition: kafka-ui.enabled
name: kafka-ui
# ToDo: make version controllable by dependabot
version: 0.7.6
repository: https://provectus.github.io/kafka-ui-charts
- condition: kafka.enabled
name: kafka
version: 31.0.0
repository: https://charts.bitnami.com/bitnami
- condition: postgresql-fin.enabled
alias: postgresql-fin
name: postgresql
version: 16.2.1
repository: https://charts.bitnami.com/bitnami
- condition: postgresql-org.enabled
alias: postgresql-org
name: postgresql
version: 16.2.1
repository: https://charts.bitnami.com/bitnami

199 changes: 199 additions & 0 deletions charts/hopps/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "hopps.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 "hopps.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 "hopps.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "hopps.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hopps.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}


{{/*
Common labels
*/}}
{{- define "hopps.commonLabels" -}}
helm.sh/chart: {{ include "hopps.chart" . }}
app.kubernetes.io/part-of: {{ include "hopps.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Common selector labels
*/}}
{{- define "hopps.commonSelectorLabels" -}}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}


{{/*
azDocumentAi labels
*/}}
{{- define "hopps.azDocumentAiLabels" -}}
{{ include "hopps.commonLabels" . }}
{{ include "hopps.azDocumentAiSelectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
{{- end -}}
{{/*
azDocumentAi selector labels
*/}}
{{- define "hopps.azDocumentAiSelectorLabels" -}}
{{ include "hopps.commonSelectorLabels" . }}
app.kubernetes.io/name: {{ printf "%s-az-document-ai" (include "hopps.name" .) }}
app.kubernetes.io/component: az-document-ai
{{- end -}}
{{/*
azDocumentAi name
*/}}
{{- define "hopps.azDocumentAiName" -}}
{{- printf "%s-az-document-ai" (include "hopps.name" .) -}}
{{- end -}}
{{/*
azDocumentAi fully qualified name
*/}}
{{- define "hopps.azDocumentAiFullname" -}}
{{- printf "%s-az-document-ai" (include "hopps.fullname" .) -}}
{{- end -}}


{{/*
org labels
*/}}
{{- define "hopps.orgLabels" -}}
{{ include "hopps.commonLabels" . }}
{{ include "hopps.orgSelectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
{{- end -}}
{{/*
org selector labels
*/}}
{{- define "hopps.orgSelectorLabels" -}}
{{ include "hopps.commonSelectorLabels" . }}
app.kubernetes.io/name: {{ printf "%s-org" (include "hopps.name" .) }}
app.kubernetes.io/component: org
{{- end -}}
{{/*
org name
*/}}
{{- define "hopps.orgName" -}}
{{- printf "%s-org" (include "hopps.name" .) -}}
{{- end -}}
{{/*
org fully qualified name
*/}}
{{- define "hopps.orgFullname" -}}
{{- printf "%s-org" (include "hopps.fullname" .) -}}
{{- end -}}


{{/*
fin labels
*/}}
{{- define "hopps.finLabels" -}}
{{ include "hopps.commonLabels" . }}
{{ include "hopps.finSelectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
{{- end -}}
{{/*
fin selector labels
*/}}
{{- define "hopps.finSelectorLabels" -}}
{{ include "hopps.commonSelectorLabels" . }}
app.kubernetes.io/name: {{ printf "%s-fin" (include "hopps.name" .) }}
app.kubernetes.io/component: fin
{{- end -}}
{{/*
fin name
*/}}
{{- define "hopps.finName" -}}
{{- printf "%s-fin" (include "hopps.name" .) -}}
{{- end -}}
{{/*
fin fully qualified name
*/}}
{{- define "hopps.finFullname" -}}
{{- printf "%s-fin" (include "hopps.fullname" .) -}}
{{- end -}}


{{/*
frontend labels
*/}}
{{- define "hopps.frontendLabels" -}}
{{ include "hopps.commonLabels" . }}
{{ include "hopps.frontendSelectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
{{- end -}}
{{/*
frontend selector labels
*/}}
{{- define "hopps.frontendSelectorLabels" -}}
{{ include "hopps.commonSelectorLabels" . }}
app.kubernetes.io/name: {{ printf "%s-frontend" (include "hopps.name" .) }}
app.kubernetes.io/component: frontend
{{- end -}}
{{/*
frontend name
*/}}
{{- define "hopps.frontendName" -}}
{{- printf "%s-frontend" (include "hopps.name" .) -}}
{{- end -}}
{{/*
frontend fully qualified name
*/}}
{{- define "hopps.frontendFullname" -}}
{{- printf "%s-frontend" (include "hopps.fullname" .) -}}
{{- end -}}
Loading

0 comments on commit 3d1c757

Please sign in to comment.