- Migrated to common library. (#900)

This commit is contained in:
nιcнolaѕ wιlde 2021-05-09 01:06:52 -07:00 committed by GitHub
parent cf6454cad6
commit b6ce1780ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 106 additions and 381 deletions

View File

@ -1,8 +1,9 @@
---
apiVersion: v2
appVersion: v1.22.0
description: A self-hosted data logger for your Tesla 🚘
name: teslamate
version: 3.7.0
version: 4.0.0
keywords:
- teslamate
- tesla
@ -11,10 +12,13 @@ icon: https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Tesla_Motors.svg
sources:
- https://github.com/adriankumpf/teslamate
dependencies:
- name: postgresql
version: 10.4.0
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: common
repository: https://library-charts.k8s-at-home.com
version: 2.5.0
- name: postgresql
version: 10.4.0
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
maintainers:
- name: billimek
email: jeff@billimek.com

View File

@ -1,6 +1,6 @@
# teslamate
![Version: 3.6.5](https://img.shields.io/badge/Version-3.6.5-informational?style=flat-square) ![AppVersion: v1.22.0](https://img.shields.io/badge/AppVersion-v1.22.0-informational?style=flat-square)
![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![AppVersion: v1.22.0](https://img.shields.io/badge/AppVersion-v1.22.0-informational?style=flat-square)
A self-hosted data logger for your Tesla 🚘
@ -16,7 +16,8 @@ A self-hosted data logger for your Tesla 🚘
| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | postgresql | 10.3.15 |
| https://charts.bitnami.com/bitnami | postgresql | 10.4.0 |
| https://library-charts.k8s-at-home.com | common | 2.5.0 |
## TL;DR
@ -73,52 +74,17 @@ N/A
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| checkOrigin | bool | `false` | |
| fullnameOverride | string | `""` | |
| env | object | `{}` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"teslamate/teslamate"` | |
| image.tag | string | `"1.22.0"` | |
| ingress.annotations | object | `{}` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0] | string | `"chart-example.local"` | |
| ingress.path | string | `"/"` | |
| ingress.tls | list | `[]` | |
| locale | string | `"en"` | |
| mqtt.enabled | bool | `false` | |
| mqtt.host | string | `nil` | |
| mqtt.password | string | `nil` | |
| mqtt.tls | string | `nil` | |
| mqtt.tlsAcceptInvalid | string | `nil` | |
| mqtt.username | string | `nil` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| postgresql.enabled | bool | `true` | |
| postgresql.image.repository | string | `"postgres"` | |
| postgresql.image.tag | float | `12.1` | |
| postgresql.persistence.accessModes[0] | string | `"ReadWriteOnce"` | |
| postgresql.persistence.enabled | bool | `true` | |
| postgresql.persistence.mountPath | string | `"/data/"` | |
| postgresql.persistence.size | string | `"8Gi"` | |
| postgresql.persistence.storageClass | string | `nil` | |
| postgresql.postgresqlDataDir | string | `"/data/pgdata"` | |
| postgresql.postgresqlDatabase | string | `"teslamate"` | |
| postgresql.postgresqlPassword | string | `"teslamate"` | |
| postgresql.postgresqlUsername | string | `"teslamate"` | |
| probes.liveness.failureThreshold | int | `15` | |
| probes.liveness.periodSeconds | int | `10` | |
| probes.readiness.failureThreshold | int | `15` | |
| probes.readiness.periodSeconds | int | `10` | |
| probes.startup.failureThreshold | int | `30` | |
| probes.startup.initialDelaySeconds | int | `15` | |
| probes.startup.periodSeconds | int | `10` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| service.port | int | `4000` | |
| service.type | string | `"ClusterIP"` | |
| timeZone | string | `"UTC"` | |
| tolerations | list | `[]` | |
| virtualHost | string | `nil` | |
| persistence.import.emptyDir.enabled | bool | `false` | |
| persistence.import.enabled | bool | `false` | |
| persistence.import.mountPath | string | `"/opt/app/import"` | |
| postgresql.enabled | bool | `false` | |
| service.port.port | int | `4000` | |
| strategy.type | string | `"Recreate"` | |
## Changelog
@ -126,6 +92,20 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [4.0.0]
#### Added
- N/A
#### Changed
- **BREAKING** Migrate to the common library, a lot of configuration has changed.
#### Removed
- test-connection
### [3.6.1]
#### Added
@ -140,7 +120,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A
[3.6.1]: #3.6.1
[4.0.0]: #400
[3.6.1]: #361
## Support

View File

@ -143,3 +143,4 @@ helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -
{{ template "custom.support" . }}
{{ template "helm-docs.versionFooter" . }}
{{ "" }}

View File

@ -9,6 +9,20 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [4.0.0]
#### Added
- N/A
#### Changed
- **BREAKING** Migrate to the common library, a lot of configuration has changed.
#### Removed
- test-connection
### [3.6.1]
#### Added
@ -23,5 +37,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A
[3.6.1]: #3.6.1
[4.0.0]: #400
[3.6.1]: #361
{{- end -}}

View File

@ -0,0 +1,19 @@
---
env:
DATABASE_USER: "postgres"
DATABASE_PASS: "teslamate-pass"
DATABASE_NAME: "teslamate"
DATABASE_HOST: teslamate-postgresql
DISABLE_MQTT: "true"
fullnameOverride: teslamate
postgresql:
enabled: true
postgresqlUsername: postgres
postgresqlPassword: teslamate-pass
postgresqlDatabase: teslamate
persistence:
enabled: false
# storageClass: ""
fullnameOverride: teslamate-postgresql

View File

@ -1,21 +1 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "teslamate.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ include "teslamate.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "teslamate.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "teslamate.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{- include "common.notes.defaultNotes" . -}}

View File

@ -1,41 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "teslamate.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 "teslamate.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 a default fully qualified postgresql name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "teslamate.postgresql.fullname" -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "teslamate.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@ -0,0 +1 @@
{{ include "common.all" . }}

View File

@ -1,109 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "teslamate.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
helm.sh/chart: {{ include "teslamate.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.postgresql.postgresqlUsername }}
- name: DATABASE_USER
value: {{ .Values.postgresql.postgresqlUsername | quote }}
{{- end }}
{{- if .Values.postgresql.postgresqlPassword }}
- name: DATABASE_PASS
value: {{ .Values.postgresql.postgresqlPassword | quote }}
{{- end }}
{{- if .Values.postgresql.postgresqlDatabase }}
- name: DATABASE_NAME
value: {{ .Values.postgresql.postgresqlDatabase | quote }}
{{- end }}
- name: DATABASE_HOST
value: {{ template "teslamate.postgresql.fullname" . }}
{{- if .Values.mqtt.enabled }}
- name: MQTT_HOST
value: {{ .Values.mqtt.host | quote }}
- name: MQTT_USERNAME
value: {{ .Values.mqtt.username | quote }}
- name: MQTT_PASSWORD
value: {{ .Values.mqtt.password | quote }}
- name: MQTT_TLS
value: {{ .Values.mqtt.tls | quote }}
- name: MQTT_TLS_ACCEPT_INVALID_CERTS
value: {{ .Values.mqtt.tlsAcceptInvalid | quote }}
{{- else }}
- name: DISABLE_MQTT
value: "true"
{{- end }}
{{- if .Values.timeZone }}
- name: TZ
value: {{ .Values.timeZone | quote }}
{{- end }}
{{- if .Values.checkOrigin }}
- name: CHECK_ORIGIN
value: {{ .Values.checkOrigin | quote }}
{{- end }}
{{- if .Values.virtualHost }}
- name: VIRTUAL_HOST
value: {{ .Values.virtualHost | quote }}
{{- end }}
{{- if .Values.locale }}
- name: LOCALE
value: {{ .Values.locale | quote }}
{{- end }}
ports:
- name: http
containerPort: 4000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
readinessProbe:
httpGet:
path: /
port: http
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
startupProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
resources:
{{- toYaml .Values.resources | nindent 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 }}

View File

@ -1,38 +0,0 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "teslamate.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
helm.sh/chart: {{ include "teslamate.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- 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: {{ . | quote }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}

View File

@ -1,19 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "teslamate.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
helm.sh/chart: {{ include "teslamate.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@ -1,18 +0,0 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "teslamate.fullname" . }}-test-connection"
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
helm.sh/chart: {{ include "teslamate.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 "teslamate.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

View File

@ -1,101 +1,50 @@
replicaCount: 1
#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#
image:
repository: teslamate/teslamate
tag: 1.22.0
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
strategy:
type: Recreate
timeZone: UTC
mqtt:
enabled: false
# mqtt broker hostname - REQUIRED if mqtt is enabled
host:
username:
password:
# Enables TLS if true
tls:
# Accepts invalid certificates if true
tlsAcceptInvalid:
# Configures whether to check the origin header or not.
checkOrigin: false
# Host part used for generating URLs throughout the app
virtualHost:
# valid values are 'en' or 'de'
locale: en
# Probes configuration
probes:
liveness:
failureThreshold: 15
periodSeconds: 10
readiness:
failureThreshold: 15
periodSeconds: 10
startup:
initialDelaySeconds: 15
failureThreshold: 30
periodSeconds: 10
# See more environment variables in the teslamate documentation
# https://docs.teslamate.org/docs/configuration/environment_variables
env: {}
# TZ:
# DATABASE_USER: "postgres"
# DATABASE_PASS: "teslamate-pass"
# DATABASE_NAME: "teslamate"
# DATABASE_HOST: teslamate-postgresql
# DISABLE_MQTT: "true"
service:
type: ClusterIP
port: 4000
port:
port: 4000
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
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: {}
persistence:
import:
enabled: false
emptyDir:
enabled: false
mountPath: /opt/app/import
# Configuration values for the postgresql dependency.
# ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/postgresql
postgresql:
enabled: true
postgresqlUsername: teslamate
postgresqlPassword: teslamate
postgresqlDatabase: teslamate
image:
repository: postgres
tag: 12.1
postgresqlDataDir: "/data/pgdata"
persistence:
enabled: true
storageClass:
accessModes:
- ReadWriteOnce
size: 8Gi
mountPath: "/data/"
enabled: false
# postgresqlUsername: postgres
# postgresqlPassword: teslamate-pass
# postgresqlDatabase: teslamate
# persistence:
# enabled: false
# storageClass: ""
# fullnameOverride: teslamate-postgresql