阅读背景:

如何将keycloak部署到cloudfoundry

来源:互联网 

As the title, is there any guide to deploy keycloak to cloud foundry?

作为标题,是否有任何指南将密钥泄露部署到云代工厂?

Seems like cloudfoundry is only friendly to spring boot applications.

看起来像cloudfoundry只对弹簧启动应用程序很友好。

2 个解决方案

#1


1  

In my experience the easiest solution is to wrap Keycloak in a Spring-Boot application (together with the required JBoss parts) and deploy that. This allows you to create a single jar and push that to Cloud Foundry with the standard Java build pack.

根据我的经验,最简单的解决方案是将Keycloak包装在Spring-Boot应用程序中(连同所需的JBoss部件)并进行部署。这允许您创建一个jar并使用标准Java构建包将其推送到Cloud Foundry。

This is exactly what someone has done in this Github project. The project injects a basic configuration for Keycloak with the default H2 database. All you need to do is clone the project, run mvn package and push the resulting jar to CF.

这正是某人在这个Github项目中所做的。该项目使用默认的H2数据库为Keycloak注入基本配置。您需要做的就是克隆项目,运行mvn包并将生成的jar推送到CF.

#2


1  

Try to cf push the docker image using manifest.yml like this (Postgres DB example):

尝试cf使用manifest.yml这样推送docker镜像(Postgres DB示例):

---
applications:
- name: sso
  docker:
    image: jboss/keycloak
  instances: 1
  memory: 768M
  disk_quota: 128M
  env: 
    PROXY_ADDRESS_FORWARDING: true
    POSTGRES_ADDR: 192.168.1.23
    POSTGRES_PORT: 5432
    POSTGRES_DATABASE: keycloakdb
    POSTGRES_USER: keycloak
    POSTGRES_PASSWORD: a-lot-of-asterisks

You can do it also with the following commands without a manifest file:

您也可以使用以下命令执行此操作而不使用清单文件:

$ cf push sso --docker-image jboss/keycloak -i 1 -m 768M -k 128M --no-start

$ cf set-env sso PROXY_ADDRESS_FORWARDING true
$ cf set-env sso POSTGRES_ADDR 192.168.1.23 
$ cf set-env sso POSTGRES_PORT 5432 
$ cf set-env sso POSTGRES_DATABASE keycloakdb 
$ cf set-env sso POSTGRES_USER keycloak 
$ cf set-env sso POSTGRES_PASSWORD a-lot-of-asterisks

$ cf env sso
$ cf start sso

$ cf logs sso --recent

References


Do you consider using Cloud Foundry's UAA?

您是否考虑使用Cloud Foundry的UAA?

CF UAA is the central identity management service for both users and applications, that supports: federated login, LDAP, SAML, SSO and multifactor authentication.

CF UAA是用户和应用程序的中央身份管理服务,支持:联合登录,LDAP,SAML,SSO和多因素身份验证。


分享到: