From bd07e88308988155a4ef49d2130d0c174a387f14 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 18 Sep 2024 17:04:02 +0200 Subject: [PATCH] Erstellen eines Chart packages --- .gitea/workflows/build.yml | 44 ++++++++++++++++++++++++++++++++++++++ Chart.yaml | 6 +++--- templates/deployment.yaml | 14 ++++-------- templates/pvc.yaml | 3 +-- values.yaml | 24 ++++++++------------- 5 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..c72efe4 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,44 @@ +name: "Build Helm Chart" +on: + push: + branches: + - main + paths: + - "Chart.yaml" + pull_request: + branches: + - main + paths: + - "Chart.yaml" + +jobs: + helm-package: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set Helm Chart App Name and Version + id: get_version + run: | + APP_NAME=$(grep -oP '(?<=^name: ).*' Chart.yaml) + echo "Helm Chart App Name: $APP_NAME" + echo "::set-output name=app::$APP_NAME" + + CHART_VERSION=$(grep -oP '(?<=^version: ).*' Chart.yaml) + echo "Helm Chart version: $CHART_VERSION" + echo "::set-output name=tag::$CHART_VERSION" + + - name: Setup Helm + run: | + curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash + helm version + + - name: Package Helm Chart + run: | + helm lint . + helm package . + + - name: Upload Helm Package to repo + run: | + #curl --user ${{ secrets.USER }}:${{ secrets.TOKEN }} -X POST --upload-file ./${{ steps.get_version.outputs.app }}-${{ steps.get_version.outputs.tag }}.tgz ${{ vars.HELMREGISTRY }}/api/packages/${{ vars.OWNER }}/helm/api/charts diff --git a/Chart.yaml b/Chart.yaml index 245426d..cd44618 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 maintainers: - name: Marko Oldenburg email: fhemdevelopment@cooltux.net - url: https://git.cooltux.net/kubernetes/helm-charts + url: https://git.cooltux.net/FHEM/fhem-docker_helm-chart name: fhem description: FHEM (TM) is a GPL'd perl server for house automation. It is used to automate some common tasks in the household like switching lamps / shutters / heating / etc. and to log events like temperature / humidity / power consumption. home: https://fhem.de @@ -20,5 +20,5 @@ annotations: category: Houseautomation licenses: GPL'd type: application -version: 0.4.9 -appVersion: "3.3.1-bullseye" +version: 4.0.5 +appVersion: "4.0.5-bullseye" diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 0efdcd1..0a2bfa8 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -56,14 +56,6 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} env: - - name: APT_PKGS - value: {{ default "" .Values.aptPkgs | quote }} - - name: CPAN_PKGS - value: {{ default "" .Values.cpanPkgs | quote }} - - name: PIP_PKGS - value: {{ default "" .Values.pipPkgs | quote }} - - name: NPM_PKGS - value: {{ default "" .Values.npmPkgs | quote }} - name: LOGFILE value: {{ default "./log/fhem-%Y-%m-%d.log" .Values.logfile | quote }} - name: TELNETPORT @@ -85,7 +77,9 @@ spec: - name: I2C_GID value: {{ default "6003" .Values.i2cGID | quote }} - name: TIMEOUT - value: {{ default "" .Values.timeout | quote }} + value: {{ default "10" .Values.timeout | quote }} + - name: TIMEOUT_STARTING + value: {{ default "60" .Values.timeout | quote }} - name: LANG value: {{ default "en_US.UTF-8" .Values.lang | quote }} - name: LANGUAGE @@ -111,7 +105,7 @@ spec: - name: TZ value: {{ default "Europe/Berlin" .Values.timezone | quote }} - name: CONFIGTYPE - value: {{ default "" .Values.configtype | quote }} + value: {{ default "fhem.cfg.demo" .Values.configtype | quote }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/templates/pvc.yaml b/templates/pvc.yaml index cf6b16c..7ce492b 100644 --- a/templates/pvc.yaml +++ b/templates/pvc.yaml @@ -5,9 +5,8 @@ metadata: name: {{ include "fhem.fullname" . }} labels: {{- include "fhem.labels" . | nindent 4 }} - annotations: - volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} spec: + storageClassName: {{ .Values.persistence.storageClass | quote }} accessModes: {{- if not (empty .Values.persistence.accessModes) }} {{- range .Values.persistence.accessModes }} diff --git a/values.yaml b/values.yaml index 1a436bb..d41e36e 100644 --- a/values.yaml +++ b/values.yaml @@ -10,7 +10,7 @@ replicaCount: 1 updateStrategy: RollingUpdate image: - repository: fhem/fhem-minimal + repository: ghcr.io/fhem/fhem-minimal-docker pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" @@ -20,14 +20,6 @@ nameOverride: "" fullnameOverride: "" ### Tweak container settings using environment variables -## Debian APT packages: "App::Name1 App::Name2" -aptPkgs: "" -## Perl CPAN modules: "package1 package2" -cpanPkgs: "" -## Python PIP packages: "package1 package2" -pipPkgs: "" -## Node.js NPM packages: "package1 package2" -npmPkgs: "" ## Change FHEM logfile format: To set a different logfile path and format (default is ./log/fhem-%Y-%m-%d.log): logfile: "" ## Change FHEM local Telnet port for health check and container restart handling: To set a different Telnet port for local connection during health check and container restart (default is 7072): @@ -50,6 +42,9 @@ gpioGID: "" i2cGID: "" ## Change shutdown timeout: To set a different setting for the timer during FHEM shutdown handling, you may add this environment variable: 10 timeout: "" +## Set FHEM startup timeout: Set a Timeout, how long the docker container waits until the FHEM process will finished starting. If the timeout is over, and FHEM is not started, the container is stopped. You will see an error like this in the container log, if starting wasn't finished early enough: ERROR: Fatal: No message from FHEM since 60 seconds that server has started. +## If you have a slow system and a module which blocks FHEM to be ready adjust this to a higher value. +timeout_starting: "" ## Set locale: For maximum compatibility, standard locale is set to US english with some refinements towards the European standards and German defaults. This may be changed according to your needs (also see Debian Wiki for more information): lang: "" language: "" @@ -66,12 +61,12 @@ lcTime: "" timezone: "" ## Using configDB: Should you be using FHEM config type configDB, you need to change the FHEM configuration source for correct startup by setting the following environment variable: configDB ## fhem.cfg.demo for Democonfig -configtype: "fhem.cfg.demo" +configtype: "" ### ENDE Container environment variables serviceAccount: # Specifies whether a service account should be created - create: true + create: false # Annotations to add to the service account annotations: {} # The name of the service account to use. @@ -126,7 +121,7 @@ service: ## @param service.type Kubernetes Service type ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## - type: LoadBalancer # LoadBalancer + type: NodePort # LoadBalancer, ClusterIP ## @param service.loadBalancerIP Use serviceLoadBalancerIP to request a specific static IP, otherwise leave blank ## loadBalancerIP: "" @@ -134,7 +129,7 @@ service: ## @param service.ports.https Service HTTPS port ## ports: - fhemweb: 80 + fhemweb: 8083 ## ## @param service.nodePorts [object] Use nodePorts to request some specific ports when using NodePort ## nodePorts: @@ -173,7 +168,7 @@ ingress: # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - - host: + - host: # Hostname paths: - path: / pathType: ImplementationSpecific @@ -183,7 +178,6 @@ ingress: # - 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