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