Keycloak

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

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

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

10
== Before you start
11

12
Make sure you have Minikube installed, ideally with the Ingress addon enabled.
13

14
To check if you have the Ingress addon enabled, enter the following command:
15

16
[source,bash,subs="attributes+"]
17
----
18
minikube addons list
19
----
20

21
If the Ingress addon is not enabled, enter the following command to enable it:
22

23
[source,bash,subs="attributes+"]
24
----
25
minikube addons enable ingress
26
----
27

28
== Start {project_name}
29

30
The {project_name} QuickStarts repository includes some example files to help deploy {project_name} to Kubernetes.
31

32
As a first step, create the {project_name} deployment and service by entering the following command:
33

34
[source,bash,subs="attributes+"]
35
----
36
kubectl create -f https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/kubernetes/keycloak.yaml
37
----
38

39
This command starts {project_name} on Kubernetes and creates an initial admin user with the username `admin` and password
40
`admin`.
41

42
=== Access {project_name} with Ingress addon enabled
43

44
Now create an Ingress for {project_name} by entering the following command:
45

46
[source,bash,subs="attributes+"]
47
----
48
wget -q -O - https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/kubernetes/keycloak-ingress.yaml | \
49
sed "s/KEYCLOAK_HOST/keycloak.$(minikube ip).nip.io/" | \
50
kubectl create -f -
51
----
52

53
If `wget` and `sed` are not available, download the file and manually edit the file replacing `KEYCLOAK_HOST`
54
with `keycloak.<minikube ip address>.nip.io`.
55

56
Enter the following command to see the {project_name} URLs:
57

58
[source,bash,subs="attributes+"]
59
----
60
KEYCLOAK_URL=https://keycloak.$(minikube ip).nip.io &&
61
echo "" &&
62
echo "{project_name}:                 $KEYCLOAK_URL" &&
63
echo "{project_name} Admin Console:   $KEYCLOAK_URL/admin" &&
64
echo "{project_name} Account Console: $KEYCLOAK_URL/realms/myrealm/account" &&
65
echo ""
66
----
67

68
=== Access {project_name} without Ingress
69

70
If the Ingress addon is not enabled, enter the following command in a separate shell:
71

72
[source,bash,subs="attributes+"]
73
----
74
minikube tunnel
75
----
76

77
You can now access {project_name} from the following URL:
78

79
[source,bash,subs="attributes+"]
80
----
81
KEYCLOAK_URL=http://$(minikube ip):$(kubectl get services/keycloak -o go-template='{{(index .spec.ports 0).nodePort}}') &&
82
echo "" &&
83
echo "{project_name}:                 $KEYCLOAK_URL" &&
84
echo "{project_name} Admin Console:   $KEYCLOAK_URL/admin" &&
85
echo "{project_name} Account Console: $KEYCLOAK_URL/realms/myrealm/account" &&
86
echo ""
87
----
88

89
Remember these URLs. You need them as you follow the instructions in this {section}. The URL for the Account Console does not work yet as you need to create the realm first.
90

91
include::templates/realm-config.adoc[]
92

93
include::templates/login-to-account.adoc[]
94

95
include::templates/first-app.adoc[]
96

97
include::templates/next.adoc[]
98

99
</@tmpl.guide>
100

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

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

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

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