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

Fix #6 #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]
### Added
- Add new probe support
- Make probes configurable by end-user
- Add `CHANGELOG` to the project. It is a file which contains a curated, chronologically ordered list of notable changes for each version of a project
- Add `ERRBIT_ADMIN_EMAIL`, `ERRBIT_ADMIN_USER` and `ERRBIT_ADMIN_PASSWORD` to `values.yaml`.

### Changed
- Use upstream docker image, because presumably it is more updated

### Fixed
- Fix usage of old deprecated API.

## [0.4.0] - 2017-12-21
### Added
- Allow to change Ingress path in `values.yaml`
Expand Down
7 changes: 6 additions & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
apiVersion: v1
description: Deploys Errbit. Errbit is a tool for collecting and managing errors from other applications
name: errbit-helm
version: 0.4.0
version: 0.4.2
sources:
- https://github.com/tmaier/errbit-helm
- https://github.com/errbit/errbit
icon: https://errbit.com/images/apps.png
dependencies:
- name: mongodb
version: ^9.3.1
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
condition: mongodb.enabled
8 changes: 4 additions & 4 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: mongodb
repository: https://kubernetes-charts.storage.googleapis.com
version: 0.4.21
digest: sha256:fbb8f1eb5df619d8355a343a815e1512bdf6dfd28e58464c259d5f3ef980c248
generated: 2017-12-20T18:06:35.908680542+01:00
repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
version: 9.3.1
digest: sha256:636d8d13e5c3f9ebf90e010ee17a18172808d5632d660f7a12288f867df1dd86
generated: "2022-10-31T12:15:48.983971407+02:00"
5 changes: 0 additions & 5 deletions requirements.yaml

This file was deleted.

17 changes: 15 additions & 2 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Otherwise it will return the set value
*/}}
{{- define "errbit-helm.mongodbUsername" -}}
{{- if .Values.mongodb.enabled -}}
{{- .Values.mongodb.mongodbUsername -}}
{{- .Values.mongodb.auth.username -}}
{{- else -}}
{{- default "" .Values.mongodbUsername -}}
{{- end -}}
Expand All @@ -65,8 +65,21 @@ Otherwise it will return the set value
*/}}
{{- define "errbit-helm.mongodbDatabase" -}}
{{- if .Values.mongodb.enabled -}}
{{- .Values.mongodb.mongodbDatabase -}}
{{- .Values.mongodb.auth.database -}}
{{- else -}}
{{- required "Value mongodbDatabase must be set" .Values.mongodbDatabase -}}
{{- end -}}
{{- end -}}

