Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Chart WIP #183

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions seal/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strata*
README.strata.md
21 changes: 21 additions & 0 deletions seal/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
5 changes: 5 additions & 0 deletions seal/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
description: A Helm chart for Kubernetes
name: seal
version: 0.1.0
icon: https://github.com/binaryberry/seal/raw/master/images/emoji/Everyday%20images/happy_seal.gif
9 changes: 9 additions & 0 deletions seal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Deploy

helm install --dry-run --name seal-morning -f morning.yaml --debug ../seal
helm install --dry-run --name seal-afternoon -f afternoon.yaml --debug ../seal


helm install --name seal-morning -f morning.yaml ../seal
helm install --name seal-afternoon -f afternoon.yaml ../seal

24 changes: 24 additions & 0 deletions seal/afternoon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
crontab: "0 14 * * *"
image:
repository: quay.io/strataconsulting/seal:helm
imagePullPolicy: Always
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
seal:
seal_organisation: "org"
github_token: "token"
slack_webhook: "webhook"
dyno: "true"
slack_channel: "#channel"
github_members: "user1,user2"
github_use_labels: "true"
github_exclude_labels: "[DO NOT MERGE],Don't merge,DO NOT MERGE,Waiting on factcheck,wip"
seal_quotes: "Everyone should have the opportunity to learn. Don’t be afraid to pick up stories on things you don’t understand and ask for help with them.,Try to pair when possible."
dry_run: true
24 changes: 24 additions & 0 deletions seal/morning.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
crontab: "0 6 * * *"
image:
repository: quay.io/strataconsulting/seal:helm
imagePullPolicy: Always
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
seal:
seal_organisation: "org"
github_token: "token"
slack_webhook: "webhook"
dyno: "true"
slack_channel: "#channel"
github_members: "user1,user2"
github_use_labels: "true"
github_exclude_labels: "[DO NOT MERGE],Don't merge,DO NOT MERGE,Waiting on factcheck,wip"
seal_quotes: "Everyone should have the opportunity to learn. Don’t be afraid to pick up stories on things you don’t understand and ask for help with them.,Try to pair when possible."
dry_run: true
Empty file added seal/templates/NOTES.txt
Empty file.
16 changes: 16 additions & 0 deletions seal/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "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).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
72 changes: 72 additions & 0 deletions seal/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: batch/v2alpha1
kind: CronJob
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
schedule: {{- if .Values.crontab }} {{ .Values.crontab }} {{ else }} "0 14 * * *" {{ end }}
jobTemplate:
spec:
activeDeadlineSeconds: 100
template:
spec:
restartPolicy: Never
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image.repository }}"
imagePullPolicy: {{ default "" .Values.image.imagePullPolicy | quote }}
command: [ "bin/seal.rb" ]
env:
- name: SEAL_QUOTES
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: seal_quotes
- name: GITHUB_EXCLUDE_LABELS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: github_exclude_labels
- name: GITHUB_USE_LABELS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: github_use_labels
- name: GITHUB_MEMBERS
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: github_members
- name: SLACK_CHANNEL
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: slack_channel
- name: DYNO
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: dyno
- name: SLACK_WEBHOOK
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: slack_webhook
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: github_token
- name: SEAL_ORGANISATION
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: seal_organisation
{{- if .Values.seal.dry_run }}
- name: DRY
value: "true"
{{- end }}
20 changes: 20 additions & 0 deletions seal/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
seal_organisation: {{ default "" .Values.seal.seal_organisation| b64enc | quote }}
github_token: {{ default "" .Values.seal.github_token| b64enc | quote }}
slack_webhook: {{ default "" .Values.seal.slack_webhook| b64enc | quote }}
dyno: {{ default "" .Values.seal.dyno| b64enc | quote }}
slack_channel: {{ default "" .Values.seal.slack_channel| b64enc | quote }}
github_members: {{ default "" .Values.seal.github_members| b64enc | quote }}
github_use_labels: {{ default "" .Values.seal.github_use_labels| b64enc | quote }}
github_exclude_labels: {{ default "" .Values.seal.github_exclude_labels| b64enc | quote }}
seal_quotes: {{ default "" .Values.seal.seal_quotes| b64enc | quote }}
24 changes: 24 additions & 0 deletions seal/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
crontab: "0 15 * * *"
image:
repository: quay.io/strataconsulting/seal:helm
imagePullPolicy: Always
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
seal:
seal_organisation: "org"
github_token: "token"
slack_webhook: "webhook"
dyno: "true"
slack_channel: "#channel"
github_members: "user1,user2"
github_use_labels: "true"
github_exclude_labels: "[DO NOT MERGE],Don't merge,DO NOT MERGE,Waiting on factcheck,wip"
seal_quotes: "Everyone should have the opportunity to learn. Don’t be afraid to pick up stories on things you don’t understand and ask for help with them.,Try to pair when possible."
dry_run: true