All Projects → maslick → keycloak-docker

maslick / keycloak-docker

Licence: other
Docker image for Keycloak 6.0.1 (postgres, ssl) + k8s + Openshift

Programming Languages

Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to keycloak-docker

ProxyInjector
A Kubernetes controller to inject an authentication proxy container to relevant pods - [✩Star] if you're using it!
Stars: ✭ 77 (+305.26%)
Mutual labels:  keycloak, openshift
RHCA-study-notes
Red Hat Certified Architect personal study notes
Stars: ✭ 95 (+400%)
Mutual labels:  openshift
keycloak-session-restrictor
Simple event-listener for Keycloak which restricts the current user sessions to one (last one wins) only. Demo purposes only!
Stars: ✭ 48 (+152.63%)
Mutual labels:  keycloak
react-keycloak-examples
Examples for react-keycloak packages
Stars: ✭ 110 (+478.95%)
Mutual labels:  keycloak
buildah-build
GitHub Action to use 'buildah' to build a container image.
Stars: ✭ 75 (+294.74%)
Mutual labels:  openshift
argocd-operator-helm
[DEPRECATED] Argo CD Operator (Helm) installs Argo CD in OpenShift and Kubernetes.
Stars: ✭ 18 (-5.26%)
Mutual labels:  openshift
cfimagehost-on-openshift
CF Image Host on Red Hat OpenShift PAAS
Stars: ✭ 13 (-31.58%)
Mutual labels:  openshift
faas-tutorial
Java FaaS demos with OpenWhisk and OpenShift
Stars: ✭ 43 (+126.32%)
Mutual labels:  openshift
tailor
Infrastructure as Code for OpenShift
Stars: ✭ 12 (-36.84%)
Mutual labels:  openshift
gollum-galore
🍬 Gollum wiki with lots of sugar 🍬
Stars: ✭ 14 (-26.32%)
Mutual labels:  openshift
archi cloudnative
Cloud Native Architectural Models using Archi. Contains models for CAAS, Cloud Native Applications, 12/15 Factor Applications with CI/CD/CS, monitoring and log management. Infrastructure components include Red Hat OpenShift, Red Hat Storage, Red Hat Ansible Tower, Red Hat Cloudforms, Red Hat Satellite, Red Hat JBoss Middleware.
Stars: ✭ 55 (+189.47%)
Mutual labels:  openshift
arnold
👷‍♀️ Deploy your applications to Kubernetes with Ansible
Stars: ✭ 37 (+94.74%)
Mutual labels:  openshift
openshift-actions-runners
GitHub Action self-hosted runner images for OpenShift.
Stars: ✭ 27 (+42.11%)
Mutual labels:  openshift
epiphany
Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Stars: ✭ 114 (+500%)
Mutual labels:  keycloak
openshift-install
Install Openshift Docker Meetup Jakarta-Indonesia
Stars: ✭ 17 (-10.53%)
Mutual labels:  openshift
react-native-keycloak
React Native components for Keycloak
Stars: ✭ 114 (+500%)
Mutual labels:  keycloak
openshift4-vmware-upi
Ansible Playbooks and Documentation to Support the Automated Installation of OpenShift 4 on VMware
Stars: ✭ 45 (+136.84%)
Mutual labels:  openshift
keyonic-v2
A Keycloak Mobile Implementation using Angular v4 and Ionic v3
Stars: ✭ 23 (+21.05%)
Mutual labels:  keycloak
kubeseal-webgui
This is a python based webapp for using Bitnami-Sealed-Secrets in a web-ui.
Stars: ✭ 27 (+42.11%)
Mutual labels:  openshift
brauzie
Awesome CLI for fetching JWT tokens for OAuth2.0 clients
Stars: ✭ 14 (-26.32%)
Mutual labels:  keycloak

=keycloak-docker=

  • Docker image for the Keycloak auth server 6.0.1
  • Postgres support (instead of the default h2)
  • HTTPS (SSL) support, so Keycloak can be easily deployed to the cloud (EC2, Azure) or used locally

