Skip to content

Add support for Keycloak deployment to ACA #8478

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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 @@ -14,6 +14,9 @@ public static class KeycloakResourceBuilderExtensions
private const string AdminEnvVarName = "KC_BOOTSTRAP_ADMIN_USERNAME";
private const string AdminPasswordEnvVarName = "KC_BOOTSTRAP_ADMIN_PASSWORD";
private const string HealthCheckEnvVarName = "KC_HEALTH_ENABLED"; // As per https://www.keycloak.org/observability/health
private const string HttpEnabledEnvVarName = "KC_HTTP_ENABLED";
private const string ProxyHeadersEnvVarName = "KC_PROXY_HEADERS";
private const string HostNameStrictEnvVarName = "KC_HOSTNAME_STRICT";

private const int DefaultContainerPort = 8080;
private const int ManagementInterfaceContainerPort = 9000; // As per https://www.keycloak.org/server/management-interface
Expand Down Expand Up @@ -69,6 +72,9 @@ public static IResourceBuilder<KeycloakResource> AddKeycloak(
context.EnvironmentVariables[AdminEnvVarName] = resource.AdminReference;
context.EnvironmentVariables[AdminPasswordEnvVarName] = resource.AdminPasswordParameter;
context.EnvironmentVariables[HealthCheckEnvVarName] = "true";
context.EnvironmentVariables[HttpEnabledEnvVarName] = "true";
context.EnvironmentVariables[ProxyHeadersEnvVarName] = "xforwarded";
context.EnvironmentVariables[HostNameStrictEnvVarName] = "false";
})
.WithUrlForEndpoint(ManagementEndpointName, u => u.DisplayLocation = UrlDisplayLocation.DetailsOnly);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ public async Task VerifyManifest()
"env": {
"KC_BOOTSTRAP_ADMIN_USERNAME": "admin",
"KC_BOOTSTRAP_ADMIN_PASSWORD": "{keycloak-password.value}",
"KC_HEALTH_ENABLED": "true"
"KC_HEALTH_ENABLED": "true",
"KC_HTTP_ENABLED": "true",
"KC_PROXY_HEADERS": "xforwarded",
"KC_HOSTNAME_STRICT": "false"
},
"bindings": {
"http": {
Expand Down