Skip to content

Commit

Permalink
setup repository
Browse files Browse the repository at this point in the history
+ add group-challenge repo
  • Loading branch information
tom-schoener committed Apr 7, 2022
1 parent 28fe740 commit 65895e7
Show file tree
Hide file tree
Showing 15 changed files with 477 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/release-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Charts

on:
push:
branches:
- main

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

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Helm Deps
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# helm-charts
public helm charts supported by subshell

Public helm charts supported by subshell.

## Add Repo

The following command allows you to download and install all the charts from this repository:

```sh
helm repo add subshell-public https://subshell.github.io/helm-charts
```

## Development

All charts should be located in the `charts` directory. On every push to the
main branch, a release of the helm chart is triggered automatically if the
`Chart.yaml` file contains a new version.

This git repository uses [Github Pages](https://helm.sh/docs/topics/chart_repository/#github-pages-example) to host the helm repository.
1 change: 1 addition & 0 deletions charts/group-challenge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/*
23 changes: 23 additions & 0 deletions charts/group-challenge/.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/
6 changes: 6 additions & 0 deletions charts/group-challenge/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.1.17
digest: sha256:38055223b7aec2efe1354de3996b66f39ab6e6104add65cc9bcf67ad6055ab13
generated: "2022-04-07T13:15:54.883027+02:00"
11 changes: 11 additions & 0 deletions charts/group-challenge/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: group-challenge
description: Group challenge helm chart
type: application
version: 1.0.0
appVersion: "1.0.0"
dependencies:
- name: postgresql
version: 11.1.17
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
3 changes: 3 additions & 0 deletions charts/group-challenge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Group Challenge

Helm Chart for the [Group Challene App](https://github.com/subshell/group-challenge).
62 changes: 62 additions & 0 deletions charts/group-challenge/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "group-challenge.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 "group-challenge.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 "group-challenge.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "group-challenge.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "group-challenge.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/group-challenge/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "group-challenge.fullname" . }}
labels:
{{- include "group-challenge.labels" . | nindent 4 }}
data:
config.yaml: |- {{ toYaml (required "A valid config.yaml config is required (nested in the value .Values.groupChallenge.config)!" .Values.groupChallenge.config) | nindent 4 }}
114 changes: 114 additions & 0 deletions charts/group-challenge/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "group-challenge.fullname" . }}
labels:
{{- include "group-challenge.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "group-challenge.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "group-challenge.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "group-challenge.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
restartPolicy: Always
containers:
{{ if .Values.imgProxy.enabled -}}
- name: img-proxy
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.imgProxy.image.repository }}:{{ .Values.imgProxy.image.tag }}"
imagePullPolicy: {{ .Values.imgProxy.image.pullPolicy }}
volumeMounts:
- name: group-challenge-cache
mountPath: "/tmp/group-challenge-cache"
env:
- name: IMGPROXY_LOCAL_FILESYSTEM_ROOT
value: "/tmp/group-challenge-cache"
- name: IMGPROXY_BIND
value: ":8081"
- name: IMGPROXY_PROMETHEUS_BIND
value: ":8082"
- name: IMGPROXY_MAX_SRC_RESOLUTION
value: "25"
{{ if .Values.imgProxy.env -}}
{{- toYaml .Values.imgProxy.env | nindent 12 }}
{{- end }}
ports:
- name: http-ip
containerPort: 8081
protocol: TCP
- name: http-ipp
containerPort: 8082
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http-ip
readinessProbe:
httpGet:
path: /
port: http-ip
resources:
{{- toYaml .Values.imgProxy.resources | nindent 12 }}
{{- end }}
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: "/app/config"
- name: group-challenge-cache
mountPath: "/tmp/group-challenge-cache"
env:
{{ if .Values.groupChallenge.env -}}
{{- toYaml .Values.groupChallenge.env | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config
configMap:
name: {{ include "group-challenge.fullname" . }}
- name: group-challenge-cache
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
41 changes: 41 additions & 0 deletions charts/group-challenge/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "group-challenge.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "group-challenge.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions charts/group-challenge/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "group-challenge.fullname" . }}
labels:
{{- include "group-challenge.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
{{ if .Values.imgProxy.enabled -}}
- port: 8082
targetPort: http-ipp
protocol: TCP
name: http-ipp
{{- end }}
selector:
{{- include "group-challenge.selectorLabels" . | nindent 4 }}
12 changes: 12 additions & 0 deletions charts/group-challenge/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "group-challenge.serviceAccountName" . }}
labels:
{{- include "group-challenge.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions charts/group-challenge/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.serviceMonitor.enabled -}}
{{- $fullName := include "group-challenge.fullname" . -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ $fullName }}
labels: {{- include "group-challenge.labels" . | nindent 8 }}
spec:
selector:
matchLabels: {{- include "group-challenge.selectorLabels" . | nindent 12 }}
endpoints:
- interval: {{ .Values.serviceMonitor.interval }}
port: http
path: {{ .Values.serviceMonitor.path }}
- interval: {{ .Values.serviceMonitor.interval }}
port: http-ipp
path: /
{{- end }}
Loading

0 comments on commit 65895e7

Please sign in to comment.