Skip to content

Commit

Permalink
docs: improve OpenFGA Chart documentation withvalues.schema.json (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-whit authored Apr 3, 2023
1 parent 33d8ba8 commit fdeb2e4
Show file tree
Hide file tree
Showing 6 changed files with 283 additions and 54 deletions.
2 changes: 1 addition & 1 deletion charts/openfga/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: openfga
description: A Kubernetes Helm chart for the OpenFGA project.

type: application
version: 0.1.7
version: 0.1.8
appVersion: "v0.4.2"

home: "https://openfga.github.io/helm-charts/charts/openfga"
Expand Down
3 changes: 2 additions & 1 deletion charts/openfga/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ To uninstall/delete the `openfga` deployment:
$ helm uninstall openfga
```

## Parameters
## Chart Parameters
Take a look at the Chart [values schema reference](https://artifacthub.io/packages/helm/openfga/openfga?modal=values-schema) for more information on the chart values that can be configured. Chart values that are null will default to the server specific default values. For more information on the server defaults please see the [official server configuration documentation](https://openfga.dev/docs/getting-started/setup-openfga/docker#configuring-the-server).
54 changes: 42 additions & 12 deletions charts/openfga/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
{{- end }}
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "{{ .Values.metrics.port }}"
prometheus.io/port: "{{ (split ":" .Values.telemetry.metrics.addr)._1 }}"
labels:
{{- include "openfga.selectorLabels" . | nindent 8 }}
spec:
Expand Down Expand Up @@ -56,12 +56,12 @@ spec:
protocol: TCP

- name: playground
containerPort: {{ (split ":" .Values.profiler.addr)._1 }}
containerPort: {{ .Values.playground.port }}
protocol: TCP

{{- if .Values.metrics.enabled }}
{{- if .Values.telemetry.metrics.enabled }}
- name: metrics
containerPort: {{ .Values.metrics.port }}
containerPort: {{ (split ":" .Values.telemetry.metrics.addr)._1 }}
protocol: TCP
{{- end }}

Expand Down Expand Up @@ -129,7 +129,7 @@ spec:

{{- if .Values.http.addr }}
- name: OPENFGA_HTTP_ADDR
value: {{ .Values.http.addr }}
value: "{{ .Values.http.addr }}"
{{- end }}

{{- if .Values.http.tls.enabled }}
Expand Down Expand Up @@ -212,7 +212,7 @@ spec:

{{- if .Values.changelogHorizonOffset }}
- name: OPENFGA_CHANGELOG_HORIZON_OFFSET
value: "{{ .Values.changelogHorizonOffset }}""
value: "{{ .Values.changelogHorizonOffset }}"
{{- end }}

{{- if .Values.resolveNodeLimit }}
Expand All @@ -230,14 +230,44 @@ spec:
value: "{{ .Values.listObjectsMaxResults }}"
{{- end }}

{{- if .Values.otel.metrics.endpoint }}
- name: OPENFGA_OTEL_METRICS_ENDPOINT
value: {{ .Values.otel.metrics.endpoint }}
{{- if .Values.allowWriting1_0Models }}
- name: OPENFGA_ALLOW_WRITING_1_0_MODELS
value: "{{ .Values.allowWriting1_0Models }}"
{{- end }}

{{- if .Values.allowEvaluating1_0Models }}
- name: OPENFGA_ALLOW_EVALUATING_1_0_MODELS
value: "{{ .Values.allowEvaluating1_0Models }}"
{{- end }}

{{- if .Values.telemetry.metrics.enabled }}
- name: OPENFGA_METRICS_ENABLED
value: "{{ .Values.telemetry.metrics.enabled }}"
{{- end }}

{{- if .Values.telemetry.metrics.addr }}
- name: OPENFGA_METRICS_ADDR
value: "{{ .Values.telemetry.metrics.addr }}"
{{- end }}

{{- if .Values.telemetry.metrics.enableRPCHistograms }}
- name: OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS
value: "{{ .Values.telemetry.metrics.enableRPCHistograms }}"
{{- end }}

{{- if .Values.telemetry.trace.enabled }}
- name: OPENFGA_TRACE_ENABLED
value: "{{ .Values.telemetry.trace.enabled }}"
{{- end }}

{{- if .Values.telemetry.trace.otlp.endpoint }}
- name: OPENFGA_TRACE_OTLP_ENDPOINT
value: {{ .Values.telemetry.trace.otlp.endpoint }}
{{- end }}

{{- if .Values.otel.metrics.protocol }}
- name: OPENFGA_OTEL_METRICS_PROTOCOL
value: {{ .Values.otel.metrics.protocol }}
{{- if .Values.telemetry.trace.sampleRatio }}
- name: OPENFGA_TRACE_SAMPLE_RATIO
value: "{{ .Values.telemetry.trace.sampleRatio }}"
{{- end }}

readinessProbe:
Expand Down
4 changes: 2 additions & 2 deletions charts/openfga/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ spec:
protocol: TCP
{{- end }}

{{- if .Values.metrics.enabled }}
{{- if .Values.telemetry.metrics.enabled }}
- name: metrics
port: {{ .Values.metrics.port }}
port: {{ (split ":" .Values.telemetry.metrics.addr)._1 }}
targetPort: metrics
protocol: TCP
{{- end }}
Expand Down
Loading

0 comments on commit fdeb2e4

Please sign in to comment.