Skip to content

Commit

Permalink
Merge pull request #65 from colearendt/service-account-and-volumes
Browse files Browse the repository at this point in the history
Traefik Forward Auth - Volumes and Service Account
  • Loading branch information
colearendt authored Nov 28, 2023
2 parents b98c32b + 1371cd7 commit be15287
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/traefik-forward-auth/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: traefik-forward-auth
description: Deploy traefik-forward-auth
version: 0.0.12
version: 0.0.13
apiVersion: v1
sources:
- https://github.com/thomseddon/traefik-forward-auth
Expand Down
4 changes: 4 additions & 0 deletions charts/traefik-forward-auth/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.0.13

- Add pod volumes and volume mounts and option to create a service account

# 0.0.12

- Switch pod.env field to a list
Expand Down
11 changes: 8 additions & 3 deletions charts/traefik-forward-auth/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# traefik-forward-auth

![Version: 0.0.12](https://img.shields.io/badge/Version-0.0.12-informational?style=flat-square)
![Version: 0.0.13](https://img.shields.io/badge/Version-0.0.13-informational?style=flat-square)

## Installing the Chart

To install the chart with the release name `my-release` at version 0.0.12:
To install the chart with the release name `my-release` at version 0.0.13:

```bash
helm repo add colearendt https://colearendt.github.io/helm
helm install my-release colearendt/traefik-forward-auth --version=0.0.12
helm install my-release colearendt/traefik-forward-auth --version=0.0.13
```

#### _Deploy traefik-forward-auth_
Expand Down Expand Up @@ -39,11 +39,16 @@ helm install my-release colearendt/traefik-forward-auth --version=0.0.12
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| pod.env | list | `[]` | |
| pod.volumeMounts | list | `[]` | |
| pod.volumes | list | `[]` | |
| podAnnotations | object | `{}` | |
| readinessProbe | object | `{}` | |
| replicas | int | `1` | |
| resources | object | `{}` | |
| service.port | int | `80` | |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. -- If not set and create is true, a name is generated using the fullname template |
| serviceAnnotations | object | `{}` | |
| startupProbe | object | `{}` | |
| strategy | object | `{}` | |
Expand Down
11 changes: 11 additions & 0 deletions charts/traefik-forward-auth/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,14 @@ Usage:
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "traefik-forward-auth.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "traefik-forward-auth.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/traefik-forward-auth/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ spec:
volumeMounts:
- name: config
mountPath: "/config"
{{- if .Values.pod.volumeMounts }}
{{ toYaml .Values.pod.volumeMounts | indent 10 }}
{{- end }}
{{- if .Values.resources }}
resources:
{{ toYaml .Values.resources | indent 10 }}
Expand Down Expand Up @@ -77,4 +80,7 @@ spec:
items:
- key: config.ini
path: "config.ini"
{{- if .Values.pod.volumes }}
{{ toYaml .Values.pod.volumes | indent 6 }}
{{- end }}
---
11 changes: 11 additions & 0 deletions charts/traefik-forward-auth/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "traefik-forward-auth.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/traefik-forward-auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ extraObjects: []

pod:
env: []
volumes: []
volumeMounts: []

command:
- './traefik-forward-auth'
args:
Expand All @@ -54,3 +57,12 @@ ingress:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

serviceAccount:
# -- Specifies whether a service account should be created
create: false
# -- Annotations to add to the service account
annotations: {}
# -- The name of the service account to use.
# -- If not set and create is true, a name is generated using the fullname template
name: ""

0 comments on commit be15287

Please sign in to comment.