-
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.
Merge pull request #30 from giubacc/helm-charts
add Helm chart
- Loading branch information
Showing
14 changed files
with
263 additions
and
2 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,13 @@ | ||
{ | ||
"MD033": { | ||
"allowed_elements": [ | ||
"details", | ||
"summary", | ||
"img", | ||
"h1" | ||
] | ||
}, | ||
"MD024": { | ||
"siblings_only": true | ||
} | ||
} |
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
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,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog][1], | ||
and this project adheres to [Semantic Versioning][2]. | ||
|
||
## [0.2.0] - UNRELEASED | ||
|
||
## [0.1.0] - 2023-02-03 | ||
|
||
- Initial version. | ||
|
||
[1]: https://keepachangelog.com/en/1.0.0/ | ||
[2]: https://semver.org/spec/v2.0.0.html |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,20 @@ | ||
--- | ||
apiVersion: v2 | ||
name: chatterbox | ||
version: 0.2.0 | ||
kubeVersion: ">=1.14" | ||
description: | | ||
A tool for composing generic RESTful conversations. | ||
type: application | ||
keywords: | ||
- RESTful | ||
home: https://github.com/giubacc/chatterbox | ||
icon: |- | ||
https://raw.githubusercontent.com/giubacc/chatterbox/assets/images/cbox-logo.png | ||
sources: | ||
- https://github.com/giubacc/chatterbox | ||
maintainers: | ||
- name: Giuseppe Baccini | ||
email: giuseppe.baccini@suse.com | ||
appVersion: "latest" | ||
deprecated: false |
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,5 @@ | ||
Thank you for installing {{ .Chart.Name }} {{ printf "v%s" .Chart.Version }} | ||
|
||
The chatterbox endpoint is available at: | ||
|
||
{{ printf "%s.%s" (include "chatterbox.serviceName" .) .Values.backend.publicDomain | indent 4 }} |
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,76 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "chatterbox.name" -}} | ||
{{- .Chart.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "chatterbox.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "chatterbox.labels" -}} | ||
helm.sh/chart: {{ include "chatterbox.chart" . }} | ||
{{ include "chatterbox.commonSelectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{- define "chatterbox.commonSelectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "chatterbox.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{- define "chatterbox.selectorLabels" -}} | ||
{{ include "chatterbox.commonSelectorLabels" . }} | ||
app.kubernetes.io/component: application | ||
{{- end }} | ||
|
||
{{- define "chatterbox-ui.selectorLabels" -}} | ||
{{ include "chatterbox.commonSelectorLabels" . }} | ||
app.kubernetes.io/component: ui | ||
{{- end }} | ||
|
||
{{/* | ||
Version helpers for the image tag | ||
*/}} | ||
{{- define "chatterbox.image" -}} | ||
{{- $defaulttag := printf "v%s" .Chart.Version }} | ||
{{- $tag := default $defaulttag .Values.backend.imageTag }} | ||
{{- $name := default "giubacc/chatterbox" .Values.backend.imageName }} | ||
{{- $registry := default "ghcr.io" .Values.backend.imageRegistry }} | ||
{{- printf "%s/%s:%s" $registry $name $tag }} | ||
{{- end }} | ||
|
||
{{- define "chatterbox-ui.image" -}} | ||
{{- $tag := default (printf "v%s" .Chart.Version) .Values.ui.imageTag }} | ||
{{- $name := default "giubacc/chatterbox-ui" .Values.ui.imageName }} | ||
{{- $registry := default "ghcr.io" .Values.ui.imageRegistry }} | ||
{{- printf "%s/%s:%s" $registry $name $tag }} | ||
{{- end }} | ||
|
||
{{/* | ||
Traefik Middleware CORS name | ||
*/}} | ||
{{- define "chatterbox.CORSMiddlewareName" -}} | ||
{{- $dmcn := printf "%s-%s-cors-header" .Release.Name .Release.Namespace }} | ||
{{- $name := $dmcn }} | ||
{{- $name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Backend service name | ||
*/}} | ||
{{- define "chatterbox.serviceName" -}} | ||
{{- $dsn := printf "%s-%s" .Release.Name .Release.Namespace }} | ||
{{- $name := default $dsn .Values.backend.serviceName }} | ||
{{- $name }} | ||
{{- end }} |
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 @@ | ||
{{- if and (.Values.backend.ingress.enabled) (empty .Values.backend.publicDomain) }} | ||
{{- fail "Please provide a value for `.Values.backend.publicDomain`." }} | ||
{{- end }} |
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 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "chatterbox.labels" . | indent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{ include "chatterbox.selectorLabels" . | indent 6 }} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
{{ include "chatterbox.selectorLabels" . | indent 8 }} | ||
spec: | ||
containers: | ||
- name: {{ .Release.Name }} | ||
image: {{ include "chatterbox.image" . | quote }} | ||
imagePullPolicy: {{ default "IfNotPresent" .Values.backend.imagePullPolicy }} | ||
args: | ||
- "-d" | ||
- "--endpoint-port" | ||
- "8080" | ||
- "-v" | ||
- "t" | ||
{{- range $.Values.backend.customArgs }} | ||
- {{ . | quote}} | ||
{{- end }} | ||
env: | ||
{{- range $.Values.backend.customEnvs }} | ||
{{- if (regexMatch "[^=]+=[^=]+" .) }} | ||
{{- $tokens := split "=" . }} | ||
- name: {{ $tokens._0 }} | ||
value: {{ $tokens._1 | quote}} | ||
{{- else if (regexMatch "^[^=]" .) }} | ||
- name: {{ . }} | ||
{{- else }} | ||
{{- fail (print ".Values.backend.customEnvs contains an invalid entry: " .) }} | ||
{{- end }} | ||
{{- end }} | ||
ports: | ||
- containerPort: 8080 | ||
name: cbox-plain |
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,50 @@ | ||
{{- if .Values.backend.ingress.enabled }} | ||
--- | ||
# Backend Ingress | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: '{{ .Release.Name }}-no-tls' | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "chatterbox.labels" . | indent 4 }} | ||
annotations: | ||
traefik.ingress.kubernetes.io/router.middlewares: | ||
'{{ .Release.Namespace }}-{{ include "chatterbox.CORSMiddlewareName" . }}@kubernetescrd' | ||
spec: | ||
rules: | ||
- host: '{{ include "chatterbox.serviceName" . }}.{{ .Values.backend.publicDomain }}' | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: '{{ include "chatterbox.serviceName" . }}' | ||
port: | ||
number: 80 | ||
--- | ||
# Middleware for Traefik | ||
apiVersion: traefik.containo.us/v1alpha1 | ||
kind: Middleware | ||
metadata: | ||
name: {{ include "chatterbox.CORSMiddlewareName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "chatterbox.labels" . | indent 4 }} | ||
spec: | ||
headers: | ||
accessControlAllowMethods: | ||
- "DELETE" | ||
- "GET" | ||
- "HEAD" | ||
- "POST" | ||
- "PUT" | ||
- "OPTIONS" | ||
accessControlAllowOriginList: | ||
- "*" | ||
accessControlAllowHeaders: | ||
- "*" | ||
accessControlExposeHeaders: | ||
- "*" | ||
{{- end }} |
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: v1 | ||
kind: Service | ||
metadata: | ||
name: '{{ include "chatterbox.serviceName" . }}' | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{ include "chatterbox.labels" . | indent 4 }} | ||
spec: | ||
selector: | ||
{{ include "chatterbox.selectorLabels" . | indent 4 }} | ||
ports: | ||
- name: cbox-plain | ||
protocol: TCP | ||
port: 80 | ||
targetPort: cbox-plain |
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,11 @@ | ||
backend: | ||
ingress: | ||
enabled: true | ||
serviceName: "" | ||
publicDomain: "" | ||
customArgs: [] | ||
customEnvs: [] | ||
imageName: | ||
imageTag: | ||
imageRegistry: | ||
imagePullPolicy: |
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