[icantbelieveitsnotvaletudo] Add chart (#293)

* [icantbelieveitsnotvaletudo] Add chart

* use pretty json in configmap

* fix default options

* Add Readme and NOTES

* fix maintainer

* fix NOTES
This commit is contained in:
Piotr Maksymiuk 2020-08-09 14:04:40 +02:00 committed by GitHub
parent b83cb529a7
commit 40b25ebdcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 384 additions and 0 deletions

View File

@ -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/

View File

@ -0,0 +1,16 @@
apiVersion: v2
appVersion: 0.3.0
version: 0.1.0
name: icantbelieveitsnotvaletudo
description: Create live map data from Valetudo powered robots
type: application
keywords:
- MQTT
- valetudo
- iot
home: https://valetudo.cloud
sources:
- https://github.com/Hypfer/ICantBelieveItsNotValetudo
maintainers:
- name: ishioni
email: helm@movishell.pl

View File

@ -0,0 +1,46 @@
# I can't belive it's not Valetudo
Map generation companion service for [Valetudo](valetudo.cloud)
## TL;DR;
```shell
$ helm repo add billimek https://billimek.com/billimek-charts/
$ helm install billimek/icantbelieveitsnotvaletudo
```
## Installing the Chart
To install the chart with the release name `my-release`:
```console
helm install --name my-release billimek/icantbelieveitsnotvaletudo
```
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
helm delete my-release --purge
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
## Configuration
Read through the [values.yaml](https://github.com/billimek/billimek-charts/blob/master/charts/icantbelieveitsnotvaletudo/values.yaml) file. It has several commented out suggested values.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
helm install --name my-release \
--set config.mqtt.broker_url="mqtt://mymqttbroker" \
billimek/icantbelieveitsnotvaletudo
```
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
helm install --name my-release -f values.yaml billimek/icantbelieveitsnotvaletudo
```

View File

@ -0,0 +1,6 @@
{{- if .Values.ingress.enabled }}
You can get the map data under this URL:
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}api/map/image
{{- end }}
{{- end }}

View File

@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "icantbelieveitsnotvaletudo.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 "icantbelieveitsnotvaletudo.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 "icantbelieveitsnotvaletudo.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "icantbelieveitsnotvaletudo.labels" -}}
helm.sh/chart: {{ include "icantbelieveitsnotvaletudo.chart" . }}
{{ include "icantbelieveitsnotvaletudo.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "icantbelieveitsnotvaletudo.selectorLabels" -}}
app.kubernetes.io/name: {{ include "icantbelieveitsnotvaletudo.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "icantbelieveitsnotvaletudo.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "icantbelieveitsnotvaletudo.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "icantbelieveitsnotvaletudo.fullname" . }}
labels:
{{ include "icantbelieveitsnotvaletudo.labels" . | indent 4 }}
data:
config.json: |
{{- .Values.config | mustToPrettyJson | nindent 4 }}

View File

@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "icantbelieveitsnotvaletudo.fullname" . }}
labels:
{{- include "icantbelieveitsnotvaletudo.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "icantbelieveitsnotvaletudo.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "icantbelieveitsnotvaletudo.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "icantbelieveitsnotvaletudo.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.config.webserver.enabled }}
ports:
- name: http
containerPort: {{ .Values.config.webserver.port }}
protocol: TCP
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /app/config.json
subPath: config.json
volumes:
- name: config
configMap:
name: {{ include "icantbelieveitsnotvaletudo.fullname" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "icantbelieveitsnotvaletudo.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "icantbelieveitsnotvaletudo.labels" . | nindent 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: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,17 @@
{{- if .Values.ingress.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "icantbelieveitsnotvaletudo.fullname" . }}
labels:
{{- include "icantbelieveitsnotvaletudo.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "icantbelieveitsnotvaletudo.selectorLabels" . | nindent 4 }}
{{- end }}

View File

@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "icantbelieveitsnotvaletudo.serviceAccountName" . }}
labels:
{{- include "icantbelieveitsnotvaletudo.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,90 @@
# Default values for valetudo-mapper.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: pmaksymiuk/icantbelieveitsnotvaletudo
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag:
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
config:
mapsettings:
drawPath: true
drawCharger: true
drawRobot: true
scale: 4
mqtt:
identifier: "rockrobo"
topicPrefix: "valetudo"
autoconfPrefix: "homeassistant"
broker_url: "mqtt://user:pass@example.com:port"
mapDataTopic: "valetudo/rockrobo/map_data"
minMillisecondsBetweenMapUpdates: 10000
publishMapImage: true
webserver:
enabled: false
port: 3000
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}