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

feat: add Common Labels Support #167

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
17 changes: 17 additions & 0 deletions charts/openfga/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 labels 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:

Expand Down
3 changes: 3 additions & 0 deletions charts/openfga/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Common labels
{{- define "openfga.labels" -}}
helm.sh/chart: {{ include "openfga.chart" . }}
{{ include "openfga.selectorLabels" . }}
{{- with .Values.commonLabels }}
{{ . | toYaml }}
{{- end }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/openfga/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions charts/openfga/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down