Compare commits

...

38 Commits

Author SHA1 Message Date
3040d72a0f Merge pull request 'added gitignore' (#6) from gitignore into main
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
Reviewed-on: #6
2024-11-12 11:47:42 +00:00
897fcd184c added gitignore
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-12 12:47:04 +01:00
fe724d11d7 Merge pull request 'debugging' (#5) from debugging into main
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 16s
Reviewed-on: #5
2024-11-12 11:43:18 +00:00
169b054dff fixed working version
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 22s
2024-11-12 12:41:47 +01:00
6b3bda7f0d fixed image tag 2024-11-12 08:10:14 +01:00
4f092eaa2a Merge pull request 'test_dep_build' (#4) from test_dep_build into main
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 16s
Reviewed-on: #4
2024-11-11 15:12:57 +00:00
Jonas Forsberg
5fd7675ffb trigger pipe build
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 16:11:59 +01:00
Jonas Forsberg
c5d44ffffa removed dep build in push 2024-11-11 16:11:29 +01:00
2180602e3a Merge pull request 'linting' (#3) from linting into main
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 16s
Reviewed-on: #3
2024-11-11 15:07:15 +00:00
Jonas Forsberg
583643bcab trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 16:06:32 +01:00
Jonas Forsberg
e0864adab0 added dependecy build 2024-11-11 16:06:03 +01:00
Jonas Forsberg
6cd276eaa3 trigger pipeline 2024-11-11 16:03:36 +01:00
Jonas Forsberg
0a72a599f7 added linting, only build on main branch 2024-11-11 16:02:40 +01:00
Jonas Forsberg
5523cd61d1 trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:48:57 +01:00
Jonas Forsberg
c6c13e201b .
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 14s
2024-11-11 15:48:09 +01:00
Jonas Forsberg
ba29643c98 .
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 15s
2024-11-11 15:46:51 +01:00
Jonas Forsberg
7049e3fc4f trigger pipeline 2024-11-11 15:45:35 +01:00
Jonas Forsberg
9b04821db0 fixed token 2024-11-11 15:44:54 +01:00
Jonas Forsberg
851c54d3cc trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 16s
2024-11-11 15:39:57 +01:00
Jonas Forsberg
e103640693 using curly braces in filename variables
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:39:14 +01:00
Jonas Forsberg
852a8e403e trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:36:42 +01:00
Jonas Forsberg
165fbc2946 debugging pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:35:50 +01:00
Jonas Forsberg
2b33691e67 trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:32:16 +01:00
Jonas Forsberg
c31521018f trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:29:24 +01:00
Jonas Forsberg
911f56284f trigger pipeline
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:25:10 +01:00
Jonas Forsberg
f08bcc331d added dependancy building
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:24:23 +01:00
Jonas Forsberg
13c879d1d5 trigger pipeline
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 15s
2024-11-11 15:20:59 +01:00
Jonas Forsberg
6d3b50cf08 fixed chart path for build
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 17s
2024-11-11 15:20:21 +01:00
Jonas Forsberg
770044fba0 trigger pipeline
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 15s
2024-11-11 15:18:53 +01:00
Jonas Forsberg
582f68d4f6 fixed path to charts
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:17:52 +01:00
Jonas Forsberg
dd7146b905 updated options
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 16s
2024-11-11 15:15:46 +01:00
Jonas Forsberg
a453aed4bd added missing "
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 15s
2024-11-11 15:14:18 +01:00
Jonas Forsberg
824964432c .
Some checks failed
Package and publish helm chart / package-helm (push) Failing after 18s
2024-11-11 15:11:55 +01:00
Jonas Forsberg
0165ead984 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-11-11 15:09:51 +01:00
Jonas Forsberg
f5e44648a4 moved precommit 2024-11-11 15:08:48 +01:00
59cf68dea5 Merge pull request 'added buildchart pipe' (#2) from pipline into main
Reviewed-on: #2
2024-11-11 14:07:14 +00:00
Jonas Forsberg
0d914ea479 added buildchart pipe 2024-11-11 15:06:38 +01:00
39c0db5a0a Merge pull request 'Added home-assistant chart' (#1) from home-assistant into main
Reviewed-on: #1
2024-11-11 10:18:37 +00:00
9 changed files with 207 additions and 5 deletions

View File

@ -0,0 +1,58 @@
name: Package and publish helm chart
on:
push:
jobs:
package-helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Check out code
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.14.4
- name: Set up yq
uses: mikefarah/yq@master
- name: Check for changed charts
id: changed-files
uses: tj-actions/changed-files@v44
with:
dir_names: true
dir_names_max_depth: '2'
files: 'charts/**'
- name: Run helm lint on all changed charts
shell: bash
env:
ALL_CHANGED_CHARTS: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
REPO_PATH=$(git rev-parse --show-toplevel)
for chart in ${ALL_CHANGED_CHARTS}; do
cd ${REPO_PATH}/${chart}
helm dependency build
helm lint .
done
- name: build helm package
shell: bash
if: gitea.ref == 'refs/heads/main'
env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
CHART_NAME: ${{ steps.chart_name.outputs.result }}
CHART_VERSION: ${{ steps.chart_version.outputs.result }}
ALL_CHANGED_CHARTS: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
REPO_PATH=$(git rev-parse --show-toplevel)
for chart in ${ALL_CHANGED_CHARTS}; do
cd ${REPO_PATH}/${chart}
CHART_NAME=$(yq .name Chart.yaml)
CHART_VERSION=$(yq .version Chart.yaml)
echo "Packaging ${CHART_NAME}-${CHART_VERSION}"
helm package .
curl -H "Authorization: token $PACKAGE_TOKEN" -X POST --upload-file ${CHART_NAME}-${CHART_VERSION}.tgz https://git.rre.nu/api/packages/jonas/helm/api/charts
done

40
.gitignore vendored Normal file
View File

@ -0,0 +1,40 @@
# General files for the project
pkg/*
*.pyc
bin/*
.project
/.bin
/_test/secrets/*.json
*.tgz
Chart.lock
# OSX leaves these everywhere on SMB shares
._*
# OSX trash
.DS_Store
# Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
.idea/
*.iml
# Vscode files
.vscode
# Emacs save files
*~
\#*\#
.\#*
# Vim-related files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
# Chart dependencies
**/charts/*.tgz
.history

View File

@ -0,0 +1 @@
# My helm-charts

View File

@ -4,7 +4,7 @@ name: home-assistant
description: Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. description: Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts.
type: application type: application
version: 1.0.0 version: 1.0.0
appVersion: v2024.11.1 appVersion: 2024.11.1
kubeVersion: ">=1.27.0" kubeVersion: ">=1.27.0"
home: https://www.home-assistant.io/ home: https://www.home-assistant.io/
sources: sources:
@ -16,4 +16,4 @@ maintainers:
dependencies: dependencies:
- name: lib - name: lib
repository: https://git.rre.nu/api/packages/jonas/helm repository: https://git.rre.nu/api/packages/jonas/helm
version: 1.0.3 version: 1.0.4

View File

@ -13,10 +13,30 @@ The following table lists the configurable parameters of the Home-assistant char
| ------------------------ | ----------------------- | -------------- | | ------------------------ | ----------------------- | -------------- |
| `image.repository` | | `"ghcr.io/home-assistant/home-assistant"` | | `image.repository` | | `"ghcr.io/home-assistant/home-assistant"` |
| `image.tag` | | `null` | | `image.tag` | | `null` |
| `controller.enabled` | should the main workload be included or not | `true` |
| `controller.type` | valid options are deployment, statefulset, job | `"statefulset"` |
| `service.http.enabled` | | `true` |
| `service.http.ports.http.port` | | `80` |
| `service.http.ports.http.targetPort` | | `8123` |
| `ingress.enabled` | | `false` |
| `ingress.service` | what service should the ingress target | `"http"` |
| `ingress.servicePort` | | `80` |
| `ingress.className` | | `"nginx"` |
| `ingress.hosts` | | `[{"host": "example.local", "paths": [{"path": "/", "pathType": "Prefix"}]}]` |
| `ingress.annotations` | | `{}` |
| `ingress.tls` | | `[]` |
| `volumeClaimTemplates` | | `[{"name": "config", "mountPath": "/config", "accessMode": "ReadWriteOnce", "storageClassName": "longhorn", "size": "1Gi"}]` |
| `livenessProbe.httpGet.path` | | `"/"` | | `livenessProbe.httpGet.path` | | `"/"` |
| `livenessProbe.httpGet.port` | | `8123` | | `livenessProbe.httpGet.port` | | `8123` |
| `livenessProbe.initialDelaySeconds` | | `5` | | `livenessProbe.initialDelaySeconds` | | `5` |
| `livenessProbe.periodSeconds` | | `3` | | `livenessProbe.periodSeconds` | | `3` |
| `volumes` | | `[{"name": "configs", "configMap": {"name": "hass-configs", "items": [{"key": "configuration.yaml", "path": "configuration.yaml"}, {"key": "automations.yaml", "path": "automations.yaml"}, {"key": "scenes.yaml", "path": "scenes.yaml"}, {"key": "scripts.yaml", "path": "scripts.yaml"}]}}, {"name": "secrets", "secret": {"secretName": "hass-secrets", "items": [{"key": "secrets.yaml", "path": "secrets.yaml"}]}}]` |
| `volumeMounts` | | `[{"name": "configs", "mountPath": "/config/configuration.yaml", "subPath": "configuration.yaml", "readOnly": true}, {"name": "configs", "mountPath": "/config/automations.yaml", "subPath": "automations.yaml", "readOnly": true}, {"name": "configs", "mountPath": "/config/scenes.yaml", "subPath": "scenes.yaml", "readOnly": true}, {"name": "configs", "mountPath": "/config/scripts.yaml", "subPath": "scripts.yaml", "readOnly": true}, {"name": "secrets", "mountPath": "/config/secrets.yaml", "subPath": "secrets.yaml", "readOnly": true}]` |
| `hass_configs.configuration.yaml` | | `"# Loads default set of integrations. Do not remove.\ndefault_config:\n\n# Load frontend themes from the themes folder\nfrontend:\n themes: !include_dir_merge_named themes\n\nautomation: !include automations.yaml\nscript: !include scripts.yaml\nscene: !include scenes.yaml\n"` |
| `hass_configs.automations.yaml` | | `"[]\n"` |
| `hass_configs.scenes.yaml` | | `"# scenes\n"` |
| `hass_configs.scripts.yaml` | | `"# scripts\n"` |
| `hass_secrets.secrets.yaml` | | `"# Use this file to store secrets like usernames and passwords.\n# Learn more at https://www.home-assistant.io/docs/configuration/secrets/\nsome_password: welcome\n"` |

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: hass-configs
namespace: {{ .Values.namespace | default "default" }}
labels: {{ include "lib.labels" . | nindent 4 }}
data: {{ .Values.hass_configs | toYaml | nindent 2 }}

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: hass-secrets
namespace: {{ .Values.namespace | default "default" }}
labels: {{ include "lib.labels" . | nindent 4 }}
type: Opauge
data:
{{- range $n, $v := .Values.hass_secrets -}}
{{ $n | nindent 2 }}: {{ $v | b64enc }}
{{- end }}

View File

@ -31,18 +31,83 @@ ingress:
# hosts: # hosts:
# - chart-example.local # - chart-example.local
volumeClaimTemplates: volumeClaimTemplates:
- name: config - name: config
mountPath: /config mountPath: /config
accessMode: "ReadWriteOnce" accessMode: "ReadWriteOnce"
storageClassName: "default" storageClassName: "longhorn"
size: 1Gi size: 1Gi
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /
port: 8123 port: 8123
initialDelaySeconds: 5 initialDelaySeconds: 5
periodSeconds: 3 periodSeconds: 3
volumes:
- name: configs
configMap:
name: hass-configs
items:
- key: configuration.yaml
path: configuration.yaml
- key: automations.yaml
path: automations.yaml
- key: scenes.yaml
path: scenes.yaml
- key: scripts.yaml
path: scripts.yaml
- name: secrets
secret:
secretName: hass-secrets
items:
- key: secrets.yaml
path: secrets.yaml
volumeMounts:
- name: configs
mountPath: /config/configuration.yaml
subPath: configuration.yaml
readOnly: true
- name: configs
mountPath: /config/automations.yaml
subPath: automations.yaml
readOnly: true
- name: configs
mountPath: /config/scenes.yaml
subPath: scenes.yaml
readOnly: true
- name: configs
mountPath: /config/scripts.yaml
subPath: scripts.yaml
readOnly: true
- name: secrets
mountPath: /config/secrets.yaml
subPath: secrets.yaml
readOnly: true
hass_configs:
configuration.yaml: |
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
automations.yaml: |
[]
scenes.yaml: |
# scenes
scripts.yaml: |
# scripts
hass_secrets:
secrets.yaml: |
# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
some_password: welcome