-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathÜbungen_Teil_II.txt
More file actions
59 lines (48 loc) · 2.21 KB
/
Übungen_Teil_II.txt
File metadata and controls
59 lines (48 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
+===============================================================================
+ Übungen Einführung OpenShift Teil II
+
+ T-Systems
+ PaaS Training
+ Einführung in OpenShift
+
+===============================================================================
4 - Datenbank Pod hinzufügen
============================
a - DB Pod hinzufügen
=====================
In der GUI aus dem "Catalog" das Image "Postgresql Persistant" auswählen.
-> Add to Project
Search "Postgresql"
DBStorage -> Postgresql Persistant
Folgende Werte sind einzugeben:
Field Name | What to enter | Description
-----------------------------+----------------+----------------------------------------------------------------------
Memory limit | 512Mi | Since this is a small database, we only need 512 megabytes of memory.
Database service name | postgresql | The name of the resulting OpenShift service.
PostgreSQL user | insult | The username that has permission to use the database.
PostgreSQL password | insult | The password for the user.
PostgreSQL database name | insultdb | The name of the initial database that will be created.
Volume Capacity | 1Gi |
b - Setzen der Environment Variablen in der "Insults"-JAVA Instanz
==================================================================
> oc env dc insults -e POSTGRESQL_USER=insult -e PGPASSWORD=insult -e POSTGRESQL_DATABASE=insultdb (deploymentconfig)
c - Create Schema & Entries (Antipattern!!!!)
=============================================
> oc get pods
> oc rsh <postgresql pod name aus obigen command>
- cd /tmp
- curl https://raw.githubusercontent.com/thomaswetzler/insults-app/master/insults.sql > insults.sql
- psql -h $POSTGRESQL_SERVICE_HOST -p $POSTGRESQL_SERVICE_PORT -U $POSTGRESQL_USER $POSTGRESQL_DATABASE < insults.sql
- psql insultdb
- \dt
- select * from noun;
- \q
d - Änderung am Coding der Web Applikation
==========================================
Trainer wird neuen Branch im Git erstellen...
e - Redeploy der "Insults"-JAVA Instanz
=======================================
> oc start-build insults
f - Test Application
====================
Webbrowser Internet