1. Prerequisites

2.1. Installation (vanilla Keycloak image)

SSL is achieved via using the reverse proxy (e.g. Nginx), but you should handle this yourself. This is recommended for production environments.

docker-compose up -d

2.2. Installation (custom image with SSL support)

./ssl.sh          // self-signed certificate
./build.sh
./compose.sh

This will:

  • Generate a self-signed ssl certificate and deploy it to the keystore (see ssl.sh and keycloak docs for more details)
  • Build the docker image
  • Run postgres and keycloak using docker-compose

3. Run

Go to this address in your browser:

https://{your_host}/auth

Default password admin:admin can be changed in docker-compose.yml: KEYCLOAK_USER, KEYCLOAK_PASSWORD

Third-party signed certificate

  1. Get certificate from www.sslforfree.com
* ca_bundle.crt (root and intermediate certificates)
* certificate.crt (public key)
* private.key (private key)
  1. Create a java keystore (jks) from files acquired in step 1
// combine letsencrypt certificate with the issued certificate
cat certificate.crt ca_bundle.crt > fullchain.pem

// convert to PKCS12 store
openssl pkcs12 -export -in fullchain.pem -inkey private.key -name auth.maslick.com -out fullchain_plus_key.p12 -password pass:secret

// convert to java keystore
keytool -importkeystore -deststorepass secret -destkeypass secret -destkeystore keycloak.jks -srckeystore fullchain_plus_key.p12 -srcstoretype PKCS12 -srcstorepass secret

Deployment to Openshift cluster

  1. Create new project:
oc new-project test
  1. Create persistent database:
oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/db-templates/postgresql-persistent-template.json \
  -p DATABASE_SERVICE_NAME=keycloak-db \
  -p POSTGRESQL_USER=keycloak \
  -p POSTGRESQL_PASSWORD=keycloak \
  -p POSTGRESQL_DATABASE=keycloakdb
  1. Create a keycloak instance:
oc new-app -f openshift-keycloak.yaml \
  -p KEYCLOAK_USER=admin \
  -p KEYCLOAK_PASSWORD=admin \
  -p NAMESPACE=test \
  -p HOSTNAME_HTTP=keycloak.maslick.com

or directly from github:

oc new-app -f https://raw.githubusercontent.com/maslick/keycloak-docker/master/openshift-keycloak.yaml \
  -p KEYCLOAK_USER=admin \
  -p KEYCLOAK_PASSWORD=admin \
  -p NAMESPACE=test \
  -p HOSTNAME_HTTP=keycloak.maslick.com

P.S. HOSTNAME_HTTP is not mandatory.

Deployment to Kubernetes cluster (GKE)

  1. Follow instructions on how to install Nginx-ingress controller and cert-manager to your GKE cluster (1-10).

  2. Create db (optional)

k create ns keycloak
helm install \
  --name keycloakdb \
  stable/postgresql \
  --set "postgresqlUsername=keycloak" \
  --set "postgresqlPassword=password" \
  --set "postgresqlDatabase=keycloakdb" \
  --namespace keycloak
  1. Deploy keycloak
k apply -f k8s-keycloak.yaml -n keycloak
k expose deployment keycloak --target-port=8080 --type=NodePort -n keycloak
k apply -f k8s-ingress.yaml -n keycloak

Deployment to k8s via helm charts

  • Install tiller:
k create serviceaccount tiller --namespace kube-system
k create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
k get pods --namespace kube-system
  • Install helm:
brew install kubernetes-helm
helm repo add codecentric https://codecentric.github.io/helm-charts
helm install --name keycloak codecentric/keycloak \
  --set keycloak.image.tag=6.0.1 \
  --set keycloak.replicas=3 \
  --set keycloak.username=admin \
  --set keycloak.password=admin \
  --set keycloak.persistence.deployPostgres=true \
  --set keycloak.persistence.dbVendor=postgres \
  --namespace keycloak
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].