Keycloak

Форк
0
/
getting-started-openshift.adoc 
111 строк · 3.0 Кб
1
<#import "/templates/guide.adoc" as tmpl>
2

3
<@tmpl.guide
4
title="OpenShift"
5
summary="Get started with {project_name} on OpenShift">
6

7
:links-admin-console: {project_name} Admin Console
8
:links-account-console: {project_name} Account Console
9

10
== Before you start
11

12
. Install https://code-ready.github.io/crc/[Red Hat Code Ready Containers] and follow the steps in the documentation to install a 
13
local OpenShift cluster.
14

15
. Make sure the cluster is functional by entering the following command:
16
+
17
[source,bash,subs="attributes+"]
18
----
19
crc status
20
----
21

22
. Look for output similar to the following to confirm the cluster is working.
23
+
24
[source,subs="attributes+"]
25
----
26
CRC VM:          Running
27
OpenShift:       Running
28
...
29
----
30

31
. Log in as the user `developer`:
32
+
33
[source,bash,subs="attributes+"]
34
----
35
oc login -u developer -p developer
36
----
37

38
. Create a project called `keycloak` by entering the following command:
39
+
40
[source,bash,subs="attributes+"]
41
----
42
oc new-project keycloak
43
----
44

45
== Start {project_name}
46

47
. To start a {project_name} server in your project, enter the following command:
48
+
49
[source,bash,subs="attributes+"]
50
----
51
oc process -f https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/openshift/keycloak.yaml \
52
    -p KEYCLOAK_ADMIN=admin \
53
    -p KEYCLOAK_ADMIN_PASSWORD=admin \
54
    -p NAMESPACE=keycloak \
55
| oc create -f -
56
----
57
+
58
In this example, the user name and password are `admin`.
59

60
. Once the command above completes, look for a message similar to this:
61
+
62
[source,bash,subs="attributes+"]
63
----
64
service/keycloak created
65
route.route.openshift.io/keycloak created
66
deploymentconfig.apps.openshift.io/keycloak created.
67
----
68
+
69
At this point, OpenShift will provision a {project_name} pod and related resources. As part of the process, OpenShift will
70
try to pull the {project_name} server image. This operation might take some time depending on your network connection.
71

72
. To make sure {project_name} is provisioned, execute the following command:
73
+
74
[source,bash,subs="attributes+"]
75
----
76
oc get pods
77
----
78

79
. After a while, look for a message similar to the following; it indicates the pod is ready:
80
+
81
[source,bash,subs="attributes+"]
82
----
83
NAME                READY     STATUS      RESTARTS   AGE
84
keycloak-1-deploy   0/1       Completed   0          1h
85
keycloak-1-l9kdx    1/1       Running     0          1h
86
----
87

88
. Once the server is provisioned, enter the following command to find out the {project_name} URLs:
89
+
90
[source,bash,subs="attributes+"]
91
----
92
KEYCLOAK_URL=https://$(oc get route keycloak --template='{{ .spec.host }}') &&
93
echo "" &&
94
echo "{project_name}:                 $KEYCLOAK_URL" &&
95
echo "{project_name} Admin Console:   $KEYCLOAK_URL/admin" &&
96
echo "{project_name} Account Console: $KEYCLOAK_URL/realms/myrealm/account" &&
97
echo ""
98
----
99

100
Remember these URLs as you will need them throughout this {section}. The URL for the account console won't work
101
right now as you will need to create the realm first.
102

103
include::templates/realm-config.adoc[]
104

105
include::templates/login-to-account.adoc[]
106

107
include::templates/first-app.adoc[]
108

109
include::templates/next.adoc[]
110

111
</@tmpl.guide>
112

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.