-
-
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.
- Loading branch information
1 parent
0bbc88b
commit 1cc09b0
Showing
11 changed files
with
240 additions
and
0 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
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,22 @@ | ||
# 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/ |
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,10 @@ | ||
apiVersion: v2 | ||
name: commons | ||
description: commons library | ||
home: https://github.com/wyrihaximusnet/helm-charts | ||
icon: https://helm.wyrihaximus.net/images/charts/commons.png | ||
type: library | ||
version: 0.1.0 | ||
maintainers: | ||
- name: WyriHaximus | ||
email: [email protected] |
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 @@ | ||
# Commons | ||
|
||
<p align="center"> | ||
<img src="https://helm.wyrihaximus.net/images/charts/commons.png"> | ||
</p> | ||
|
||
Opinionated helm library chart containing metadata helpers for helm application charts. | ||
|
||
Example deployment using helpers from this chart: | ||
```yaml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "commons.fullname" . }} | ||
labels: | ||
{{- include "commons.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "commons.selectorLabels" . | nindent 6 }} | ||
replicas: 1 | ||
template: | ||
metadata: | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "9696" | ||
labels: | ||
{{- include "commons.labels" . | nindent 8 }} | ||
spec: | ||
containers: | ||
- name: default-backend | ||
image: "ghcr.io/wyrihaximusnet/default-backend:random" | ||
imagePullPolicy: Always | ||
ports: | ||
- name: default-backend | ||
containerPort: 6969 | ||
protocol: TCP | ||
- name: metrics | ||
containerPort: 9696 | ||
protocol: TCP | ||
livenessProbe: | ||
failureThreshold: 6 | ||
httpGet: | ||
path: / | ||
port: metrics | ||
readinessProbe: | ||
failureThreshold: 6 | ||
httpGet: | ||
path: / | ||
port: metrics | ||
startupProbe: | ||
httpGet: | ||
path: / | ||
port: metrics | ||
failureThreshold: 90 | ||
periodSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 75m | ||
memory: 64Mi | ||
requests: | ||
cpu: 75m | ||
memory: 64Mi | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: appRevision | ||
operator: In | ||
values: | ||
- {{ template "commons.nameRevision" . }} | ||
topologyKey: "kubernetes.io/hostname" | ||
|
||
``` |
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,64 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "commons.fullname" . }} | ||
labels: | ||
{{- include "commons.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: controller | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "commons.selectorLabels" . | nindent 6 }} | ||
replicas: 1 | ||
template: | ||
metadata: | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "9696" | ||
labels: | ||
{{- include "commons.labels" . | nindent 8 }} | ||
spec: | ||
containers: | ||
- name: default-backend | ||
image: "ghcr.io/wyrihaximusnet/default-backend:random" | ||
imagePullPolicy: Always | ||
ports: | ||
- name: default-backend | ||
containerPort: 6969 | ||
protocol: TCP | ||
- name: metrics | ||
containerPort: 9696 | ||
protocol: TCP | ||
livenessProbe: | ||
failureThreshold: 6 | ||
httpGet: | ||
path: / | ||
port: metrics | ||
readinessProbe: | ||
failureThreshold: 6 | ||
httpGet: | ||
path: / | ||
port: metrics | ||
startupProbe: | ||
httpGet: | ||
path: / | ||
port: metrics | ||
failureThreshold: 90 | ||
periodSeconds: 1 | ||
resources: | ||
limits: | ||
cpu: 75m | ||
memory: 64Mi | ||
requests: | ||
cpu: 75m | ||
memory: 64Mi | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: appRevision | ||
operator: In | ||
values: | ||
- {{ template "commons.nameRevision" . }} | ||
topologyKey: "kubernetes.io/hostname" |
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,7 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "commons.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- 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,15 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "commons.labels" -}} | ||
app: {{ template "commons.name" . }} | ||
app.kubernetes.io/instance: {{ template "commons.instance" . }} | ||
app.kubernetes.io/name: {{ template "commons.name" . }} | ||
app.kubernetes.io/version: {{ .Chart.Version | quote }} | ||
appRevision: {{ template "commons.nameRevision" . }} | ||
chart: {{ template "commons.chart" . }} | ||
release: {{ .Release.Name }} | ||
releaseRevision: {{ .Release.Revision | quote }} | ||
heritage: {{ .Release.Service }} | ||
{{- 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,34 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "commons.name" -}} | ||
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Append the deployed version | ||
*/}} | ||
{{- define "commons.instance" -}} | ||
{{ template "commons.name" . }}-{{ .Chart.Version }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Append the deployed revision | ||
*/}} | ||
{{- define "commons.nameRevision" -}} | ||
{{ template "commons.name" . }}___{{ .Release.Revision }} | ||
{{- 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 "commons.fullname" -}} | ||
{{- if contains .Chart.Name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- 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,8 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "commons.selectorLabels" -}} | ||
app: {{ template "commons.name" . }} | ||
release: {{ .Release.Name }} | ||
{{- end -}} |
Empty file.