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 948c607..3c5cd5a 100644 --- a/charts/flyimg/Chart.yaml +++ b/charts/flyimg/Chart.yaml @@ -1,23 +1,20 @@ apiVersion: v2 name: flyimg description: A Helm chart for Kubernetes for Flyimg app - -# 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 +maintainers: + - name: sadok-f + email: sadoknet@gmail.com + url: https://github.com/sadok-f + +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.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..692bb42 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 -R /var/www/html/config/* /config/ + 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..ba40052 100644 --- a/charts/flyimg/values.yaml +++ b/charts/flyimg/values.yaml @@ -77,3 +77,6 @@ nodeSelector: {} tolerations: [] affinity: {} + +# To override the default parameters for Flyimg application, check https://github.com/flyimg/flyimg/blob/main/config/parameters.yml +parameters: