Skip to content

Commit

Permalink
feat: add keycloak for SSO
Browse files Browse the repository at this point in the history
Refs: #13
Signed-off-by: Wim de Groot <[email protected]>
  • Loading branch information
wim-de-groot committed Nov 10, 2024
1 parent 19e0f38 commit 379049a
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
6 changes: 6 additions & 0 deletions apps/authorization/keycloak/templates/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ spec:
issuerRef:
name: cloudflare
kind: ClusterIssuer
secretTemplate:
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: "home-automation"
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
reflector.v1.k8s.emberstack.com/reflection-auto-namespaces: "home-automation"
3 changes: 3 additions & 0 deletions apps/cert-manager/cert-manager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ dependencies:
- name: cert-manager
version: v1.9.1
repository: https://charts.jetstack.io
- name: reflector
version: 7.1.288
repository: https://emberstack.github.io/helm-charts
7 changes: 7 additions & 0 deletions apps/crossplane/crossplane/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: crossplane
version: 1.0.0
dependencies:
- name: crossplane
version: 1.18.0
repository: https://charts.crossplane.io/stable
10 changes: 7 additions & 3 deletions apps/home-automation/mealie/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ metadata:
app.kubernetes.io/instance: home-automation-mealie
app.kubernetes.io/name: mealie
data:
ALLOW_SIGNUP: 'false'
BASE_URL: 'http://mealie.homelab.com'
OIDC_AUTH_ENABLED: 'true'
OIDC_AUTO_REDIRECT: 'false'
OIDC_PROVIDER_NAME: 'SSO'
BASE_URL: 'https://mealie.wimandnaomishome.com:443'
OIDC_CONFIGURATION_URL: 'https://authorization-keycloak.authorization.svc.cluster.local/realms/master/.well-known/openid-configuration'
DEFAULT_GROUP: Home
MAX_WORKERS: '1'
PGID: '1000'
PUID: '1000'
TZ: Europe/Amsterdam
WEB_CONCURRENCY: '1'
WEB_CONCURRENCY: '1'
LOG_LEVEL: debug
25 changes: 24 additions & 1 deletion apps/home-automation/mealie/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ metadata:
app.kubernetes.io/instance: home-automation-mealie
app.kubernetes.io/name: mealie
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 10
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
app.kubernetes.io/instance: home-automation-mealie
Expand All @@ -20,7 +26,7 @@ spec:
spec:
containers:
- name: mealie
image: docker.io/wimdegroot/mealie:test-v3
image: docker.io/wimdegroot/mealie:test-v5
env:
- name: DB_ENGINE
value: postgres
Expand All @@ -43,10 +49,22 @@ spec:
secretKeyRef:
name: mealie-app
key: dbname
- name: OIDC_CLIENT_ID
valueFrom:
secretKeyRef:
name: mealie
key: OIDC_CLIENT_ID
- name: OIDC_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: mealie
key: OIDC_CLIENT_SECRET
- name: TLS_CERTIFICATE_PATH
value: /etc/tls/tls.crt
- name: TLS_PRIVATE_KEY_PATH
value: /etc/tls/tls.key
- name: OIDC_TLS_CACERTFILE
value: /etc/trust/tls.crt
envFrom:
- configMapRef:
name: mealie
Expand All @@ -66,6 +84,8 @@ spec:
name: mealie-data
- mountPath: /etc/tls
name: mealie-tls
- mountPath: /etc/trust
name: keycloak-tls
imagePullPolicy: IfNotPresent
startupProbe:
httpGet:
Expand Down Expand Up @@ -95,3 +115,6 @@ spec:
- name: mealie-tls
secret:
secretName: mealie-tls
- name: keycloak-tls
secret:
secretName: keycloak-tls
14 changes: 14 additions & 0 deletions apps/home-automation/mealie/sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: mealie
namespace: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P9f1UXMF/9xioFbe8Z/PAK+iGln5Oe718TRJQ2u607kRdjIstHgpZwmPSvf5VxmACSQs7DvwZia6gGDYsqSpxXHmlEWEEROeYtNMfWi7DHWPzEuEQ1MluVyVoTpxhfWSVIjbU2ehvjDfRfSGtuZTv65lc3LOlpME9zMDXAxxXwMQiW048GZKuRqEKYNsEiG75moXiKItwFfGYazivKIA2vPdheGP8AC9bYUVnFTCOiI8vISmdwYm62qqhFA0WISe453LQ4I84oahHqUc/KbvKDqIJOZI1wVoBMuuh87NLeTVcgN0J3qDBJ6+QAnSNrdMN8070Y0HpHQ8uKFgr32c32+0Bfwn6UhaO+UCPXmxGuuZbkSxlNc9Y6PTcpK3eDWV2dHFbzQfmDQz3L2rNOwcXbLa9gmeDku+fyDTIgUczngqA==
template:
metadata:
name: mealie
namespace: home-automation
type: Opaque

0 comments on commit 379049a

Please sign in to comment.