Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keycloak] Rename environment variables. #13791

Merged
merged 3 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ spec:
value: postgres
containers:
- env:
- name: POSTGRES_PORT_5432_TCP_ADDR
- name: DB_VENDOR
value: POSTGRES
- name: DB_ADDR
value: postgres
- name: POSTGRES_PORT_5432_TCP_PORT
- name: DB_PORT
value: "5432"
- name: POSTGRES_DATABASE
- name: DB_DATABASE
value: keycloak
- name: POSTGRES_USER
- name: DB_USER
value: keycloak
- name: POSTGRES_PASSWORD
- name: DB_PASSWORD
value: keycloak
- name: KEYCLOAK_USER
value: admin
Expand Down
12 changes: 7 additions & 5 deletions deploy/openshift/templates/multi/keycloak-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ objects:
fieldPath: metadata.namespace
- name: PROXY_ADDRESS_FORWARDING
value: "true"
- name: POSTGRES_PORT_5432_TCP_ADDR
- name: DB_VENDOR
value: POSTGRES
- name: DB_ADDR
value: postgres
- name: POSTGRES_PORT_5432_TCP_PORT
- name: DB_PORT
value: "5432"
- name: POSTGRES_DATABASE
- name: DB_DATABASE
value: keycloak
- name: POSTGRES_USER
- name: DB_USER
value: keycloak
- name: POSTGRES_PASSWORD
- name: DB_PASSWORD
value: keycloak
- name: KEYCLOAK_USER
value: "${KEYCLOAK_USER}"
Expand Down
14 changes: 9 additions & 5 deletions dockerfiles/keycloak/kc_realm_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ if [ "${CHE_SELF__SIGNED__CERT}" != "" ]; then
/opt/jboss/keycloak/bin/jboss-cli.sh --file=/scripts/cli/add_openshift_certificate.cli && rm -rf /opt/jboss/keycloak/standalone/configuration/standalone_xml_history
fi

# POSTGRES_PORT is assigned by Kubernetes controller
# and it isn't fit to docker-entrypoin.sh.
unset POSTGRES_PORT

echo "Starting Keycloak server..."

/opt/jboss/keycloak/bin/standalone.sh -Dkeycloak.migration.action=import \
-Dkeycloak.migration.provider=dir \
-Dkeycloak.migration.strategy=IGNORE_EXISTING \
-Dkeycloak.migration.dir=/scripts/ \
-Djboss.bind.address=0.0.0.0
exec /opt/jboss/docker-entrypoint.sh -Dkeycloak.migration.action=import \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the change of script here? what does docker-entrypoint.sh do that standalone.sh doesn't? (Also, aside, "container-entrypoint" would be better. :) )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read docker-entrypoint.sh that stored in the base image.
Some important environment variables are parsed in there. standalone.sh is called by docker-entrypoint.sh after parsing.

It's best to ask maintainers of the jboss-dockerfiles organization (not me) if you don't like the name docker-entrypoint.sh.

-Dkeycloak.migration.provider=dir \
-Dkeycloak.migration.strategy=IGNORE_EXISTING \
-Dkeycloak.migration.dir=/scripts/ \
-Djboss.bind.address=0.0.0.0