Skip to content

Commit

Permalink
add forward-auth helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Oct 23, 2024
1 parent 0040629 commit 6804d2c
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev/cspell/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ swapoff
swaptotal
tflint
tfstate
thomseddon
traefik
virtualenvs
vyos
Expand Down
2 changes: 2 additions & 0 deletions manifest/infrastructure/traefik/env/dev/forward-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
domains:
- drove-dev.ictsc.net
2 changes: 2 additions & 0 deletions manifest/infrastructure/traefik/env/prod/forward-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
domains:
- drove.ictsc.net
23 changes: 23 additions & 0 deletions manifest/infrastructure/traefik/forward-auth/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
8 changes: 8 additions & 0 deletions manifest/infrastructure/traefik/forward-auth/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v2
name: forward-auth
description: Traefik Forward Auth Template
type: application
version: 0.1.0
icon: https://icttoracon.net/wp-content/uploads/2023/04/favicon-75x75.png
maintainers:
- name: ictsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
issuer: http://dex.dex:5556
domains:
- drove-dev.ictsc.net
- drove.ictsc.net
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
replicas: 2
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: forward-auth
image: thomseddon/traefik-forward-auth:latest
ports:
- containerPort: 4181
args:
{{- range $i, $domain := .Values.domains }}
- --cookie-domain={{ . }}
{{- end }}
- --default-provider=dex-client
- --providers.oidc.issuer-url={{ .Values.issuer }}
- --providers.oidc.client-id=forward-auth
env:
- name: PROVIDERS_OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: client-secret
name: github-app
- name: SECRET
valueFrom:
secretKeyRef:
key: secret
name: {{ .Release.Name }}
resources:
limits:
cpu: 500m
memory: 512Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: {{ .Release.Name }}
spec:
forwardAuth:
address: http://{{ .Release.Name }}:4181
authResponseHeaders:
- X-Forwarded-User
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
type: Opaque
data:
secret: {{ randAlphaNum 32 | b64enc }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
spec:
selector:
app: {{ .Release.Name }}
ports:
- port: 4181
8 changes: 8 additions & 0 deletions manifest/infrastructure/traefik/forward-auth/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Default values for ingress.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# (required) 認証サーバのURL
issuer:
# (required) クッキーを発行したいドメインを配列で指定
domains:
14 changes: 14 additions & 0 deletions manifest/infrastructure/traefik/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,19 @@ releases:
version: 0.1.0
values:
- env/{{ .Environment.Name }}/ingress.yaml
- name: forward-auth
namespace: traefik
chart: ./forward-auth
version: 0.1.0
values:
- env/{{ .Environment.Name }}/forward-auth.yaml
- issuer: http://dex.dex:5556
- name: forward-auth-admin
namespace: traefik
chart: ./forward-auth
version: 0.1.0
values:
- env/{{ .Environment.Name }}/forward-auth.yaml
- issuer: http://dex-admin.dex:5556
- name: local-charts
chart: ./local

0 comments on commit 6804d2c

Please sign in to comment.