From 743fb67d7d4decbfb8bebc928c00afd92073eed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= Date: Mon, 14 Jun 2021 18:23:44 +0200 Subject: [PATCH] [homer] Migrate to common v3 (#1007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs --- charts/stable/homer/Chart.yaml | 6 +-- charts/stable/homer/README.md | 34 +++++++++------ .../stable/homer/README_CHANGELOG.md.gotmpl | 8 ++++ charts/stable/homer/templates/_helpers.tpl | 32 -------------- charts/stable/homer/templates/common.yaml | 32 +++++--------- charts/stable/homer/templates/configmap.yaml | 8 +--- charts/stable/homer/values.yaml | 42 ++++++++++++------- 7 files changed, 71 insertions(+), 91 deletions(-) delete mode 100644 charts/stable/homer/templates/_helpers.tpl diff --git a/charts/stable/homer/Chart.yaml b/charts/stable/homer/Chart.yaml index 103cb46d..f34c60a7 100644 --- a/charts/stable/homer/Chart.yaml +++ b/charts/stable/homer/Chart.yaml @@ -1,10 +1,10 @@ apiVersion: v2 -appVersion: 20.09.1 +appVersion: 21.03.2 description: A dead simple static HOMepage for your servER to keep your services on hand, from a simple yaml configuration file. icon: https://raw.githubusercontent.com/bastienwirtz/homer/main/public/logo.png home: https://github.com/k8s-at-home/charts/tree/master/charts/stable/homer name: homer -version: 4.4.0 +version: 5.0.0 kubeVersion: ">=1.16.0-0" sources: - https://github.com/bastienwirtz/homer @@ -14,4 +14,4 @@ maintainers: dependencies: - name: common repository: https://library-charts.k8s-at-home.com - version: 2.5.0 + version: 3.1.0 diff --git a/charts/stable/homer/README.md b/charts/stable/homer/README.md index 004c9180..a103e921 100644 --- a/charts/stable/homer/README.md +++ b/charts/stable/homer/README.md @@ -1,6 +1,6 @@ # homer -![Version: 4.4.0](https://img.shields.io/badge/Version-4.4.0-informational?style=flat-square) ![AppVersion: 20.09.1](https://img.shields.io/badge/AppVersion-20.09.1-informational?style=flat-square) +![Version: 5.0.0](https://img.shields.io/badge/Version-5.0.0-informational?style=flat-square) ![AppVersion: 21.03.2](https://img.shields.io/badge/AppVersion-21.03.2-informational?style=flat-square) A dead simple static HOMepage for your servER to keep your services on hand, from a simple yaml configuration file. @@ -18,7 +18,7 @@ Kubernetes: `>=1.16.0-0` | Repository | Name | Version | |------------|------|---------| -| https://library-charts.k8s-at-home.com | common | 2.5.0 | +| https://library-charts.k8s-at-home.com | common | 3.1.0 | ## TL;DR @@ -75,18 +75,18 @@ N/A | Key | Type | Default | Description | |-----|------|---------|-------------| -| configmap.config | string | `"externalConfig: https://raw.githubusercontent.com/bastienwirtz/homer/main/public/assets/config.yml.dist\n"` | Homer configuration https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md | +| configmap.config | string | See values.yaml | Homer configuration. See [image documentation](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md) for more information. | | configmap.enabled | bool | `false` | Store homer configuration as a ConfigMap | -| env | object | `{}` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"b4bz/homer"` | | -| image.tag | string | `"20.09.1"` | | -| ingress.enabled | bool | `false` | | -| persistence.config.emptyDir.enabled | bool | `false` | | -| persistence.config.enabled | bool | `false` | | -| persistence.config.mountPath | string | `"/www/assets"` | | -| service.port.port | int | `8080` | | -| strategy.type | string | `"Recreate"` | | +| env | object | See below | environment variables. | +| env.GID | string | `"911"` | Specify the group ID the application will run as | +| env.TZ | string | `"UTC"` | Set the container timezone | +| env.UID | string | `"911"` | Specify the user ID the application will run as | +| image.pullPolicy | string | `"IfNotPresent"` | image pull policy | +| image.repository | string | `"b4bz/homer"` | image repository | +| image.tag | string | `"21.03.2"` | image tag | +| ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. | +| persistence | object | See values.yaml | Configure persistence settings for the chart under this key. | +| service | object | See values.yaml | Configures service settings for the chart. | ## Changelog @@ -94,6 +94,14 @@ 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). +### [5.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.1.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored). + Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.1.0/charts/stable/common/) for the up-to-date values. +- Change image tag to `21.03.2`. + ### [3.2.0] #### Added diff --git a/charts/stable/homer/README_CHANGELOG.md.gotmpl b/charts/stable/homer/README_CHANGELOG.md.gotmpl index 1bc37e87..2cd63c73 100644 --- a/charts/stable/homer/README_CHANGELOG.md.gotmpl +++ b/charts/stable/homer/README_CHANGELOG.md.gotmpl @@ -9,6 +9,14 @@ 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). +### [5.0.0] + +#### Changed + +- **BREAKING**: Upgraded the common library dependency to version 3.1.0. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored). + Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.1.0/charts/stable/common/) for the up-to-date values. +- Change image tag to `21.03.2`. + ### [3.2.0] #### Added diff --git a/charts/stable/homer/templates/_helpers.tpl b/charts/stable/homer/templates/_helpers.tpl deleted file mode 100644 index 26402ed8..00000000 --- a/charts/stable/homer/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "homer.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 "homer.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 "homer.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/charts/stable/homer/templates/common.yaml b/charts/stable/homer/templates/common.yaml index fbdf833c..f0d30174 100644 --- a/charts/stable/homer/templates/common.yaml +++ b/charts/stable/homer/templates/common.yaml @@ -12,30 +12,18 @@ configmap/checksum: {{ include (print $.Template.BasePath "/configmap.yaml") . | {{- $_ := set .Values "podAnnotations" (deepCopy $podAnnotations) -}} {{- end -}} -{{/* Append the configMap to the additionalVolumes */}} -{{- define "homer.configmap.volume" -}} -name: config -configMap: - name: {{ template "common.names.fullname" . }}-config +{{/* Append the configMap volume to the volumes */}} +{{- define "homer.configVolume" -}} +enabled: "true" +mountPath: "/www/assets/config.yml" +subPath: "config.yml" +type: "custom" +volumeSpec: + configMap: + name: {{ include "common.names.fullname" . }}-config {{- end -}} - {{- if .Values.configmap.enabled -}} -{{- $volume := include "homer.configmap.volume" . | fromYaml -}} -{{- $additionalVolumes := append .Values.additionalVolumes $volume }} -{{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}} -{{- end -}} - -{{/* Append the configMap volume to the additionalVolumeMounts */}} -{{- define "homer.configmap.volumeMount" -}} -name: config -mountPath: /www/assets/config.yml -subPath: config.yml -{{- end -}} - -{{- if .Values.configmap.enabled -}} -{{- $volumeMount := include "homer.configmap.volumeMount" . | fromYaml -}} -{{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount }} -{{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}} +{{- $_ := set .Values.persistence "config" (include "homer.configVolume" . | fromYaml) -}} {{- end -}} {{/* Render the templates */}} diff --git a/charts/stable/homer/templates/configmap.yaml b/charts/stable/homer/templates/configmap.yaml index 0f804e1b..2f447c02 100644 --- a/charts/stable/homer/templates/configmap.yaml +++ b/charts/stable/homer/templates/configmap.yaml @@ -2,13 +2,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "homer.fullname" . }}-config - namespace: {{ .Release.Namespace }} + name: {{ include "common.names.fullname" . }}-config labels: - app.kubernetes.io/name: {{ include "homer.name" . }} - helm.sh/chart: {{ include "homer.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "common.labels" . | nindent 4 }} data: config.yml: | {{ .Values.configmap.config | indent 4 }} diff --git a/charts/stable/homer/values.yaml b/charts/stable/homer/values.yaml index f8e6ef4e..7a91549f 100644 --- a/charts/stable/homer/values.yaml +++ b/charts/stable/homer/values.yaml @@ -6,36 +6,48 @@ # image: + # -- image repository repository: b4bz/homer - tag: 20.09.1 + # -- image tag + tag: 21.03.2 + # -- image pull policy pullPolicy: IfNotPresent -strategy: - type: Recreate - -env: {} - # UID: - # GID: +# -- environment variables. +# @default -- See below +env: + # -- Set the container timezone + TZ: UTC + # -- Specify the user ID the application will run as + UID: "911" + # -- Specify the group ID the application will run as + GID: "911" +# -- Configures service settings for the chart. +# @default -- See values.yaml service: - port: - port: 8080 + main: + ports: + http: + port: 8080 ingress: - enabled: false + # -- Enable and configure ingress settings for the chart under this key. + # @default -- See values.yaml + main: + enabled: false +# -- Configure persistence settings for the chart under this key. +# @default -- See values.yaml persistence: config: enabled: false - emptyDir: - enabled: false mountPath: /www/assets - configmap: # -- Store homer configuration as a ConfigMap enabled: false - # -- Homer configuration - # https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md + # -- Homer configuration. See [image documentation](https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md) for more information. + # @default -- See values.yaml config: | externalConfig: https://raw.githubusercontent.com/bastienwirtz/homer/main/public/assets/config.yml.dist