-
Notifications
You must be signed in to change notification settings - Fork 53
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 #27 from gimlet-io/schedule-support
Using common chart
- Loading branch information
Showing
39 changed files
with
261 additions
and
147 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,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/ |
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,18 @@ | ||
apiVersion: v2 | ||
name: common | ||
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: library | ||
|
||
# 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.1.0 |
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 @@ | ||
{{- define "common.configmap.tpl" -}} | ||
{{- if .Values.vars }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "common.robustName" .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "helm-chart.labels" . | nindent 4 }} | ||
data: | ||
{{- range $key, $val := .Values.vars }} | ||
{{ $key }}: {{ $val | quote }} | ||
{{- end }} | ||
{{- 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,21 @@ | ||
{{- define "common.envFromRef.tpl" -}} | ||
{{- if or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName }} | ||
envFrom: &envFrom | ||
{{- if .Values.vars }} | ||
- configMapRef: | ||
name: {{ template "common.robustName" .Release.Name }} | ||
{{- end }} | ||
{{- if .Values.secretEnabled }} | ||
- secretRef: | ||
name: {{ include "common.robustName" $.Release.Name }} | ||
{{- end }} | ||
{{- if .Values.secretName }} | ||
- secretRef: | ||
name: {{ .Values.secretName }} | ||
{{- end }} | ||
{{- if .Values.sealedSecrets }} | ||
- secretRef: | ||
name: {{ template "common.robustName" .Release.Name }} | ||
{{- end }} | ||
{{- 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
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 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
|
||
{{/* | ||
Create robustName that can be used as Kubernetes resource name, and as subdomain as well | ||
\w – Latin letters, digits, underscore '_' . | ||
\W – all but \w . | ||
*/}} | ||
{{- define "common.robustName" -}} | ||
{{ regexReplaceAll "[^0-9A-Za-z_\\.]+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" | trimPrefix "-" }} | ||
{{- 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,18 @@ | ||
{{- define "common.pvc.tpl" -}} | ||
{{- range .Values.volumes }} | ||
{{- $robustName := include "common.robustName" $.Release.Name }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ printf "%s-%s" $robustName .name }} | ||
namespace: {{ $.Release.Namespace }} | ||
spec: | ||
accessModes: | ||
- {{ .accessMode | default "ReadWriteOnce" }} | ||
storageClassName: {{ .storageClass | default "local-path" }} | ||
resources: | ||
requests: | ||
storage: {{ .size | default "1Gi" }} | ||
{{- 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
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,19 @@ | ||
{{- define "common.volumeMountsRef.tpl" -}} | ||
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} | ||
volumeMounts: &volumeMounts | ||
{{- range .Values.volumes }} | ||
- name: {{ .name }} | ||
mountPath: {{ .path }} | ||
{{- end }} | ||
{{- range .Values.sealedFileSecrets }} | ||
- name: {{ .name }} | ||
mountPath: {{ .path }} | ||
readOnly: true | ||
{{- end }} | ||
{{- range .Values.fileSecrets }} | ||
- name: {{ .name }} | ||
mountPath: {{ .path }} | ||
readOnly: true | ||
{{- end }} | ||
{{- 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,20 @@ | ||
{{- define "common.volumesRef.tpl" -}} | ||
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} | ||
volumes: | ||
{{- range .Values.volumes }} | ||
- name: {{ .name }} | ||
persistentVolumeClaim: | ||
claimName: {{ printf "%s-%s" $.Release.Name .name }} | ||
{{- end }} | ||
{{- range .Values.sealedFileSecrets }} | ||
- name: {{ .name }} | ||
secret: | ||
secretName: {{ printf "%s-%s" $.Release.Name .name }} | ||
{{- end }} | ||
{{- range .Values.fileSecrets }} | ||
- name: {{ .name }} | ||
secret: | ||
secretName: {{ printf "%s-%s" $.Release.Name .name }} | ||
{{- end }} | ||
{{- 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,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://../common | ||
version: 0.1.0 | ||
digest: sha256:636a65e9846bdff17cc4e65b0849061f783759a37aa51fb85ff6fd8ba5e68467 | ||
generated: "2021-08-05T10:18:17.533366128+02:00" |
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
Binary file not shown.
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 |
---|---|---|
@@ -1,13 +1 @@ | ||
{{- if .Values.vars }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ .Release.Name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "helm-chart.labels" . | nindent 4 }} | ||
data: | ||
{{- range $key, $val := .Values.vars }} | ||
{{ $key }}: {{ $val | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- include "common.configmap.tpl" . -}} |
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 @@ | ||
{{- include "common.fileSecret.tpl" . -}} |
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 |
---|---|---|
@@ -1,15 +1 @@ | ||
{{- range .Values.volumes }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ printf "%s-%s" $.Release.Name .name }} | ||
namespace: {{ $.Release.Namespace }} | ||
spec: | ||
accessModes: | ||
- {{ .accessMode | default "ReadWriteOnce" }} | ||
storageClassName: {{ .storageClass | default "local-path" }} | ||
resources: | ||
requests: | ||
storage: {{ .size | default "1Gi" }} | ||
{{- end }} | ||
{{- include "common.pvc.tpl" . -}} |
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 @@ | ||
{{- include "common.sealedFileSecret.tpl" . -}} |
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 @@ | ||
{{- include "common.sealedSecret.tpl" . -}} |
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,17 @@ | ||
suite: test cron job | ||
templates: | ||
- cronJob.yaml | ||
tests: | ||
- it: Should have default constraints | ||
asserts: | ||
- equal: | ||
path: spec.successfulJobsHistoryLimit | ||
value: 1 | ||
- it: Should constraints be configurable | ||
set: | ||
constraints: | ||
successfulJobsHistoryLimit: 2 | ||
asserts: | ||
- equal: | ||
path: spec.successfulJobsHistoryLimit | ||
value: 2 |
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,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: file://../common | ||
version: 0.1.0 | ||
digest: sha256:636a65e9846bdff17cc4e65b0849061f783759a37aa51fb85ff6fd8ba5e68467 | ||
generated: "2021-08-05T10:39:10.053810673+02:00" |
Oops, something went wrong.