-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
kind: Template | ||
apiVersion: template.openshift.io/v1 | ||
metadata: | ||
name: keycloak | ||
namespace: openshift-config | ||
annotations: | ||
description: An example Keycloak server with HTTPS | ||
iconClass: icon-sso | ||
openshift.io/display-name: Keycloak | ||
tags: keycloak | ||
version: 9.0.4-SNAPSHOT | ||
objects: | ||
- apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
description: The web server's https port. | ||
labels: | ||
application: '${APPLICATION_NAME}' | ||
name: '${APPLICATION_NAME}' | ||
spec: | ||
ports: | ||
- port: 8443 | ||
targetPort: 8443 | ||
selector: | ||
deploymentConfig: '${APPLICATION_NAME}' | ||
- apiVersion: v1 | ||
id: '${APPLICATION_NAME}' | ||
kind: Route | ||
metadata: | ||
annotations: | ||
description: Route for application's https service. | ||
labels: | ||
application: '${APPLICATION_NAME}' | ||
name: '${APPLICATION_NAME}' | ||
spec: | ||
host: '${HOSTNAME_HTTPS}' | ||
tls: | ||
termination: passthrough | ||
to: | ||
name: '${APPLICATION_NAME}' | ||
- apiVersion: v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
labels: | ||
application: '${APPLICATION_NAME}' | ||
name: '${APPLICATION_NAME}' | ||
spec: | ||
replicas: 1 | ||
selector: | ||
deploymentConfig: '${APPLICATION_NAME}' | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
application: '${APPLICATION_NAME}' | ||
deploymentConfig: '${APPLICATION_NAME}' | ||
name: '${APPLICATION_NAME}' | ||
spec: | ||
containers: | ||
- env: | ||
- name: KEYCLOAK_USER | ||
value: '${KEYCLOAK_USER}' | ||
- name: KEYCLOAK_PASSWORD | ||
value: '${KEYCLOAK_PASSWORD}' | ||
- name: DB_VENDOR | ||
value: '${DB_VENDOR}' | ||
- name: JGROUPS_DISCOVERY_PROTOCOL | ||
value: dns.DNS_PING | ||
- name: JGROUPS_DISCOVERY_PROPERTIES | ||
value: 'dns_query=${APPLICATION_NAME}.${NAMESPACE}.svc.cluster.local' | ||
image: 'quay.io/keycloak/keycloak:latest' | ||
livenessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /auth/realms/master | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 60 | ||
name: '${APPLICATION_NAME}' | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
- containerPort: 8443 | ||
name: https | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 10 | ||
httpGet: | ||
path: /auth/realms/master | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 30 | ||
securityContext: | ||
privileged: false | ||
triggers: | ||
- type: ConfigChange | ||
parameters: | ||
- name: APPLICATION_NAME | ||
displayName: Application Name | ||
description: The name for the application. | ||
value: keycloak | ||
required: true | ||
- name: KEYCLOAK_USER | ||
displayName: Keycloak Administrator Username | ||
description: Keycloak Server administrator username | ||
generate: expression | ||
from: '[a-zA-Z0-9]{8}' | ||
required: true | ||
- name: KEYCLOAK_PASSWORD | ||
displayName: Keycloak Administrator Password | ||
description: Keycloak Server administrator password | ||
generate: expression | ||
from: '[a-zA-Z0-9]{8}' | ||
required: true | ||
- name: DB_VENDOR | ||
displayName: DB Vendor | ||
description: 'DB vendor (H2, POSTGRES, MYSQL or MARIADB)' | ||
value: H2 | ||
required: true | ||
- name: HOSTNAME_HTTPS | ||
displayName: Custom https Route Hostname | ||
description: >- | ||
Custom hostname for https service route. Leave blank for default hostname, | ||
e.g.: <application-name>-<namespace>.<default-domain-suffix> | ||
- name: NAMESPACE | ||
displayName: Namespace used for DNS discovery | ||
description: >- | ||
This namespace is a part of DNS query sent to Kubernetes API. This query | ||
allows the DNS_PING protocol to extract cluster members. This parameter | ||
might be removed once https://issues.jboss.org/browse/JGRP-2292 is | ||
implemented. | ||
required: true |