Giter VIP home page Giter VIP logo

keycloak-deployment-to-gcp's Introduction

Keycloak deployment to GCP

Official docs provide a way to deploy Keycloak to local minikube cluster. This however doesn't allow to test integration with 3rd-party services, as the URLs are not publicly resolvable. This is the MVP version of the Keycloak deployment ready for testing any integrations.

Prerequisites:

Once deployed, it can be accessed via https://<your-domain>/ (login:admin, password: admin)

  1. Create environment variables
export PROJECT=your-project  # Your Google Cloud project ID.
export REGION=europe-west1-b   # Your Google Cloud region.
export CLUSTER=keycloak
export [email protected]
export DOMAIN_NAME=your-domain.com
  1. Create cluster
gcloud container clusters create $CLUSTER --zone $REGION --preemptible --num-nodes=1
  1. Create Keycloak service and deployment
kubectl apply -f keycloak.yaml
  1. Create a static external IP address
gcloud compute addresses create ip-keycloak --global

You should see the new IP address listed:

gcloud compute addresses list
  1. Point your domain to the static external IP

In your domain DNS records create a new A record (without a name) pointing to the static external IP and wait for the changes to propagate

  1. Create secret
kubectl apply -f secret.yaml
  1. Install cert-manager and create an issuer for Let's Encrypt staging
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.2/cert-manager.yaml
kubectl apply -f issuer-letsencrypt-staging.yaml
  1. Create an Ingress

Edit keycloak-ingress.yaml

 spec:
   tls:
     hosts:
-      - your-domain.com
+      - your-real-domain.com

Then:

kubectl apply -f keycloak-ingress.yaml

Check progress with:

kubectl describe ingress keycloak

You may verify if all is set up correctly with:

curl -v --insecure https://$DOMAIN_NAME
  1. Cleanup
gcloud container clusters delete $CLUSTER --zone $REGION
gcloud compute addresses delete ip-keycloak --global

keycloak-deployment-to-gcp's People

Contributors

kark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.