Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate reva configuration from Helm Values #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Verify it's available and searh for charts:

```bash
$ helm repo list
NAME URL
cs3org https://cs3org.github.io/charts/
NAME URL
cs3org https://cs3org.github.io/charts/

$ helm search repo cs3org
NAME CHART VERSION APP VERSION DESCRIPTION
cs3org/revad 0.1.6 0.1.0 The Reva daemon (revad) helm chart
NAME CHART VERSION APP VERSION DESCRIPTION
cs3org/revad 0.1.6 0.1.0 The Reva daemon (revad) helm chart
```

## Examples
Expand All @@ -36,16 +36,16 @@ $ cat << EOF > custom-values.yaml
service:
http:
port: 20001
configFiles:
revad.toml: |
[http]
address = "0.0.0.0:20001"

[http.services.helloworld]
config:
http:
services:
# Adds Reva HTTP service named "helloworld"
helloworld: {}
EOF

$ helm install custom-reva cs3org/revad -f custom-values.yaml
```

or

```console
Expand Down
8 changes: 4 additions & 4 deletions 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: 1.5.0
version: 1.6.0
appVersion: v1.21.0
kubeVersion: '>= 1.19.0'
icon: https://reva.link/logo.svg
Expand All @@ -24,10 +24,10 @@ keywords:
annotations:
artifacthub.io/changes: |
- kind: changed
description: Bump revad version to v.1.21.0
description: Generate reva configuration file from chart Values
links:
- name: cs3org/reva#3524
url: https://github.com/cs3org/reva/pull/3524
- name: cs3org/charts#48
url: https://github.com/cs3org/charts/pull/48
artifacthub.io/images: |
- name: revad
image: cs3org/revad:v1.21.0
11 changes: 11 additions & 0 deletions revad/files/revad.toml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- /* vim: set filetype=mustache: */ -}}
{{- with .Values -}}
{{- $gatewaySvcHost := "0.0.0.0" -}}
{{- $grpcPort := .service.grpc.port -}}

{{- /* Computed defaults for shared section */ -}}
{{- $sharedDefaults := dict "gatewaysvc" (printf "%s:%d" $gatewaySvcHost ($grpcPort | int)) -}}
{{- $_ := set .config "shared" (merge (.config.shared | default $sharedDefaults) $sharedDefaults) -}}
{{- toToml .config -}}

{{- end -}}
2 changes: 1 addition & 1 deletion revad/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ metadata:
data:
{{- range $filename, $fileContents := .Values.configFiles }}
{{ $filename }}: |-
{{ $fileContents | indent 4 }}
{{ tpl $fileContents $ | indent 4 }}
{{- end }}
{{- end }}
55 changes: 32 additions & 23 deletions revad/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ image:
repository: cs3org/revad
tag: v1.21.0
pullPolicy: Always
pullSecrets:
[]
pullSecrets: []

service:
type: ClusterIP
Expand Down Expand Up @@ -73,6 +72,35 @@ envFrom:
# - secretRef:
# name: reva-secrets

## Main Reva configuration compiled into revad.toml file
config:
grpc:
services:
appprovider: {}
appregistry: {}
authprovider: {}
authregistry: {}
gateway: {}
groupprovider: {}
ocmcore: {}
ocminvitemanager: {}
ocmproviderauthorizer: {}
ocmshareprovider: {}
preferences: {}
publicshareprovider: {}
storageprovider: {}
storageregistry: {}
userprovider: {}
usershareprovider: {}
http:
services:
datagateway: {}
dataprovider: {}
prometheus: {}
ocmd: {}
ocdav: {}
ocs: {}

ingress:
enabled: false
services:
Expand Down Expand Up @@ -105,27 +133,8 @@ ingress:

# https://reva.link/docs/config/
configFiles:
revad.toml: |
[grpc.services.gateway]
[grpc.services.storageregistry]
[grpc.services.storageprovider]
[grpc.services.authprovider]
[grpc.services.authregistry]
[grpc.services.userprovider]
[grpc.services.groupprovider]
[grpc.services.usershareprovider]
[grpc.services.publicshareprovider]
[grpc.services.ocmcore]
[grpc.services.ocmshareprovider]
[grpc.services.ocminvitemanager]
[grpc.services.ocmproviderauthorizer]

[http.services.datagateway]
[http.services.dataprovider]
[http.services.prometheus]
[http.services.ocmd]
[http.services.ocdav]
[http.services.ocs]
revad.toml: |-
{{ tpl (.Files.Get "files/revad.toml.tpl") $ }}

users.json: |
[
Expand Down