File tree 12 files changed +137
-113
lines changed
12 files changed +137
-113
lines changed Original file line number Diff line number Diff line change @@ -10,30 +10,22 @@ spec:
10
10
- port : 19999
11
11
targetPort : 19999
12
12
selector :
13
- name : authsvr
13
+ app : authsvr
14
14
15
15
---
16
- apiVersion : v1
17
- kind : ReplicationController
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
18
18
metadata :
19
19
name : authsvr
20
- labels :
21
- name : authsvr
22
20
spec :
23
21
replicas : 1
24
- selector :
25
- name : authsvr
26
22
template :
27
23
metadata :
28
24
labels :
29
- name : authsvr
25
+ app : authsvr
30
26
spec :
31
27
containers :
32
- - name : authsvr
33
- image : gcr.io/guru-gce-app1/infra-auth-server
34
- env :
35
- - name : GET_HOSTS_FROM
36
- value : dns
28
+ - name : cloudsvr
29
+ image : sloppycoder/infra-auth-server
37
30
ports :
38
31
- containerPort : 19999
39
-
Original file line number Diff line number Diff line change @@ -10,38 +10,33 @@ spec:
10
10
- port : 8110
11
11
targetPort : 8110
12
12
selector :
13
- name : cardsvc
13
+ app : cardsvc
14
14
15
15
---
16
- apiVersion : v1
17
- kind : ReplicationController
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
18
18
metadata :
19
19
name : cardsvc
20
- labels :
21
- name : cardsvc
22
20
spec :
23
21
replicas : 1
24
- selector :
25
- name : cardsvc
26
22
template :
27
23
metadata :
28
24
labels :
29
- name : cardsvc
25
+ app : cardsvc
30
26
spec :
31
27
containers :
32
28
- name : cardsvc
33
- image : gcr.io/guru-gce-app1/ibank-card-service
29
+ image : sloppycoder/ibank-card-service
30
+ ports :
31
+ - containerPort : 8110
34
32
env :
35
33
- name : GET_HOSTS_FROM
36
34
value : dns
37
35
- name : SPRING_PROFILES_ACTIVE
38
- value : " h2 "
36
+ value : " mysql "
39
37
- name : CONFIG_SERVER_URL
40
38
value : " http://cloudsvr:8761"
41
39
- name : EUREKA_HOST
42
40
value : " cloudsvr"
43
41
- name : JDBC_URL
44
- value : " jdbc:mysql://dbhost/profdb"
45
- ports :
46
- - containerPort : 8110
47
-
42
+ value : " jdbc:mysql://mysql/carddb"
Original file line number Diff line number Diff line change @@ -10,31 +10,23 @@ spec:
10
10
- port : 8761
11
11
targetPort : 8761
12
12
selector :
13
- name : cloudsvr
13
+ app : cloudsvr
14
14
15
15
---
16
-
17
- apiVersion : v1
18
- kind : ReplicationController
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
19
18
metadata :
20
19
name : cloudsvr
21
- labels :
22
- name : cloudsvr
23
20
spec :
24
21
replicas : 1
25
- selector :
26
- name : cloudsvr
27
22
template :
28
23
metadata :
29
24
labels :
30
- name : cloudsvr
25
+ app : cloudsvr
31
26
spec :
32
27
containers :
33
28
- name : cloudsvr
34
- image : gcr.io/guru-gce-app1/infra-cloud-server
35
- env :
36
- - name : GET_HOSTS_FROM
37
- value : dns
29
+ image : sloppycoder/infra-cloud-server
38
30
ports :
39
31
- containerPort : 8761
40
32
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -15,30 +15,22 @@ spec:
15
15
externalIPs:
16
16
- NODE_EXTERNAL_IP
17
17
selector:
18
- name : httpd
18
+ app : httpd
19
19
20
20
---
21
- apiVersion: v1
22
- kind: ReplicationController
21
+ apiVersion: extensions/v1beta1
22
+ kind: Deployment
23
23
metadata:
24
24
name: httpd
25
- labels:
26
- name: httpd
27
25
spec:
28
26
replicas: 1
29
- selector:
30
- name: httpd
31
27
template:
32
28
metadata:
33
29
labels:
34
- name : httpd
30
+ app : httpd
35
31
spec:
36
32
containers:
37
33
- name: httpd
38
- image: gcr.io/guru-gce-app1/ibank-web
39
- env:
40
- - name: GET_HOSTS_FROM
41
- value: dns
34
+ image: sloppycoder/ibank-web
42
35
ports:
43
36
- containerPort: 8080
44
-
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : v1
3
+ kind : Service
4
+ metadata :
5
+ name : mysql
6
+ labels :
7
+ name : mysql
8
+ spec :
9
+ ports :
10
+ - port : 3306
11
+ targetPort : 3306
12
+ selector :
13
+ app : mysql
14
+
15
+ ---
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
18
+ metadata :
19
+ name : mysql
20
+ spec :
21
+ replicas : 1
22
+ template :
23
+ metadata :
24
+ labels :
25
+ app : mysql
26
+ spec :
27
+ containers :
28
+ - name : mysql
29
+ image : " mysql:5.5"
30
+ ports :
31
+ - containerPort : 3306
32
+ env :
33
+ - name : MYSQL_ROOT_PASSWORD
34
+ value : " password"
35
+
36
+
37
+ #
38
+ # to create databases for the applicaiton
39
+ #
40
+ #
41
+ # 1. start database instance
42
+ # kubectl create -f mysql.yml
43
+ #
44
+ # 2. get dokcer instance id using
45
+ # kubectl get pods
46
+ #
47
+ # 3. get into the docker instance
48
+ # docker exec -it <instance_id> /bin/bash
49
+ #
50
+ # 4. create database using the. enter 'password' when prompted
51
+ # mysql -p mysql
52
+ #
53
+ # 5. enter following SQL statements
54
+ #
55
+ # CREATE DATABASE carddb CHARACTER SET utf8 COLLATE utf8_general_ci;
56
+ # CREATE USER 'cardsvc'@'localhost' IDENTIFIED BY 'password';
57
+ # CREATE USER 'cardsvc'@'%' IDENTIFIED BY 'password';
58
+ # GRANT ALL PRIVILEGES ON carddb.* TO 'cardsvc'@'localhost';
59
+ # GRANT ALL PRIVILEGES ON carddb.* TO 'cardsvc'@'%';
60
+
61
+ # CREATE DATABASE `profdb` CHARACTER SET utf8 COLLATE utf8_general_ci;
62
+ # CREATE USER 'profsvc'@'localhost' IDENTIFIED BY 'password';
63
+ # CREATE USER 'profsvc'@'%' IDENTIFIED BY 'password';
64
+ # GRANT ALL PRIVILEGES ON profdb.* TO 'profsvc'@'localhost';
65
+ # GRANT ALL PRIVILEGES ON profdb.* TO 'profsvc'@'%';
66
+
67
+
Original file line number Diff line number Diff line change @@ -10,38 +10,33 @@ spec:
10
10
- port : 8110
11
11
targetPort : 8110
12
12
selector :
13
- name : profilesvc
13
+ app : profilesvc
14
14
15
15
---
16
- apiVersion : v1
17
- kind : ReplicationController
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
18
18
metadata :
19
19
name : profilesvc
20
- labels :
21
- name : profilesvc
22
20
spec :
23
21
replicas : 1
24
- selector :
25
- name : profilesvc
26
22
template :
27
23
metadata :
28
24
labels :
29
- name : profilesvc
25
+ app : profilesvc
30
26
spec :
31
27
containers :
32
28
- name : profilesvc
33
- image : gcr.io/guru-gce-app1/ibank-profile-service
29
+ image : sloppycoder/ibank-profile-service
30
+ ports :
31
+ - containerPort : 8110
34
32
env :
35
33
- name : GET_HOSTS_FROM
36
34
value : dns
37
35
- name : SPRING_PROFILES_ACTIVE
38
- value : " h2 "
36
+ value : " mysql "
39
37
- name : CONFIG_SERVER_URL
40
38
value : " http://cloudsvr:8761"
41
39
- name : EUREKA_HOST
42
40
value : " cloudsvr"
43
41
- name : JDBC_URL
44
- value : " jdbc:mysql://dbhost/profdb"
45
- ports :
46
- - containerPort : 8110
47
-
42
+ value : " jdbc:mysql://mysql/profdb"
Original file line number Diff line number Diff line change @@ -10,26 +10,22 @@ spec:
10
10
- port : 6379
11
11
targetPort : 6379
12
12
selector :
13
- name : redis
13
+ app : redis
14
14
15
15
---
16
- apiVersion : v1
17
- kind : ReplicationController
16
+ apiVersion : extensions/v1beta1
17
+ kind : Deployment
18
18
metadata :
19
19
name : redis
20
- labels :
21
- name : redis
22
20
spec :
23
21
replicas : 1
24
- selector :
25
- name : redis
26
22
template :
27
23
metadata :
28
24
labels :
29
- name : redis
25
+ app : redis
30
26
spec :
31
27
containers :
32
28
- name : master
33
- image : redis
29
+ image : " redis:3.0.5 "
34
30
ports :
35
31
- containerPort : 6379
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # WARNING!!
4
+ #
5
+ # this script has not been updated. it may not work any more.
6
+ #
7
+
3
8
grab_ingress_ip () {
4
9
sleep 90
5
10
NODE_EXTERNAL_IP=$( kubectl describe service httpd | grep " Ingress" | cut -d " :" -f 2 | xargs)
Original file line number Diff line number Diff line change 5
5
#
6
6
7
7
if [ " $NODE_EXTERNAL_IP " = " " ]; then
8
- NODE_EXTERNAL_IP=$( kubectl get nodes | tail -1 | cut -d " " -f 1 )
8
+ NODE_EXTERNAL_IP=$( minikube ip )
9
9
fi
10
10
11
11
echo Using external IP address =$NODE_EXTERNAL_IP =
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- kubectl stop services,rc httpd webapp profilesvc cardsvc cloudsvr authsvr redis
4
- sleep 2
3
+ kubectl delete services,deployment httpd webapp profilesvc cardsvc cloudsvr authsvr redis
5
4
kubectl get all
You can’t perform that action at this time.
0 commit comments