Skip to content
Merged
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
22 changes: 22 additions & 0 deletions charts/hawkbit/.helmignore
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/
15 changes: 15 additions & 0 deletions charts/hawkbit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
version: 1.0.0
appVersion: "0.3.0M6-mysql"
description: A Helm chart for hawkBit update server
name: hawkbit
home: https://www.eclipse.org/hawkbit/
sources:
- https://github.com/eclipse/hawkbit
- https://github.com/eclipse/packages
icon: https://www.eclipse.org/hawkbit/images/hawkbit_icon.png
maintainers:
- name: monotek
email: andre.bauer@kiwigrid.com
- name: axdotl
email: axel.koehler@kiwigrid.com
45 changes: 45 additions & 0 deletions charts/hawkbit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Hawkbit Update Server

## Introduction

[Eclipse hawkBit™](https://www.eclipse.org/hawkbit/) is a domain independent back-end framework for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure.

This chart uses hawkbit/hawkbit-update-server container to run Hawkbit update server inside Kubernetes.

## Prerequisites

- Has been tested on Kubernetes 1.11+

## Installing the Chart

To install the chart with the release name `eclipse-hawkbit`, run the following command:

```bash
helm repo add eclipse-iot https://eclipse.org/packages/charts
relm repo update
helm install eclipse-hawkbit eclipse-iot/hawkbit
```

## Uninstalling the Chart

To uninstall/delete the `eclipse-hawkbit` deployment:

```bash
helm delete eclipse-hawkbit
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

> **Tip**: To completely remove the release, run `helm delete --purge eclipse-hawkbit`

## Configuration

Please view the `values.yaml` for the list of possible configuration values with its documentation.

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:

```bash
helm install eclipse-hawkbit eclipse-iot/hawkbit --set podDisruptionBudget.enabled=true
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart.
9 changes: 9 additions & 0 deletions charts/hawkbit/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: mysql
repository: https://charts.bitnami.com
version: 6.7.4
- name: rabbitmq
repository: https://charts.bitnami.com
version: 6.16.0
digest: sha256:515ffc3c905c6b32413d8089e297c1f38151a225203a5c1b0cb17c157e55625d
generated: "2020-01-15T11:04:01.389753897+01:00"
9 changes: 9 additions & 0 deletions charts/hawkbit/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: mysql
version: 6.7.4
repository: https://charts.bitnami.com
condition: mysql.enabled
- name: rabbitmq
version: 6.16.0
repository: https://charts.bitnami.com
condition: rabbitmq.enabled
1 change: 1 addition & 0 deletions charts/hawkbit/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Eclipse Hawkbit installed!
45 changes: 45 additions & 0 deletions charts/hawkbit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hawkbit.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 "hawkbit.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 "hawkbit.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "hawkbit.labels" -}}
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
helm.sh/chart: {{ include "hawkbit.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
9 changes: 9 additions & 0 deletions charts/hawkbit/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "hawkbit.fullname" . }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
data:
application.yaml: |-
{{ toYaml .Values.config.application | indent 4}}
109 changes: 109 additions & 0 deletions charts/hawkbit/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hawkbit.fullname" . }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
{{- with .Values.updateStrategy }}
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
checksum/config: {{ include (print .Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.podTemplate.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: SPRING_PROFILES_ACTIVE
value: "{{ .Values.spring.profiles }}"
- name: "SPRING_DATASOURCE_URL"
value: "jdbc:mysql://{{ if .Values.mysql.enabled }}{{ .Release.Name }}-mysql{{ else }}{{ .Values.env.springDatasourceHost }}{{ end }}:3306/{{ .Values.env.springDatasourceDb }}"
- name: "SPRING_APPLICATION_JSON"
valueFrom:
secretKeyRef:
name: {{ include "hawkbit.fullname" . }}
key: "SPRING_APPLICATION_JSON"
- name: "SPRING_RABBITMQ_HOST"
value: "{{ if .Values.rabbitmq.enabled }}{{ .Release.Name }}-rabbitmq{{ else }}{{ .Values.env.springRabbitmqHost }}{{ end }}"
- name: "SPRING_RABBITMQ_USERNAME"
value: "{{ .Values.env.springRabbitmqUsername }}"
- name: "SPRING_RABBITMQ_PASSWORD"
valueFrom:
secretKeyRef:
name: "{{ template "hawkbit.fullname" . }}-rabbitmq-pass"
key: "rabbitmq-pass"
{{- range $key, $value := .Values.extraEnv }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /VAADIN/themes/hawkbit/favicon.ico
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: /VAADIN/themes/hawkbit/favicon.ico
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
volumeMounts:
- name: configmap
mountPath: {{ .Values.configMap.mountPath }}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.securityContext.enabled }}
securityContext:
fsGroup: {{ .Values.securityContext.fsGroup }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- if .Values.securityContext.extra }}
{{- toYaml .Values.securityContext.extra | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: configmap
configMap:
name: {{ include "hawkbit.fullname" . }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 6 }}
{{- end }}
36 changes: 36 additions & 0 deletions charts/hawkbit/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "hawkbit.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- 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:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/hawkbit/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.podDisruptionBudget.enabled (gt .Values.replicaCount 1.0) -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ include "hawkbit.fullname" . }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/hawkbit/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "hawkbit.fullname" . }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
type: Opaque
data:
SPRING_APPLICATION_JSON: {{ .Values.config.secrets | toJson | b64enc }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ template "hawkbit.fullname" . }}-rabbitmq-pass
labels:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
helm.sh/chart: {{ include "hawkbit.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
rabbitmq-pass: {{ .Values.env.springRabbitmqPassword | b64enc | quote }}
20 changes: 20 additions & 0 deletions charts/hawkbit/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hawkbit.fullname" . }}
labels:
{{ include "hawkbit.labels" . | indent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
18 changes: 18 additions & 0 deletions charts/hawkbit/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "hawkbit.fullname" . }}-test-connection"
labels:
app.kubernetes.io/name: {{ include "hawkbit.name" . }}
helm.sh/chart: {{ include "hawkbit.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "hawkbit.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
Loading