Skip to content

Commit

Permalink
case #19
Browse files Browse the repository at this point in the history
  • Loading branch information
DickChesterwood committed May 24, 2018
1 parent efeb6ac commit 519a839
Show file tree
Hide file tree
Showing 15 changed files with 359 additions and 17 deletions.
4 changes: 2 additions & 2 deletions k8s-fleetman-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

<configuration>
<!-- <dockerHost>unix:///var/run/docker.sock</dockerHost> -->
<dockerHost>tcp://192.168.99.101:2376</dockerHost>
<dockerHost>tcp://192.168.99.100:2376</dockerHost>
<certPath>C:\Users\Richard\.docker\machine\machines\default</certPath>

<verbose>true</verbose>
Expand All @@ -94,7 +94,7 @@
<descriptorRef>artifact</descriptorRef>
</assembly>
<tags>
<tag>release1</tag>
<tag>release2</tag>
</tags>
</build>
</image>
Expand Down
2 changes: 1 addition & 1 deletion k8s-fleetman-position-simulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<descriptorRef>artifact</descriptorRef>
</assembly>
<tags>
<tag>release1</tag>
<tag>release2</tag>
</tags>
</build>
</image>
Expand Down
4 changes: 2 additions & 2 deletions k8s-fleetman-position-tracker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<version>0.21.0</version>

<configuration>
<dockerHost>tcp://192.168.99.101:2376</dockerHost>
<dockerHost>tcp://192.168.99.100:2376</dockerHost>
<certPath>C:\Users\Richard\.docker\machine\machines\default</certPath>

<verbose>true</verbose>
Expand All @@ -75,7 +75,7 @@
<descriptorRef>artifact</descriptorRef>
</assembly>
<tags>
<tag>release2beta</tag>
<tag>release2</tag>
</tags>
</build>
</image>
Expand Down
5 changes: 2 additions & 3 deletions k8s-fleetman-webapp-angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { DOCUMENT } from '@angular/platform-browser';

const stompConfig: StompConfig = {
// url: "ws://" + window.location.hostname + ":" + window.location.port + "/api/updates",
url: "ws://" + window.location.hostname + ":" + window.location.port + "/api/updates",
// TODO will reinstate when dev complete.
url: "ws://localhost:8080/updates",
headers: {
},
heartbeat_in: 0, // Typical value 0 - disabled
heartbeat_out: 20000, // Typical value 20000 - every 20 seconds
reconnect_delay: 5000,
debug: false
debug: true
};

@NgModule({
Expand Down
3 changes: 1 addition & 2 deletions k8s-fleetman-webapp-angular/src/app/vehicle.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ export class VehicleService {
else
{
// call API gateway, get the history for this vehicle.
// TODO update this for a proper url and in config
this.http.get("http://localhost:8080/history/" + centerVehicle.name)
this.http.get("http://" + window.location.hostname + ":" + window.location.port + "/api/history/" + centerVehicle.name)
.subscribe( data => this.centerVehicleHistory.next(data));
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
fleetman-queue:
image: richardchesterwood/k8s-fleetman-queue:release1
image: richardchesterwood/k8s-fleetman-queue:release2
ports:
- '8161:8161'
networks:
Expand All @@ -11,7 +11,7 @@ services:
- SPRING_PROFILES_ACTIVE=local-microservice

fleetman-webapp:
image: richardchesterwood/k8s-fleetman-webapp-angular:release1
image: richardchesterwood/k8s-fleetman-webapp-angular:release2
ports:
- '80:80'
networks:
Expand All @@ -20,7 +20,7 @@ services:
- SPRING_PROFILES_ACTIVE=local-microservice

fleetman-api-gateway:
image: richardchesterwood/k8s-fleetman-api-gateway:release1
image: richardchesterwood/k8s-fleetman-api-gateway:release2
ports:
- '8080:8080'
networks:
Expand All @@ -29,20 +29,18 @@ services:
- SPRING_PROFILES_ACTIVE=local-microservice

fleetman-position-simulator:
image: richardchesterwood/k8s-fleetman-position-simulator:release1
image: richardchesterwood/k8s-fleetman-position-simulator:release2
networks:
- fleetman-private-network
environment:
- SPRING_PROFILES_ACTIVE=local-microservice

fleetman-position-tracker:
image: richardchesterwood/k8s-fleetman-position-tracker:release2beta
image: richardchesterwood/k8s-fleetman-position-tracker:release2
networks:
- fleetman-private-network
environment:
- SPRING_PROFILES_ACTIVE=local-microservice
ports:
- '8081:8080'

networks:
fleetman-private-network:
121 changes: 121 additions & 0 deletions k8s-manifests/release2/production-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: queue
labels:
app: queue
spec:
replicas: 1
selector:
matchLabels:
app: queue
template:
metadata:
labels:
app: queue
spec:
containers:
- name: fleetman-queue
image: richardchesterwood/k8s-fleetman-queue:release2
ports:
- containerPort: 8161
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
imagePullPolicy: Always
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: simulator
labels:
app: simulator
spec:
replicas: 1
selector:
matchLabels:
app: simulator
template:
metadata:
labels:
app: simulator
spec:
containers:
- name: fleetman-position-simulator
image: richardchesterwood/k8s-fleetman-position-simulator:release2
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
imagePullPolicy: Always
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: tracker
labels:
app: tracker
spec:
replicas: 1
selector:
matchLabels:
app: tracker
template:
metadata:
labels:
app: tracker
spec:
containers:
- name: fleetman-position-tracker
image: richardchesterwood/k8s-fleetman-position-tracker:release2
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
imagePullPolicy: Always
---
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: api-gateway
labels:
app: api-gateway
spec:
replicas: 1
selector:
matchLabels:
app: api-gateway
template:
metadata:
labels:
app: api-gateway
spec:
containers:
- name: fleetman-api-gateway
image: richardchesterwood/k8s-fleetman-api-gateway:release2
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
imagePullPolicy: Always
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
labels:
app: webapp
spec:
replicas: 2
selector:
matchLabels:
app: webapp
template:
metadata:
labels:
app: webapp
spec:
containers:
- name: fleetman-webapp
image: richardchesterwood/k8s-fleetman-webapp-angular:release2
env:
- name: SPRING_PROFILES_ACTIVE
value: production-microservice
imagePullPolicy: Always
49 changes: 49 additions & 0 deletions k8s-manifests/release2/production-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
kind: Service
apiVersion: v1
metadata:
name: fleetman-queue
spec:
selector:
app: queue
ports:
- name: console
port: 8161
- name: endpoint
port: 61616
type: ClusterIP
---
kind: Service
apiVersion: v1
metadata:
name: fleetman-position-tracker
spec:
selector:
app: tracker
ports:
- name: http
port: 8080
type: ClusterIP
---
kind: Service
apiVersion: v1
metadata:
name: fleetman-api-gateway
spec:
selector:
app: api-gateway
ports:
- name: http
port: 8080
type: ClusterIP
---
kind: Service
apiVersion: v1
metadata:
name: fleetman-webapp
spec:
selector:
app: webapp
ports:
- name: http
port: 80
type: LoadBalancer
Loading

0 comments on commit 519a839

Please sign in to comment.