add keycloak

This commit is contained in:
Mans Ziesel 2024-10-26 17:05:14 +02:00
parent 46055e816a
commit f108d55965
8 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argo-app-keycloak
namespace: argocd
spec:
destination:
name: ''
namespace: default
server: https://kubernetes.default.svc
source:
path: keycloak
repoURL: https://git.mziesel.nl/mans/argocd-test
targetRevision: HEAD
sources: []
project: default
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -15,3 +15,4 @@ resources:
- ./base/librespeed-application.yaml
- ./base/nfs-subdir-external-provisioner-application.yaml
- ./base/cloudnative-pg-application.yaml
- ./base/keycloak-application.yaml

View File

@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak
namespace: keycloak
spec:
replicas: 1
selector:
matchLabels:
app: keycloak
template:
metadata:
labels:
app: keycloak
spec:
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:26.0.2
args: ["start"]
env:
- name: KEYCLOAK_ADMIN
value: "admin"
- name: KEYCLOAK_ADMIN_PASSWORD
value: "admin"
- name: KC_PROXY
value: "edge"
- name: KC_DB
value: "postgres"
- name: KC_DB_URL_HOST
valueFrom:
secretKeyRef:
name: keycloak-pg-cluster-app
key: host
- name: KC_DB_URL_PORT
valueFrom:
secretKeyRef:
name: keycloak-pg-cluster-app
key: port
- name: KC_DB_URL_DATABASE
valueFrom:
secretKeyRef:
name: keycloak-pg-cluster-app
key: dbname
- name: KC_DB_USERNAME
valueFrom:
secretKeyRef:
name: keycloak-pg-cluster-app
key: user
- name: KC_DB_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-pg-cluster-app
key: password
- name: KC_PROXY_HEADERS
value: "xforwarded"
- name: KC_HOSTNAME
value: "keycloak.mziesel.nl"
ports:
- name: web
containerPort: 8080
readinessProbe:
httpGet:
path: /realms/master
port: 8080

View File

@ -0,0 +1,12 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: keycloak-ingressroute
spec:
routes:
- match: Host(`keycloak.mziesel.nl`)
kind: Rule
services:
- name: keycloak
port: web
tls: {}

View File

@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: keycloak
labels:
pod-security.kubernetes.io/enforce: privileged

View File

@ -0,0 +1,15 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: keycloak-pg-cluster
spec:
instances: 3
imageCatalogRef:
apiGroup: postgresql.cnpg.io
kind: ClusterImageCatalog
name: postgresql
major: 17
storage:
size: 10Gi
storageClass: nfs-client

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: keycloak
spec:
ports:
- name: web
port: 80
targetPort: web
selector:
app: keycloak

View File

@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: keycloak
resources:
- ./base/keycloak-namespace.yaml
- ./base/keycloak-pg-cluster.yaml
# - https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/kubernetes/keycloak.yaml
- ./base/keycloak-deployment.yaml
- ./base/keycloak-svc.yaml
- ./base/keycloak-ingress.yaml