diff --git a/charts/openfga/README.md b/charts/openfga/README.md index 6b8a33c..27e652c 100644 --- a/charts/openfga/README.md +++ b/charts/openfga/README.md @@ -21,6 +21,23 @@ This will deploy a 3-replica deployment of OpenFGA on the Kubernetes cluster usi +## Customization +If you wish to customize the OpenFGA deployment you may supply paremeters such as the ones listed in the [values.yaml](/charts/openfga/values.yaml). + +### Installing with Custom Common Labels +You can specify custom tags to insert into resources inline or via Values files: + +```sh +$ helm install openfga openfga/openfga \ + --set-json 'commonLabels={"app.example.com/domain": "example", "app.example.com/system": "permissions"}' +``` + +```yaml +commonLabels: + app.example.com/system: permissions + app.example.com/domain: example +``` + ### Installing with Postgres If you do not already have a Postgres deployment, you can deploy OpenFGA with Postgres with the following command: diff --git a/charts/openfga/templates/_helpers.tpl b/charts/openfga/templates/_helpers.tpl index 6abf573..f27ffe7 100644 --- a/charts/openfga/templates/_helpers.tpl +++ b/charts/openfga/templates/_helpers.tpl @@ -44,6 +44,7 @@ Common labels {{- define "openfga.labels" -}} helm.sh/chart: {{ include "openfga.chart" . }} {{ include "openfga.selectorLabels" . }} +{{ .Values.commonLabels | toYaml }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} diff --git a/charts/openfga/values.schema.json b/charts/openfga/values.schema.json index fd3ad70..676a9ae 100644 --- a/charts/openfga/values.schema.json +++ b/charts/openfga/values.schema.json @@ -61,6 +61,11 @@ }, "additionalProperties": false }, + "commonLabels": { + "type": "object", + "description": "Common labels to apply to OpenFGA resources", + "default": "" + }, "fullnameOverride": { "type": "string", "description": "Overrides the default fully qualified app name", diff --git a/charts/openfga/values.yaml b/charts/openfga/values.yaml index 686a1eb..16da369 100644 --- a/charts/openfga/values.yaml +++ b/charts/openfga/values.yaml @@ -9,6 +9,13 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +# Specify additional labels to apply to OpenFGA resources +# Usage example: +# commonLabels: +# app.example.com/system: permissions +# app.example.com/domain: example +commonLabels: {} + serviceAccount: # Specifies whether a service account should be created create: true