Skip to content

Commit 931c86f

Browse files
committed
update configs for app1
1 parent 0d9320b commit 931c86f

21 files changed

+67
-102
lines changed

04_Orchestrating_Collections_of_Services_with_Kubernetes.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -34,76 +34,6 @@
3434

3535
<br/>
3636

37-
### Skaffold installation
38-
39-
$ curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
40-
41-
$ chmod +x skaffold
42-
$ sudo mv skaffold /usr/local/bin
43-
44-
<br/>
45-
46-
### Start minikube
47-
48-
```
49-
$ {
50-
minikube --profile my-profile config set memory 8192
51-
minikube --profile my-profile config set cpus 4
52-
53-
// minikube --profile my-profile config set vm-driver virtualbox
54-
minikube --profile my-profile config set vm-driver docker
55-
56-
minikube --profile my-profile config set kubernetes-version v1.18.2
57-
minikube start --profile my-profile
58-
}
59-
```
60-
61-
<br/>
62-
63-
// Enable ingress
64-
$ minikube addons --profile my-profile enable ingress
65-
66-
<br/>
67-
68-
// Delete
69-
// $ minikube --profile my-profile stop && minikube --profile my-profile delete
70-
71-
<br/>
72-
73-
$ minikube --profile my-profile ip
74-
172.17.0.2
75-
76-
<br/>
77-
78-
$ sudo vi /etc/hosts
79-
80-
```
81-
#---------------------------------------------------------------------
82-
# Minikube
83-
#---------------------------------------------------------------------
84-
172.17.0.2 posts.com
85-
```
86-
87-
<br/>
88-
89-
$ cd skaffold
90-
91-
$ docker login
92-
$ docker info | sed '/Username:/!d;s/.* //'
93-
94-
$ skaffold dev
95-
96-
<br/>
97-
98-
browser --> posts.com
99-
100-
<!--
101-
$ kubectl rollout restart deployment [depl_name]
102-
$ kubectl get events --sort-by=.metadata.creationTimestamp
103-
--->
104-
105-
<br/>
106-
10737
---
10838

10939
<br/>

04_Orchestrating_Collections_of_Services_with_Kubernetes/app/comments/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ app.post('/posts/:id/comments', async (req, res) => {
2828

2929
commentsByPostId[req.params.id] = comments;
3030

31-
await axios.post('http://event-bus-srv:4005/events', {
31+
await axios.post('http://event-bus-svc:4005/events', {
3232
type: 'CommentCreated',
3333
data: {
3434
id: commentId,
@@ -56,7 +56,7 @@ app.post('/events', async (req, res) => {
5656

5757
comment.status = status;
5858

59-
await axios.post('http://event-bus-srv:4005/events', {
59+
await axios.post('http://event-bus-svc:4005/events', {
6060
type: 'CommentUpdated',
6161
data: {
6262
id,

04_Orchestrating_Collections_of_Services_with_Kubernetes/app/event-bus/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ app.post('/events', (req, res) => {
1212

1313
events.push(event);
1414

15-
axios.post('http://posts-srv:4000/events', event);
16-
axios.post('http://comments-srv:4001/events', event);
17-
axios.post('http://query-srv:4002/events', event);
18-
axios.post('http://moderation-srv:4003/events', event);
15+
axios.post('http://posts-svc:4000/events', event);
16+
axios.post('http://comments-svc:4001/events', event);
17+
axios.post('http://query-svc:4002/events', event);
18+
axios.post('http://moderation-svc:4003/events', event);
1919

2020
return res.send({ status: 'OK' });
2121
});

04_Orchestrating_Collections_of_Services_with_Kubernetes/app/moderation/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ app.post('/events', async (req, res) => {
1111
if (type === 'CommentCreated') {
1212
const status = data.content.includes('orange') ? 'rejected' : 'approved';
1313

14-
await axios.post('http://event-bus-srv:4005/events', {
14+
await axios.post('http://event-bus-svc:4005/events', {
1515
type: 'CommentModerated',
1616
data: {
1717
id: data.id,

04_Orchestrating_Collections_of_Services_with_Kubernetes/app/posts/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ app.post('/posts/create', async (req, res) => {
2323
title,
2424
};
2525

26-
await axios.post('http://event-bus-srv:4005/events', {
26+
await axios.post('http://event-bus-svc:4005/events', {
2727
type: 'PostCreated',
2828
data: {
2929
id,

04_Orchestrating_Collections_of_Services_with_Kubernetes/app/query/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ app.post('/events', (req, res) => {
5252
app.listen(4002, async () => {
5353
console.log('Listening on 4002');
5454

55-
const res = await axios.get('http://event-bus-srv:4005/events');
55+
const res = await axios.get('http://event-bus-svc:4005/events');
5656

5757
for (let event of res.data) {
5858
console.log('Processing event:', event.type);

04_Orchestrating_Collections_of_Services_with_Kubernetes/k8s/client-depl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ spec:
1414
spec:
1515
containers:
1616
- name: client
17-
image: webmakaka/grider-ms-client
17+
image: webmakaka/grider-ms-app1-client

04_Orchestrating_Collections_of_Services_with_Kubernetes/k8s/client-srv-ClusterIP.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: client-srv
4+
name: client-svc
55
spec:
66
selector:
77
app: client

04_Orchestrating_Collections_of_Services_with_Kubernetes/k8s/comments-depl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ spec:
1414
spec:
1515
containers:
1616
- name: comments
17-
image: webmakaka/grider-ms-comments
17+
image: webmakaka/grider-ms-app1-comments

04_Orchestrating_Collections_of_Services_with_Kubernetes/k8s/comments-srv-ClusterIP.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: comments-srv
4+
name: comments-svc
55
spec:
66
selector:
77
app: comments

0 commit comments

Comments
 (0)