Skip to content

Commit

Permalink
Create a separate ConfigMap for each revad container
Browse files Browse the repository at this point in the history
This will also allow in the future to ditch running
the main 'revad' container with -dev-dir by mounting
their config (.toml, .json, ...) on the righ container

Fix: cs3org#3
  • Loading branch information
SamuAlfageme committed Jun 5, 2020
1 parent 7955f6a commit 40fb405
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion revad/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: revad
description: The Reva daemon (revad) helm chart
type: application
version: 0.1.2
version: 0.1.4
appVersion: v0.1.0
icon: https://reva.link/logo.svg
home: https://reva.link
Expand Down
12 changes: 8 additions & 4 deletions revad/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
workingDir: {{ .Values.workingDir }}
{{- end }}
volumeMounts:
- name: {{ include "revad.fullname" . }}-configfiles
- name: {{ include "revad.fullname" . }}-revad-configfiles
mountPath: /etc/revad/
{{- if .Values.service.gateway }}
- name: {{ .Chart.Name }}-gateway
Expand All @@ -61,10 +61,14 @@ spec:
- "-p"
- "/var/run/revad.pid"
volumeMounts:
- name: {{ include "revad.fullname" . }}-configfiles
- name: {{ include "revad.fullname" . }}-gateway-configfiles
mountPath: /etc/revad/
{{- end }}
volumes:
- name: {{ include "revad.fullname" . }}-configfiles
{{- range $configMapName, $_ := .Values.configFiles }}
- name: "{{ include "revad.fullname" $ }}-{{ $configMapName }}-configfiles"
configMap:
name: {{ template "revad.fullname" . }}-config
name: "{{ template "revad.fullname" $ }}-{{ $configMapName }}-config"
{{- end }}


9 changes: 5 additions & 4 deletions revad/templates/revad-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{- if .Values.configFiles }}
{{- range $configMapName, $configMap := .Values.configFiles }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "revad.fullname" . }}-config
name: {{ include "revad.fullname" $ }}-{{ $configMapName }}-config
labels:
{{- include "revad.labels" . | nindent 4 }}
{{- include "revad.labels" $ | nindent 4 }}
data:
{{- range $filename, $fileContents := .Values.configFiles }}
{{- range $filename, $fileContents := $configMap }}
{{ $filename }}: |-
{{ $fileContents | indent 4 }}
{{- end }}
---
{{- end }}
40 changes: 21 additions & 19 deletions revad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,34 @@ service:

# https://reva.link/docs/config/
configFiles:
revad.toml: |
[shared]
jwt_secret = "mysecret"
revad:
revad.toml: |
[shared]
jwt_secret = "mysecret"
[http]
address = "0.0.0.0:20080"
[http]
address = "0.0.0.0:20080"
[http.services.prometheus]
[http.services.prometheus]
[grpc]
address = "0.0.0.0:20099"
gateway.toml: |
[shared]
jwt_secret = "mysecret"
gatewaysvc = "localhost:19000"
[grpc]
address = "0.0.0.0:20099"
gateway:
gateway.toml: |
[shared]
jwt_secret = "mysecret"
gatewaysvc = "localhost:19000"
[grpc]
address = "0.0.0.0:19000"
[grpc]
address = "0.0.0.0:19000"
[grpc.services.gateway]
datagateway = "http://localhost:19001/data"
[grpc.services.gateway]
datagateway = "http://localhost:19001/data"
[http]
address = "0.0.0.0:19001"
[http]
address = "0.0.0.0:19001"
[http.services.datagateway]
[http.services.datagateway]
args: []
Expand Down

0 comments on commit 40fb405

Please sign in to comment.