如何使用keycloak构建kubernetes配置

时间:2019-07-06 07:40:38

标签: jhipster

我有一个jhipster微服务应用程序,当我为kubernetes生成配置时会使用keycloak,而keycloak配置忽略并且keycloak无法启动,并且应用程序对auth出错我该如何解决呢? 我的配置与docker-compose一起使用,并且一切正常 app.yml配置为:

    version: '2'
services:
  cpmgateway-app:
    image: gateway
    environment:
      - _JAVA_OPTIONS=-Xmx512m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod,swagger
      - MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
      - EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka
      - SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config
      - SPRING_DATASOURCE_URL=jdbc:mariadb://cpm-mariadb:3306/gateway
      - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://keycloak:9080/auth/realms/jhipster
      - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=web_app
      - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app
      - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
      - SPRING_DATA_JEST_URI=http://elasticsearch:9200
      - SPRING_ELASTICSEARCH_REST_URIS=http://elasticsearch:9200
    ports:
      - 8080:8080
  mariadb:
    extends:
      file: mariadb.yml
      service: cpm-mariadb
  #  keycloak-mariadb:
  #    extends:
  #      file: mariadb.yml
  #      service: keycloak-mariadb
  keycloak:
    extends:
      file: keycloak.yml
      service: keycloak
  elasticsearch:
    extends:
      file: elasticsearch.yml
      service: cpm-elasticsearch
  jhipster-registry:
    extends:
      file: jhipster-registry.yml
      service: jhipster-registry
    environment:
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/docker-config/

0 个答案:

没有答案