Skip to content

Commit

Permalink
Merge pull request #5 from flyimg/wip-chart-updates
Browse files Browse the repository at this point in the history
WIP chart updates
  • Loading branch information
sadok-f committed Sep 16, 2024
2 parents f57b363 + 2d3af84 commit 6fcf835
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 19 deletions.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <release_name> flyimg/flyimg -f values.yaml
```

Alternatively, you can pass in parameters directly via the command line:

```
helm install <release_name> 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
```
31 changes: 14 additions & 17 deletions charts/flyimg/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions charts/flyimg/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: flyimg-override-config
data:
override-parameters.yml: |
{{- .Values.parameters | toYaml | nindent 4 }}
35 changes: 34 additions & 1 deletion charts/flyimg/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/flyimg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

0 comments on commit 6fcf835

Please sign in to comment.