From 523671832269919e529dd86563a26cf9c6d42571 Mon Sep 17 00:00:00 2001 From: Sadok Date: Sun, 15 Sep 2024 21:42:58 +0200 Subject: [PATCH 1/6] WIP; chart update --- charts/flyimg/Chart.yaml | 4 +-- charts/flyimg/templates/configmap.yaml | 7 +++++ charts/flyimg/templates/deployment.yaml | 35 ++++++++++++++++++++++++- charts/flyimg/values.yaml | 3 +++ 4 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 charts/flyimg/templates/configmap.yaml diff --git a/charts/flyimg/Chart.yaml b/charts/flyimg/Chart.yaml index 948c607..21a7301 100644 --- a/charts/flyimg/Chart.yaml +++ b/charts/flyimg/Chart.yaml @@ -15,9 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.2.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.4.9 +appVersion: 1.4.12 diff --git a/charts/flyimg/templates/configmap.yaml b/charts/flyimg/templates/configmap.yaml new file mode 100644 index 0000000..a36ee20 --- /dev/null +++ b/charts/flyimg/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: flyimg-override-config +data: + override-parameters.yml: | + {{- .Values.parameters | toYaml | nindent 4 }} \ No newline at end of file diff --git a/charts/flyimg/templates/deployment.yaml b/charts/flyimg/templates/deployment.yaml index 854ac75..6fdfef8 100644 --- a/charts/flyimg/templates/deployment.yaml +++ b/charts/flyimg/templates/deployment.yaml @@ -27,6 +27,28 @@ spec: serviceAccountName: {{ include "flyimg.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + - name: copy-original-config + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + command: ["/bin/sh", "-c"] + args: + - | + cp /var/www/html/config/parameters.yml /config/parameters.yml + volumeMounts: + - name: shared-config + mountPath: /config + - name: update-config + image: mikefarah/yq:4 + command: ["/bin/sh", "-c"] + args: + - | + yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' /config/parameters.yml /override/override-parameters.yml > /config/merged-parameters.yml + mv /config/merged-parameters.yml /config/parameters.yml + volumeMounts: + - name: shared-config + mountPath: /config + - name: override-config + mountPath: /override containers: - name: {{ .Chart.Name }} securityContext: @@ -45,8 +67,19 @@ spec: httpGet: path: / port: http + volumeMounts: + - name: shared-config + mountPath: /var/www/html/config resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: shared-config + emptyDir: {} + - name: override-config + configMap: + name: flyimg-override-config + # optional: true + {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/flyimg/values.yaml b/charts/flyimg/values.yaml index 4881764..bd80b84 100644 --- a/charts/flyimg/values.yaml +++ b/charts/flyimg/values.yaml @@ -77,3 +77,6 @@ nodeSelector: {} tolerations: [] affinity: {} + +# configuration values for Flyimg application +parameters: \ No newline at end of file From 20711b148dd3db11dd9beccf9b7f3b662d2e859d Mon Sep 17 00:00:00 2001 From: Sadok Date: Mon, 16 Sep 2024 08:59:25 +0200 Subject: [PATCH 2/6] fixing missing routes.yml in the mount config folder --- charts/flyimg/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/flyimg/templates/deployment.yaml b/charts/flyimg/templates/deployment.yaml index 6fdfef8..692bb42 100644 --- a/charts/flyimg/templates/deployment.yaml +++ b/charts/flyimg/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: command: ["/bin/sh", "-c"] args: - | - cp /var/www/html/config/parameters.yml /config/parameters.yml + cp -R /var/www/html/config/* /config/ volumeMounts: - name: shared-config mountPath: /config From efcc282043cd7c85a263924568ec5fe933ba0e91 Mon Sep 17 00:00:00 2001 From: Sadok Date: Mon, 16 Sep 2024 09:05:54 +0200 Subject: [PATCH 3/6] Fix linting errors --- charts/flyimg/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/flyimg/values.yaml b/charts/flyimg/values.yaml index bd80b84..ba40052 100644 --- a/charts/flyimg/values.yaml +++ b/charts/flyimg/values.yaml @@ -78,5 +78,5 @@ tolerations: [] affinity: {} -# configuration values for Flyimg application -parameters: \ No newline at end of file +# To override the default parameters for Flyimg application, check https://github.com/flyimg/flyimg/blob/main/config/parameters.yml +parameters: From 63660dcb0cb4b8cbf6c3465cadc66e00f83ec7c6 Mon Sep 17 00:00:00 2001 From: Sadok Date: Mon, 16 Sep 2024 09:33:02 +0200 Subject: [PATCH 4/6] Ad maintainers section --- charts/flyimg/Chart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/flyimg/Chart.yaml b/charts/flyimg/Chart.yaml index 21a7301..383fba3 100644 --- a/charts/flyimg/Chart.yaml +++ b/charts/flyimg/Chart.yaml @@ -1,6 +1,10 @@ apiVersion: v2 name: flyimg description: A Helm chart for Kubernetes for Flyimg app +maintainers: + - name: Sadok Ferjani + email: sadoknet@gmail.com + url: https://github.com/sadok-f # A chart can be either an 'application' or a 'library' chart. # From fdbc5a18a74fd7de146a0439ac63402e8a1ddacd Mon Sep 17 00:00:00 2001 From: Sadok Date: Mon, 16 Sep 2024 09:58:45 +0200 Subject: [PATCH 5/6] Update maintainer section to fix linting errors --- charts/flyimg/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/flyimg/Chart.yaml b/charts/flyimg/Chart.yaml index 383fba3..cc8eaaa 100644 --- a/charts/flyimg/Chart.yaml +++ b/charts/flyimg/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: flyimg description: A Helm chart for Kubernetes for Flyimg app maintainers: - - name: Sadok Ferjani + - name: sadok-f email: sadoknet@gmail.com url: https://github.com/sadok-f From 2d3af84d0e2cc2a5cd518f0d57cb431da3d59f83 Mon Sep 17 00:00:00 2001 From: Sadok Date: Mon, 16 Sep 2024 11:32:56 +0200 Subject: [PATCH 6/6] Update documentation --- README.md | 45 +++++++++++++++++++++++++++++++++++++++- charts/flyimg/Chart.yaml | 23 +++++++------------- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2b150c5..86765a1 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,59 @@ Helm's [documentation](https://helm.sh/docs) to get started. Once Helm has been set up correctly, add the repo as follows: +``` helm repo add flyimg https://charts.flyimg.io - +``` If you had already added this repo earlier, run `helm repo update` to retrieve the latest versions of the packages. You can then run `helm search repo flyimg` to see the charts. To install the flyimg chart: +``` helm install my-flyimg flyimg/flyimg +``` + +### Customizing Installation + +You can customize your Flyimg installation by providing a custom values.yaml file. For example: + +``` + helm install flyimg/flyimg -f values.yaml +``` + +Alternatively, you can pass in parameters directly via the command line: + +``` + helm install flyimg/flyimg \ + --set key1=value1,key2=value2 +``` + +To override the default configuration for Flyimg, you can do that by adding the needed changes in the `parameters:` section in your values.yaml file as the following example: + +```yaml +parameters: + storage_system: local + aws_s3: + access_id: 'xxxxxxx' + secret_key: 'xxxxxx' + region: 'eu-central-1' + bucket_name: 'xxxxx' + .... +``` + +## Upgrade Flyimg + +To upgrade the Flyimg chart after making changes to your configuration: + +``` + helm upgrade flyimg/flyimg +``` + +## Uninstalling Flyimg To uninstall the chart: +``` helm delete my-flyimg +``` diff --git a/charts/flyimg/Chart.yaml b/charts/flyimg/Chart.yaml index cc8eaaa..3c5cd5a 100644 --- a/charts/flyimg/Chart.yaml +++ b/charts/flyimg/Chart.yaml @@ -1,27 +1,20 @@ apiVersion: v2 name: flyimg description: A Helm chart for Kubernetes for Flyimg app +type: application maintainers: - name: sadok-f email: sadoknet@gmail.com url: https://github.com/sadok-f -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application +keywords: + - flyimg + - image-resizing + - image-optimization + - avif + - mozjpeg + - webp -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) version: 0.2.1 -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. appVersion: 1.4.12