{{/*
Return the mongodb URI
If the mongodb dependency is enabled, it will return the mongodb database
Otherwise it will return the set value
*/}}
{{- define "errbit-helm.mongodbUri" -}}
{{- if .Values.mongodb.enabled -}}
{{- printf "mongodb://%s:%s@%s/%s" .Values.mongodb.auth.username .Values.mongodb.auth.password (include "errbit-helm.mongodbHost" .) .Values.mongodb.auth.database -}}
{{- else -}}
{{- required "Value mongodbUri must be set" .Values.mongodbUri -}}
{{- end -}}
{{- end -}}
53 changes: 24 additions & 29 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "errbit-helm.fullname" . }}
Expand All @@ -9,6 +9,10 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "errbit-helm.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
Expand All @@ -18,46 +22,37 @@ spec:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/config: {{ include (print $.Template.BasePath "/cm.yaml") . | sha256sum }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.internalPort }}
env:
- name: MONGODB_USERNAME
value: {{ template "errbit-helm.mongodbUsername" . }}
{{- if .Values.mongodb.enabled }}
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mongodb.fullname" . }}
key: mongodb-password
{{- end }}
- name: MONGODB_HOST
value: {{ template "errbit-helm.mongodbHost" . }}
- name: MONGODB_PORT
value: {{ template "errbit-helm.mongodbPort" . }}
- name: MONGODB_DATABASE
value: {{ template "errbit-helm.mongodbDatabase" . }}
- name: http
containerPort: {{ .Values.service.internalPort }}
protocol: TCP
envFrom:
- secretRef:
name: {{ template "errbit-helm.fullname" . }}
- configMapRef:
name: {{ template "errbit-helm.fullname" . }}
{{- if .Values.probes }}
{{- if .Values.probes.livenessProbe }}
livenessProbe:
httpGet:
path: /health/liveness
port: {{ .Values.service.internalPort }}
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 60
failureThreshold: 6
{{- toYaml .Values.probes.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.probes.startupProbe }}
startupProbe:
{{- toYaml .Values.probes.startupProbe | nindent 12 }}
{{- end }}
{{- if .Values.probes.readinessProbe }}
readinessProbe:
httpGet:
path: /health/readiness
port: {{ .Values.service.internalPort }}
{{- toYaml .Values.probes.readinessProbe | nindent 12 }}
{{- end }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
Expand Down
22 changes: 5 additions & 17 deletions templates/hooks/bootstrap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,15 @@ spec:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/config: {{ include (print $.Template.BasePath "/cm.yaml") . | sha256sum }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["rake", "errbit:bootstrap"]
env:
- name: MONGODB_USERNAME
value: {{ template "errbit-helm.mongodbUsername" . }}
{{- if .Values.mongodb.enabled }}
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mongodb.fullname" . }}
key: mongodb-password
{{- end }}
- name: MONGODB_HOST
value: {{ template "errbit-helm.mongodbHost" . }}
- name: MONGODB_PORT
value: {{ template "errbit-helm.mongodbPort" . }}
- name: MONGODB_DATABASE
value: {{ template "errbit-helm.mongodbDatabase" . }}
args: ["bundle", "exec", "rake", "errbit:bootstrap"]
envFrom:
- secretRef:
name: {{ template "errbit-helm.fullname" . }}
Expand Down
22 changes: 5 additions & 17 deletions templates/hooks/db-migrate-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,15 @@ spec:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/config: {{ include (print $.Template.BasePath "/cm.yaml") . | sha256sum }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["rake", "db:migrate", "db:mongoid:remove_undefined_indexes", "db:mongoid:create_indexes"]
env:
- name: MONGODB_USERNAME
value: {{ template "errbit-helm.mongodbUsername" . }}
{{- if .Values.mongodb.enabled }}
- name: MONGODB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mongodb.fullname" . }}
key: mongodb-password
{{- end }}
- name: MONGODB_HOST
value: {{ template "errbit-helm.mongodbHost" . }}
- name: MONGODB_PORT
value: {{ template "errbit-helm.mongodbPort" . }}
- name: MONGODB_DATABASE
value: {{ template "errbit-helm.mongodbDatabase" . }}
args: ["bundle", "exec", "rake", "db:migrate", "db:mongoid:remove_undefined_indexes", "db:mongoid:create_indexes"]
envFrom:
- secretRef:
name: {{ template "errbit-helm.fullname" . }}
Expand Down
13 changes: 8 additions & 5 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $serviceName := include "errbit-helm.fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
{{- $path := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "errbit-helm.fullname" . }}
Expand All @@ -21,10 +21,13 @@ spec:
- host: {{ $host | quote }}
http:
paths:
- path: {{ $path }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
- backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
path: {{ $path }}
pathType: Prefix
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
Expand Down
4 changes: 1 addition & 3 deletions templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ data:
{{- range $key, $value := .Values.configSecure }}
{{ $key | upper }}: {{ $value | b64enc | quote }}
{{- end }}
{{- if not .Values.mongodb.enabled }}
MONGODB_PASSWORD: {{- .Values.mongodbPassword | default "" | b64enc | quote -}}
{{- end }}
MONGO_URL: {{ include "errbit-helm.mongodbUri" . | b64enc | quote }}
38 changes: 25 additions & 13 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# Declare variables to be passed into your templates.
revisionHistoryLimit: 2
replicaCount: 1
imagePullSecrets: []
image:
repository: tmaier/errbit-helm
tag: latest
pullPolicy: Always
repository: errbit/errbit
tag: v0.9.0
service:
name: http
type: ClusterIP
externalPort: 80
internalPort: 8080
ingress:
enabled: false
path: '/*'
path: '/'
# Used to create an Ingress record.
hosts:
- errbit.example.local
Expand Down Expand Up @@ -50,14 +50,25 @@ batch:
# cpu: 50m
# memory: 512Mi

probes:
livenessProbe:
httpGet:
path: /health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 60
failureThreshold: 6
readinessProbe:
httpGet:
path: /health/readiness
port: http

## Configure access to an external database
## For these settings to be used you need to disable
## the included postgresql database below
# mongodbHost:
# mongodbPort: 27017
# mongodbPassword:
# mongodbUsername:
# mongodbDatabase: errbit
## the included mongodb database below
# mongodbUri: mongodb://localhost/errbit

## Configure Errbit
## See https://github.com/errbit/errbit/blob/master/docs/configuration.md for the available environment variables
Expand Down Expand Up @@ -91,9 +102,10 @@ networkPolicy:
##
mongodb:
enabled: true
mongodbUsername: errbit
mongodbPassword: errbit
mongodbDatabase: errbit
auth:
username: errbit
password: errbit
database: errbit
persistence:
## Consider to reduce the allocated disk space to fit the need
# size: 8Gi