From 122f4c0b94f1319e37745bc739717253d0f7ca48 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sun, 29 Dec 2019 14:07:48 +0100 Subject: [PATCH 01/42] Add bash script to build (package) all services --- build.sh | 23 +++++++++++++++++++++++ railway-app-api-gateway/mvnw | 0 railway-app-delay/mvnw | 0 railway-app-maintenance/mvnw | 0 railway-app-route-management/mvnw | 0 railway-app-staff/mvnw | 0 railway-app-station/mvnw | 0 railway-app-ticket-sale/mvnw | 0 railway-app-ticket-validation/mvnw | 0 railway-app-timetable/mvnw | 0 railway-app-train/mvnw | 0 11 files changed, 23 insertions(+) create mode 100644 build.sh mode change 100644 => 100755 railway-app-api-gateway/mvnw mode change 100644 => 100755 railway-app-delay/mvnw mode change 100644 => 100755 railway-app-maintenance/mvnw mode change 100644 => 100755 railway-app-route-management/mvnw mode change 100644 => 100755 railway-app-staff/mvnw mode change 100644 => 100755 railway-app-station/mvnw mode change 100644 => 100755 railway-app-ticket-sale/mvnw mode change 100644 => 100755 railway-app-ticket-validation/mvnw mode change 100644 => 100755 railway-app-timetable/mvnw mode change 100644 => 100755 railway-app-train/mvnw diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..a8c38a5 --- /dev/null +++ b/build.sh @@ -0,0 +1,23 @@ +#! /bin/bash + +base="railway-app-" +declare -a services=( + "api-gateway" + "delay" + "maintenance" + "route-management" + "staff" + "station" + "ticket-sale" + "ticket-validation" + "timetable" + "train" +) + +for s in "${services[@]}" +do + cd $base$s + chmod +x mvnw + ./mvnw package -DskipTests + cd .. +done diff --git a/railway-app-api-gateway/mvnw b/railway-app-api-gateway/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-delay/mvnw b/railway-app-delay/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-maintenance/mvnw b/railway-app-maintenance/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-route-management/mvnw b/railway-app-route-management/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-staff/mvnw b/railway-app-staff/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-station/mvnw b/railway-app-station/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-ticket-sale/mvnw b/railway-app-ticket-sale/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-ticket-validation/mvnw b/railway-app-ticket-validation/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-timetable/mvnw b/railway-app-timetable/mvnw old mode 100644 new mode 100755 diff --git a/railway-app-train/mvnw b/railway-app-train/mvnw old mode 100644 new mode 100755 From 3b50a008da9e9781b2fcbe26aa14204c43acfbf5 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sun, 29 Dec 2019 14:14:31 +0100 Subject: [PATCH 02/42] Add docker files --- railway-app-api-gateway/Dockerfile | 3 +++ railway-app-delay/Dockerfile | 3 +++ railway-app-maintenance/Dockerfile | 3 +++ railway-app-route-management/Dockerfile | 3 +++ railway-app-staff/Dockerfile | 3 +++ railway-app-station/Dockerfile | 3 +++ railway-app-ticket-sale/Dockerfile | 3 +++ railway-app-ticket-validation/Dockerfile | 3 +++ railway-app-timetable/Dockerfile | 3 +++ railway-app-train/Dockerfile | 3 +++ 10 files changed, 30 insertions(+) create mode 100644 railway-app-api-gateway/Dockerfile create mode 100644 railway-app-delay/Dockerfile create mode 100644 railway-app-maintenance/Dockerfile create mode 100644 railway-app-route-management/Dockerfile create mode 100644 railway-app-staff/Dockerfile create mode 100644 railway-app-station/Dockerfile create mode 100644 railway-app-ticket-sale/Dockerfile create mode 100644 railway-app-ticket-validation/Dockerfile create mode 100644 railway-app-timetable/Dockerfile create mode 100644 railway-app-train/Dockerfile diff --git a/railway-app-api-gateway/Dockerfile b/railway-app-api-gateway/Dockerfile new file mode 100644 index 0000000..25c4d20 --- /dev/null +++ b/railway-app-api-gateway/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-api-gateway-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-delay/Dockerfile b/railway-app-delay/Dockerfile new file mode 100644 index 0000000..8c61792 --- /dev/null +++ b/railway-app-delay/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-delay-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-maintenance/Dockerfile b/railway-app-maintenance/Dockerfile new file mode 100644 index 0000000..abcebcd --- /dev/null +++ b/railway-app-maintenance/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-maintenance-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-route-management/Dockerfile b/railway-app-route-management/Dockerfile new file mode 100644 index 0000000..10f42b4 --- /dev/null +++ b/railway-app-route-management/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-route-management-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-staff/Dockerfile b/railway-app-staff/Dockerfile new file mode 100644 index 0000000..9734a9a --- /dev/null +++ b/railway-app-staff/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-staff-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-station/Dockerfile b/railway-app-station/Dockerfile new file mode 100644 index 0000000..a8bd275 --- /dev/null +++ b/railway-app-station/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-station-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-ticket-sale/Dockerfile b/railway-app-ticket-sale/Dockerfile new file mode 100644 index 0000000..d267003 --- /dev/null +++ b/railway-app-ticket-sale/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-ticket-sale-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-ticket-validation/Dockerfile b/railway-app-ticket-validation/Dockerfile new file mode 100644 index 0000000..1bdaf80 --- /dev/null +++ b/railway-app-ticket-validation/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-ticket-validation-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-timetable/Dockerfile b/railway-app-timetable/Dockerfile new file mode 100644 index 0000000..cbce685 --- /dev/null +++ b/railway-app-timetable/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-timetable-0.0.1-SNAPSHOT.jar"] + diff --git a/railway-app-train/Dockerfile b/railway-app-train/Dockerfile new file mode 100644 index 0000000..e588cd9 --- /dev/null +++ b/railway-app-train/Dockerfile @@ -0,0 +1,3 @@ +from openjdk:8 +CMD ["java", "-jar", "app/railway-app-train-0.0.1-SNAPSHOT.jar"] + From f347bf4cfc792b4c63972b4f931e0632d43f65a9 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Mon, 30 Dec 2019 01:45:05 +0100 Subject: [PATCH 03/42] Add dockercompose setup --- docker-compose.yaml | 195 +++++++++++++++ .../RailwayAppApiGatewayApplication.java | 18 +- .../src/main/resources/application.properties | 3 + .../src/main/resources/application.properties | 9 +- railway-app-maintenance/pom.xml | 11 +- .../RailwayAppMaintenanceApplication.java | 24 +- .../src/main/resources/application.properties | 12 +- .../RailwayAppRouteManagementApplication.java | 226 +++++++++--------- .../adapters/rest/RouteRestController.java | 112 +++++++++ .../src/main/resources/application.properties | 5 + .../RailwayAppStaffApplication.java | 88 ++++--- .../src/main/resources/application.properties | 8 +- railway-app-station/pom.xml | 11 +- .../RailwayAppStationApplication.java | 37 +-- .../adapters/rest/StationRestController.java | 56 ++++- .../station_service/domain/Station.java | 21 +- .../persistence/StationRepository.java | 6 +- .../src/main/resources/application.properties | 12 +- railway-app-ticket-sale/pom.xml | 11 +- .../RailwayAppTicketSaleApplication.java | 24 +- .../src/main/resources/application.properties | 12 +- railway-app-ticket-validation/pom.xml | 11 +- ...RailwayAppTicketValidationApplication.java | 24 +- .../src/main/resources/application.properties | 11 +- railway-app-timetable/pom.xml | 11 +- .../src/main/resources/application.properties | 12 +- .../RailwayAppTrainApplication.java | 42 ++-- .../src/main/resources/application.properties | 6 + 28 files changed, 730 insertions(+), 288 deletions(-) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..529ef51 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,195 @@ +version: "3" +services: + zookeeper-container: + image: confluentinc/cp-zookeeper + environment: + - ZOOKEEPER_CLIENT_PORT=2181 + kafka-container: + image: confluentinc/cp-kafka + depends_on: + - zookeeper-container + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_ZOOKEEPER_CONNECT=zookeeper-container:2181 + - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka-container:9092 + - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 + + route-db: + image: neo4j:3.5.6 + environment: + - NEO4J_AUTH=neo4j/route + ports: + - 7687:7687 +# not good to expose a database port but this is just for the purpose of the frontend (graph visualisation) + + staff-db: + image: mongo + train-db: + image: mongo + + maintenance-db: + image: mysql:5.7 + command: --default-authentication-plugin=mysql_native_password + environment: + - MYSQL_ROOT_PASSWORD=maintenancedatabase + - MYSQL_DATABASE=Maintenance + station-db: + image: mysql:5.7 + command: --default-authentication-plugin=mysql_native_password + environment: + - MYSQL_ROOT_PASSWORD=stationdatabase + - MYSQL_DATABASE=Station + ticket-sale-db: + image: mysql:5.7 + command: --default-authentication-plugin=mysql_native_password + environment: + - MYSQL_ROOT_PASSWORD=ticketsaledatabase + - MYSQL_DATABASE=TicketSale + ticket-validation-db: + image: mysql:5.7 + command: --default-authentication-plugin=mysql_native_password + environment: + - MYSQL_ROOT_PASSWORD=ticketvalidationdatabase + - MYSQL_DATABASE=TicketValidation + timetable-db: + image: mysql:5.7 + command: --default-authentication-plugin=mysql_native_password + environment: + - MYSQL_ROOT_PASSWORD=timetabledatabase + - MYSQL_DATABASE=Timetable + delay-service: + build: ./railway-app-delay + volumes: + - ./railway-app-delay/target:/app + links: + - kafka-container + - zookeeper-container + depends_on: + - kafka-container + - zookeeper-container + maintenance-service: + build: ./railway-app-maintenance + volumes: + - ./railway-app-maintenance/target:/app + links: + - kafka-container + - zookeeper-container + - maintenance-db + depends_on: + - kafka-container + - zookeeper-container + - maintenance-db + route-service: + build: ./railway-app-route-management + volumes: + - ./railway-app-route-management/target:/app + links: + - kafka-container + - zookeeper-container + - route-db + depends_on: + - kafka-container + - zookeeper-container + - route-db + staff-service: + build: ./railway-app-staff + volumes: + - ./railway-app-staff/target:/app + links: + - kafka-container + - zookeeper-container + - staff-db + depends_on: + - kafka-container + - zookeeper-container + - staff-db + station-service: + build: ./railway-app-station + volumes: + - ./railway-app-station/target:/app + links: + - kafka-container + - zookeeper-container + - station-db + depends_on: + - kafka-container + - zookeeper-container + - station-db + ticket-sale-service: + build: ./railway-app-ticket-sale + volumes: + - ./railway-app-ticket-sale/target:/app + links: + - kafka-container + - zookeeper-container + - ticket-sale-db + depends_on: + - kafka-container + - zookeeper-container + - ticket-sale-db + ticket-validation-service: + build: ./railway-app-ticket-validation + volumes: + - ./railway-app-ticket-validation/target:/app + links: + - kafka-container + - zookeeper-container + - ticket-validation-db + depends_on: + - kafka-container + - zookeeper-container + - ticket-validation-db + timetable-service: + build: ./railway-app-timetable + volumes: + - ./railway-app-timetable/target:/app + links: + - kafka-container + - zookeeper-container + - timetable-db + depends_on: + - kafka-container + - zookeeper-container + - timetable-db + train-service: + build: ./railway-app-train + volumes: + - ./railway-app-train/target:/app + links: + - kafka-container + - zookeeper-container + - train-db + depends_on: + - kafka-container + - zookeeper-container + - train-db + apigateway: + build: ./railway-app-api-gateway + volumes: + - ./railway-app-api-gateway/target:/app + links: + - kafka-container + - zookeeper-container + - delay-service + - maintenance-service + - route-service + - staff-service + - station-service + - ticket-sale-service + - ticket-validation-service + - timetable-service + - train-service + depends_on: + - kafka-container + - zookeeper-container + - delay-service + - maintenance-service + - route-service + - staff-service + - station-service + - ticket-sale-service + - ticket-validation-service + - timetable-service + - train-service + ports: + - 8080:8080 diff --git a/railway-app-api-gateway/src/main/java/com/railway/api_gateway/RailwayAppApiGatewayApplication.java b/railway-app-api-gateway/src/main/java/com/railway/api_gateway/RailwayAppApiGatewayApplication.java index d25457a..de3c995 100644 --- a/railway-app-api-gateway/src/main/java/com/railway/api_gateway/RailwayAppApiGatewayApplication.java +++ b/railway-app-api-gateway/src/main/java/com/railway/api_gateway/RailwayAppApiGatewayApplication.java @@ -20,21 +20,23 @@ public static void main(String[] args) { public RouteLocator customRouteLocator(RouteLocatorBuilder builder) { return builder.routes() //maintenance service - .route(r -> r.host("*").and().path("/maintenance/**").uri("http://localhost:2005")) + .route(r -> r.host("*").and().path("/maintenance/**").uri("http://maintenance-service:2005")) //route management service - .route(r -> r.host("*").and().path("/network/**").uri("http://localhost:2000")) + .route(r -> r.host("*").and().path("/network/**").uri("http://route-service:2000")) //staff service - .route(r -> r.host("*").and().path("/staff/**").uri("http://localhost:2006")) + .route(r -> r.host("*").and().path("/staff/**").uri("http://staff-service:2006")) //station service - .route(r -> r.host("*").and().path("/station/**").uri("http://localhost:2002")) + .route(r -> r.host("*").and().path("/station/**").uri("http://station-service:2002")) //ticket sale service - .route(r -> r.host("*").and().path("/ticket/**").uri("http://localhost:2007")) + .route(r -> r.host("*").and().path("/ticket/**").uri("http://ticket-sale-service:2007")) //ticket validation service - .route(r -> r.host("*").and().path("/ticket-validation/**").uri("http://localhost:2008")) + .route(r -> r.host("*").and().path("/ticket-validation/**").uri("http://ticket-validation-service:2008")) //timetable service - .route(r -> r.host("*").and().path("/timetable/**").uri("http://localhost:2001")) + .route(r -> r.host("*").and().path("/timetable/**").uri("http://timetable-service:2001")) //train service - .route(r -> r.host("*").and().path("/train/**").uri("http://localhost:2003")) + .route(r -> r.host("*").and().path("/train/**").uri("http://train-service:2003")) + //delay service + .route(r -> r.host("*").and().path("/delay/**").uri("http://delay-service:2004")) .build(); } } diff --git a/railway-app-api-gateway/src/main/resources/application.properties b/railway-app-api-gateway/src/main/resources/application.properties index 9edad23..6061f27 100644 --- a/railway-app-api-gateway/src/main/resources/application.properties +++ b/railway-app-api-gateway/src/main/resources/application.properties @@ -1,5 +1,8 @@ server.port=8080 +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.notify_emergency_services.content-type=application/json spring.cloud.stream.bindings.notify_emergency_services.destination=notify_emergency_services diff --git a/railway-app-delay/src/main/resources/application.properties b/railway-app-delay/src/main/resources/application.properties index 5f13543..5a4e8d6 100644 --- a/railway-app-delay/src/main/resources/application.properties +++ b/railway-app-delay/src/main/resources/application.properties @@ -1,3 +1,8 @@ +server.port = 2004 + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.notify_delay.content-type=application/json spring.cloud.stream.bindings.notify_delay.destination=notify_delay @@ -8,6 +13,4 @@ spring.cloud.stream.bindings.get_route.content-type=application/json spring.cloud.stream.bindings.get_route.destination=get_route spring.cloud.stream.bindings.route_fetched.content-type=application/json -spring.cloud.stream.bindings.route_fetched.destination=route_fetched - -server.port = 2004 +spring.cloud.stream.bindings.route_fetched.destination=route_fetched \ No newline at end of file diff --git a/railway-app-maintenance/pom.xml b/railway-app-maintenance/pom.xml index 2571cb0..fa47fa9 100644 --- a/railway-app-maintenance/pom.xml +++ b/railway-app-maintenance/pom.xml @@ -34,11 +34,7 @@ org.springframework.boot spring-boot-starter-data-jpa - - com.h2database - h2 - runtime - + org.springframework.boot spring-boot-starter-web @@ -69,6 +65,11 @@ spring-kafka-test test + + mysql + mysql-connector-java + runtime + diff --git a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/RailwayAppMaintenanceApplication.java b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/RailwayAppMaintenanceApplication.java index 7903cc6..99bd009 100644 --- a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/RailwayAppMaintenanceApplication.java +++ b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/RailwayAppMaintenanceApplication.java @@ -22,7 +22,7 @@ @SpringBootApplication @EnableBinding(Channels.class) public class RailwayAppMaintenanceApplication { - private static Logger logger = LoggerFactory.getLogger(RailwayAppMaintenanceApplication.class); +// private static Logger logger = LoggerFactory.getLogger(RailwayAppMaintenanceApplication.class); public static void main(String[] args) { SpringApplication.run(RailwayAppMaintenanceApplication.class, args); @@ -31,17 +31,17 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(MaintenanceRepository maintenanceRepository) { return (args)->{ - ScheduleItem scheduleItem01 = new ScheduleItem("5df29bec04c7bf325077c427", LocalDateTime.of(2018, Month.DECEMBER, 20, 13, 30, 0, 0), LocalDateTime.of(2018, Month.DECEMBER, 20, 15, 45, 0, 0), Status.SCHEDULED, "train wrecked", MaintenanceType.MAINTENANCE); - - Collection staffIds = new ArrayList<>(); - staffIds.add("001"); - staffIds.add("002"); - staffIds.add("003"); - scheduleItem01.setStaffIds(staffIds); - - maintenanceRepository.save(scheduleItem01); - - logger.info("ScheduleItem01: " + scheduleItem01.toString()); +// ScheduleItem scheduleItem01 = new ScheduleItem("5df29bec04c7bf325077c427", LocalDateTime.of(2018, Month.DECEMBER, 20, 13, 30, 0, 0), LocalDateTime.of(2018, Month.DECEMBER, 20, 15, 45, 0, 0), Status.SCHEDULED, "train wrecked", MaintenanceType.MAINTENANCE); +// +// Collection staffIds = new ArrayList<>(); +// staffIds.add("001"); +// staffIds.add("002"); +// staffIds.add("003"); +// scheduleItem01.setStaffIds(staffIds); +// +// maintenanceRepository.save(scheduleItem01); +// +// logger.info("ScheduleItem01: " + scheduleItem01.toString()); }; } } diff --git a/railway-app-maintenance/src/main/resources/application.properties b/railway-app-maintenance/src/main/resources/application.properties index 62e363b..0b832d0 100644 --- a/railway-app-maintenance/src/main/resources/application.properties +++ b/railway-app-maintenance/src/main/resources/application.properties @@ -1,5 +1,14 @@ server.port=2005 +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://maintenance-db:3306/Maintenance +spring.datasource.username=root +spring.datasource.password=maintenancedatabase +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.request_maintenance.content-type=application/json spring.cloud.stream.bindings.request_maintenance.destination=request_maintenance @@ -9,7 +18,6 @@ spring.cloud.stream.bindings.reserve_staff.destination=reserve_staff spring.cloud.stream.bindings.staff_reserved.content-type=application/json spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved - spring.cloud.stream.bindings.change_train_status.content-type=application/json spring.cloud.stream.bindings.change_train_status.destination=change_train_status @@ -17,4 +25,4 @@ spring.cloud.stream.bindings.notify_accident.content-type=application/json spring.cloud.stream.bindings.notify_accident.destination=notify_accident spring.cloud.stream.bindings.notify_infrastructure_damage.content-type=application/json -spring.cloud.stream.bindings.notify_infrastructure_damage.destination=notify_infrastructure_damage +spring.cloud.stream.bindings.notify_infrastructure_damage.destination=notify_infrastructure_damage \ No newline at end of file diff --git a/railway-app-route-management/src/main/java/com/railway/route_management_service/RailwayAppRouteManagementApplication.java b/railway-app-route-management/src/main/java/com/railway/route_management_service/RailwayAppRouteManagementApplication.java index e77a75f..32eb71f 100644 --- a/railway-app-route-management/src/main/java/com/railway/route_management_service/RailwayAppRouteManagementApplication.java +++ b/railway-app-route-management/src/main/java/com/railway/route_management_service/RailwayAppRouteManagementApplication.java @@ -22,7 +22,7 @@ @SpringBootApplication @EnableBinding(Channels.class) public class RailwayAppRouteManagementApplication { - private static Logger logger = LoggerFactory.getLogger(RailwayAppRouteManagementApplication.class); +// private static Logger logger = LoggerFactory.getLogger(RailwayAppRouteManagementApplication.class); public static void main(String[] args) { SpringApplication.run(RailwayAppRouteManagementApplication.class, args); @@ -32,118 +32,118 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(StationRepository stationRepository, ConnectionRepository connectionRepository, RouteRepository routeRepository) { return (args) ->{ - logger.info("Populating graph database with test data ..."); - - stationRepository.deleteAll(); - routeRepository.deleteAll(); - - Station station01 = new Station(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters"); - stationRepository.save(station01); - Station station02 = new Station(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort"); - stationRepository.save(station02); - Station station03 = new Station(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk"); - stationRepository.save(station03); - Station station04 = new Station(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem"); - stationRepository.save(station04); - Station station05 = new Station(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter"); - stationRepository.save(station05); - Station station06 = new Station(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte"); - stationRepository.save(station06); - Station station07 = new Station(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze"); - stationRepository.save(station07); - Station station08 = new Station(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo"); - stationRepository.save(station08); - Station station09 = new Station(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem"); - stationRepository.save(station09); - Station station10 = new Station(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde"); - stationRepository.save(station10); - Station station11 = new Station(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem"); - stationRepository.save(station11); - Station station12 = new Station(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw"); - stationRepository.save(station12); - Station station13 = new Station(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid"); - stationRepository.save(station13); - - Connection con01 = new Connection(station01, station02, 10L, 120); - connectionRepository.save(con01); - Connection con02 = new Connection(station01, station05, 28L, 120); - connectionRepository.save(con02); - Connection con03 = new Connection(station01, station06, 14L, 120); - connectionRepository.save(con03); - Connection con04 = new Connection(station01, station08, 29L, 120); - connectionRepository.save(con04); - Connection con05 = new Connection(station01, station11, 38L, 120); - connectionRepository.save(con05); - Connection con06 = new Connection(station01, station12, 42L, 120); - connectionRepository.save(con06); - - Connection con07 = new Connection(station02, station09, 15L, 120); - connectionRepository.save(con07); - Connection con08 = new Connection(station02, station11, 28L, 120); - connectionRepository.save(con08); - - Connection con09 = new Connection(station03, station04, 17L, 120); - connectionRepository.save(con09); - - Connection con10 = new Connection(station04, station07, 36L, 120); - connectionRepository.save(con10); - - Connection con11 = new Connection(station06, station07, 19L, 120); - connectionRepository.save(con11); - Connection con12 = new Connection(station06, station10, 27L, 120); - connectionRepository.save(con12); - - Connection con13 = new Connection(station08, station09, 22L, 120); - connectionRepository.save(con13); - - Connection con14 = new Connection(station11, station12, 20L, 120); - connectionRepository.save(con14); - - Connection con15 = new Connection(station12, station13, 38L, 120); - connectionRepository.save(con15); - - Route route01 = new Route("Kortrijk - De Pinte"); - RouteConnection routeCon01 = new RouteConnection(route01, station03, true, con09.getId()); - RouteConnection routeCon02 = new RouteConnection(route01, station04, false, con10.getId()); - RouteConnection routeCon04 = new RouteConnection(route01, station07, false, con11.getId()); - RouteConnection routeCon03 = new RouteConnection(route01, station06, false, null); - - Route route02 = new Route("Kortrijk - Deinze"); - RouteConnection routeCon05 = new RouteConnection(route02, station03, true, con09.getId()); - RouteConnection routeCon06 = new RouteConnection(route02, station04, false, con10.getId()); - RouteConnection routeCon07 = new RouteConnection(route02, station07, false, null); - - Route route03 = new Route("Brussel-Zuid - Gent-Sint-Pieters"); - RouteConnection routeCon08 = new RouteConnection(route03, station13, true, con15.getId()); - RouteConnection routeCon09 = new RouteConnection(route03, station12, false, con14.getId()); - RouteConnection routeCon10 = new RouteConnection(route03, station11, false, con08.getId()); - RouteConnection routeCon11 = new RouteConnection(route03, station02, false, con01.getId()); - RouteConnection routeCon12 = new RouteConnection(route03, station01, false, null); - - Route route04 = new Route("Deinze - Zottegem"); - RouteConnection routeCon13 = new RouteConnection(route04, station07, true, con11.getId()); - RouteConnection routeCon14 = new RouteConnection(route04, station06, false, con03.getId()); - RouteConnection routeCon15 = new RouteConnection(route04, station01, false, con05.getId()); - RouteConnection routeCon16 = new RouteConnection(route04, station11, false, null); - - Route route05 = new Route("Gent-Sint-Pieters - Brussel-Zuid"); - RouteConnection routeCon17 = new RouteConnection(route05, station01, true, con01.getId()); - RouteConnection routeCon18 = new RouteConnection(route05, station02, false, con08.getId()); - RouteConnection routeCon19 = new RouteConnection(route05, station11, false, con14.getId()); - RouteConnection routeCon20 = new RouteConnection(route05, station12, false, con15.getId()); - RouteConnection routeCon21 = new RouteConnection(route05, station13, false, null); - - routeRepository.save(route01); - routeRepository.save(route02); - routeRepository.save(route03); - routeRepository.save(route04); - routeRepository.save(route05); - - logger.info("Station01: " + station01.toString()); - logger.info("Station02: " + station02.toString()); - logger.info("Station03: " + station03.toString()); - logger.info("Station04: " + station04.toString()); - logger.info("Station05: " + station05.toString()); +// logger.info("Populating graph database with test data ..."); +// +// stationRepository.deleteAll(); +// routeRepository.deleteAll(); +// +// Station station01 = new Station(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters"); +// stationRepository.save(station01); +// Station station02 = new Station(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort"); +// stationRepository.save(station02); +// Station station03 = new Station(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk"); +// stationRepository.save(station03); +// Station station04 = new Station(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem"); +// stationRepository.save(station04); +// Station station05 = new Station(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter"); +// stationRepository.save(station05); +// Station station06 = new Station(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte"); +// stationRepository.save(station06); +// Station station07 = new Station(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze"); +// stationRepository.save(station07); +// Station station08 = new Station(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo"); +// stationRepository.save(station08); +// Station station09 = new Station(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem"); +// stationRepository.save(station09); +// Station station10 = new Station(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde"); +// stationRepository.save(station10); +// Station station11 = new Station(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem"); +// stationRepository.save(station11); +// Station station12 = new Station(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw"); +// stationRepository.save(station12); +// Station station13 = new Station(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid"); +// stationRepository.save(station13); +// +// Connection con01 = new Connection(station01, station02, 10L, 120); +// connectionRepository.save(con01); +// Connection con02 = new Connection(station01, station05, 28L, 120); +// connectionRepository.save(con02); +// Connection con03 = new Connection(station01, station06, 14L, 120); +// connectionRepository.save(con03); +// Connection con04 = new Connection(station01, station08, 29L, 120); +// connectionRepository.save(con04); +// Connection con05 = new Connection(station01, station11, 38L, 120); +// connectionRepository.save(con05); +// Connection con06 = new Connection(station01, station12, 42L, 120); +// connectionRepository.save(con06); +// +// Connection con07 = new Connection(station02, station09, 15L, 120); +// connectionRepository.save(con07); +// Connection con08 = new Connection(station02, station11, 28L, 120); +// connectionRepository.save(con08); +// +// Connection con09 = new Connection(station03, station04, 17L, 120); +// connectionRepository.save(con09); +// +// Connection con10 = new Connection(station04, station07, 36L, 120); +// connectionRepository.save(con10); +// +// Connection con11 = new Connection(station06, station07, 19L, 120); +// connectionRepository.save(con11); +// Connection con12 = new Connection(station06, station10, 27L, 120); +// connectionRepository.save(con12); +// +// Connection con13 = new Connection(station08, station09, 22L, 120); +// connectionRepository.save(con13); +// +// Connection con14 = new Connection(station11, station12, 20L, 120); +// connectionRepository.save(con14); +// +// Connection con15 = new Connection(station12, station13, 38L, 120); +// connectionRepository.save(con15); +// +// Route route01 = new Route("Kortrijk - De Pinte"); +// RouteConnection routeCon01 = new RouteConnection(route01, station03, true, con09.getId()); +// RouteConnection routeCon02 = new RouteConnection(route01, station04, false, con10.getId()); +// RouteConnection routeCon04 = new RouteConnection(route01, station07, false, con11.getId()); +// RouteConnection routeCon03 = new RouteConnection(route01, station06, false, null); +// +// Route route02 = new Route("Kortrijk - Deinze"); +// RouteConnection routeCon05 = new RouteConnection(route02, station03, true, con09.getId()); +// RouteConnection routeCon06 = new RouteConnection(route02, station04, false, con10.getId()); +// RouteConnection routeCon07 = new RouteConnection(route02, station07, false, null); +// +// Route route03 = new Route("Brussel-Zuid - Gent-Sint-Pieters"); +// RouteConnection routeCon08 = new RouteConnection(route03, station13, true, con15.getId()); +// RouteConnection routeCon09 = new RouteConnection(route03, station12, false, con14.getId()); +// RouteConnection routeCon10 = new RouteConnection(route03, station11, false, con08.getId()); +// RouteConnection routeCon11 = new RouteConnection(route03, station02, false, con01.getId()); +// RouteConnection routeCon12 = new RouteConnection(route03, station01, false, null); +// +// Route route04 = new Route("Deinze - Zottegem"); +// RouteConnection routeCon13 = new RouteConnection(route04, station07, true, con11.getId()); +// RouteConnection routeCon14 = new RouteConnection(route04, station06, false, con03.getId()); +// RouteConnection routeCon15 = new RouteConnection(route04, station01, false, con05.getId()); +// RouteConnection routeCon16 = new RouteConnection(route04, station11, false, null); +// +// Route route05 = new Route("Gent-Sint-Pieters - Brussel-Zuid"); +// RouteConnection routeCon17 = new RouteConnection(route05, station01, true, con01.getId()); +// RouteConnection routeCon18 = new RouteConnection(route05, station02, false, con08.getId()); +// RouteConnection routeCon19 = new RouteConnection(route05, station11, false, con14.getId()); +// RouteConnection routeCon20 = new RouteConnection(route05, station12, false, con15.getId()); +// RouteConnection routeCon21 = new RouteConnection(route05, station13, false, null); +// +// routeRepository.save(route01); +// routeRepository.save(route02); +// routeRepository.save(route03); +// routeRepository.save(route04); +// routeRepository.save(route05); +// +// logger.info("Station01: " + station01.toString()); +// logger.info("Station02: " + station02.toString()); +// logger.info("Station03: " + station03.toString()); +// logger.info("Station04: " + station04.toString()); +// logger.info("Station05: " + station05.toString()); }; } } diff --git a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/rest/RouteRestController.java b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/rest/RouteRestController.java index 948a3d3..980b208 100644 --- a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/rest/RouteRestController.java +++ b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/rest/RouteRestController.java @@ -50,6 +50,118 @@ public RouteRestController(StationRepository stationRepository, ConnectionReposi this.routeService = routeService; } + // Initial stations/connections/routes/routeConnections shouldn't be created in a bean on startup because + // they would get created again if a service is scaled or restarted by kubernetes + @SuppressWarnings("unused") + @PostMapping("/init") + @ResponseStatus(HttpStatus.OK) + public void initNetwork() { + stationRepository.deleteAll(); + routeRepository.deleteAll(); + + Station station01 = new Station(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters"); + stationRepository.save(station01); + Station station02 = new Station(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort"); + stationRepository.save(station02); + Station station03 = new Station(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk"); + stationRepository.save(station03); + Station station04 = new Station(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem"); + stationRepository.save(station04); + Station station05 = new Station(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter"); + stationRepository.save(station05); + Station station06 = new Station(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte"); + stationRepository.save(station06); + Station station07 = new Station(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze"); + stationRepository.save(station07); + Station station08 = new Station(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo"); + stationRepository.save(station08); + Station station09 = new Station(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem"); + stationRepository.save(station09); + Station station10 = new Station(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde"); + stationRepository.save(station10); + Station station11 = new Station(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem"); + stationRepository.save(station11); + Station station12 = new Station(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw"); + stationRepository.save(station12); + Station station13 = new Station(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid"); + stationRepository.save(station13); + + Connection con01 = new Connection(station01, station02, 10L, 120); + connectionRepository.save(con01); + Connection con02 = new Connection(station01, station05, 28L, 120); + connectionRepository.save(con02); + Connection con03 = new Connection(station01, station06, 14L, 120); + connectionRepository.save(con03); + Connection con04 = new Connection(station01, station08, 29L, 120); + connectionRepository.save(con04); + Connection con05 = new Connection(station01, station11, 38L, 120); + connectionRepository.save(con05); + Connection con06 = new Connection(station01, station12, 42L, 120); + connectionRepository.save(con06); + + Connection con07 = new Connection(station02, station09, 15L, 120); + connectionRepository.save(con07); + Connection con08 = new Connection(station02, station11, 28L, 120); + connectionRepository.save(con08); + + Connection con09 = new Connection(station03, station04, 17L, 120); + connectionRepository.save(con09); + + Connection con10 = new Connection(station04, station07, 36L, 120); + connectionRepository.save(con10); + + Connection con11 = new Connection(station06, station07, 19L, 120); + connectionRepository.save(con11); + Connection con12 = new Connection(station06, station10, 27L, 120); + connectionRepository.save(con12); + + Connection con13 = new Connection(station08, station09, 22L, 120); + connectionRepository.save(con13); + + Connection con14 = new Connection(station11, station12, 20L, 120); + connectionRepository.save(con14); + + Connection con15 = new Connection(station12, station13, 38L, 120); + connectionRepository.save(con15); + + Route route01 = new Route("Kortrijk - De Pinte"); + RouteConnection routeCon01 = new RouteConnection(route01, station03, true, con09.getId()); + RouteConnection routeCon02 = new RouteConnection(route01, station04, false, con10.getId()); + RouteConnection routeCon04 = new RouteConnection(route01, station07, false, con11.getId()); + RouteConnection routeCon03 = new RouteConnection(route01, station06, false, null); + + Route route02 = new Route("Kortrijk - Deinze"); + RouteConnection routeCon05 = new RouteConnection(route02, station03, true, con09.getId()); + RouteConnection routeCon06 = new RouteConnection(route02, station04, false, con10.getId()); + RouteConnection routeCon07 = new RouteConnection(route02, station07, false, null); + + Route route03 = new Route("Brussel-Zuid - Gent-Sint-Pieters"); + RouteConnection routeCon08 = new RouteConnection(route03, station13, true, con15.getId()); + RouteConnection routeCon09 = new RouteConnection(route03, station12, false, con14.getId()); + RouteConnection routeCon10 = new RouteConnection(route03, station11, false, con08.getId()); + RouteConnection routeCon11 = new RouteConnection(route03, station02, false, con01.getId()); + RouteConnection routeCon12 = new RouteConnection(route03, station01, false, null); + + Route route04 = new Route("Deinze - Zottegem"); + RouteConnection routeCon13 = new RouteConnection(route04, station07, true, con11.getId()); + RouteConnection routeCon14 = new RouteConnection(route04, station06, false, con03.getId()); + RouteConnection routeCon15 = new RouteConnection(route04, station01, false, con05.getId()); + RouteConnection routeCon16 = new RouteConnection(route04, station11, false, null); + + Route route05 = new Route("Gent-Sint-Pieters - Brussel-Zuid"); + RouteConnection routeCon17 = new RouteConnection(route05, station01, true, con01.getId()); + RouteConnection routeCon18 = new RouteConnection(route05, station02, false, con08.getId()); + RouteConnection routeCon19 = new RouteConnection(route05, station11, false, con14.getId()); + RouteConnection routeCon20 = new RouteConnection(route05, station12, false, con15.getId()); + RouteConnection routeCon21 = new RouteConnection(route05, station13, false, null); + + routeRepository.save(route01); + routeRepository.save(route02); + routeRepository.save(route03); + routeRepository.save(route04); + routeRepository.save(route05); + } + @GetMapping("/route/all") public Iterable getAllRoutes() { return this.routeRepository.findAll(); diff --git a/railway-app-route-management/src/main/resources/application.properties b/railway-app-route-management/src/main/resources/application.properties index 18bc812..fb26b87 100644 --- a/railway-app-route-management/src/main/resources/application.properties +++ b/railway-app-route-management/src/main/resources/application.properties @@ -1,7 +1,12 @@ server.port=2000 + +spring.data.neo4j.uri=bolt://route-db:7687 spring.data.neo4j.username=neo4j spring.data.neo4j.password=route +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.get_route.content-type=application/json spring.cloud.stream.bindings.get_route.destination=get_route diff --git a/railway-app-staff/src/main/java/com/railway/staff_service/RailwayAppStaffApplication.java b/railway-app-staff/src/main/java/com/railway/staff_service/RailwayAppStaffApplication.java index 1dcf2d1..67dd8d4 100644 --- a/railway-app-staff/src/main/java/com/railway/staff_service/RailwayAppStaffApplication.java +++ b/railway-app-staff/src/main/java/com/railway/staff_service/RailwayAppStaffApplication.java @@ -28,52 +28,50 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(StaffMembersRepository staffMemberRepository) { return (args) ->{ - staffMemberRepository.deleteAll(); - - StaffMember staffMember01 = new StaffMember("Adrian", "Cannon", new GregorianCalendar(1980, Calendar.FEBRUARY, 21).getTime(), StaffMemberType.MECHANIC); - StaffMember staffMember02 = new StaffMember("Allisson", "Hanson", new GregorianCalendar(1985, Calendar.MARCH, 30).getTime(), StaffMemberType.MECHANIC); - StaffMember staffMember03 = new StaffMember("Allan", "Brandt", new GregorianCalendar(1982, Calendar.DECEMBER, 4).getTime(), StaffMemberType.CONDUCTOR); - StaffMember staffMember04 = new StaffMember("Sara", "Durham", new GregorianCalendar(1978, Calendar.OCTOBER, 3).getTime(), StaffMemberType.TRAIN_OPERATOR); - StaffMember staffMember05 = new StaffMember("Tommy", "Oneill", new GregorianCalendar(1976, Calendar.OCTOBER, 18).getTime(), StaffMemberType.TRAIN_OPERATOR); - StaffMember staffMember06 = new StaffMember("Charles", "Werner", new GregorianCalendar(1972, Calendar.SEPTEMBER, 2).getTime(), StaffMemberType.CONDUCTOR); - StaffMember staffMember07 = new StaffMember("Juliette", "Massey", new GregorianCalendar(1971, Calendar.OCTOBER, 4).getTime(), StaffMemberType.MECHANIC); - StaffMember staffMember08 = new StaffMember("Brent", "Chang", new GregorianCalendar(1973, Calendar.JULY, 30).getTime(), StaffMemberType.MECHANIC); - StaffMember staffMember09 = new StaffMember("Morgan", "Allen", new GregorianCalendar(1975, Calendar.JANUARY, 13).getTime(), StaffMemberType.CONDUCTOR); - StaffMember staffMember10 = new StaffMember("Alexia", "Carter", new GregorianCalendar(1978, Calendar.APRIL, 25).getTime(), StaffMemberType.CONDUCTOR); - -// ScheduleItem scheduleItem01 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 18, 13, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 18, 15, 0, 0, 0)); -// ScheduleItem scheduleItem02 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 18, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 18, 18, 0, 0, 0)); -// ScheduleItem scheduleItem03 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 20, 8, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 20, 10, 0, 0, 0)); -// ScheduleItem scheduleItem04 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 22, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 22, 17, 30, 0, 0)); -// ScheduleItem scheduleItem05 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 22, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 22, 17, 30, 0, 0)); +// StaffMember staffMember01 = new StaffMember("Adrian", "Cannon", new GregorianCalendar(1980, Calendar.FEBRUARY, 21).getTime(), StaffMemberType.MECHANIC); +// StaffMember staffMember02 = new StaffMember("Allisson", "Hanson", new GregorianCalendar(1985, Calendar.MARCH, 30).getTime(), StaffMemberType.MECHANIC); +// StaffMember staffMember03 = new StaffMember("Allan", "Brandt", new GregorianCalendar(1982, Calendar.DECEMBER, 4).getTime(), StaffMemberType.CONDUCTOR); +// StaffMember staffMember04 = new StaffMember("Sara", "Durham", new GregorianCalendar(1978, Calendar.OCTOBER, 3).getTime(), StaffMemberType.TRAIN_OPERATOR); +// StaffMember staffMember05 = new StaffMember("Tommy", "Oneill", new GregorianCalendar(1976, Calendar.OCTOBER, 18).getTime(), StaffMemberType.TRAIN_OPERATOR); +// StaffMember staffMember06 = new StaffMember("Charles", "Werner", new GregorianCalendar(1972, Calendar.SEPTEMBER, 2).getTime(), StaffMemberType.CONDUCTOR); +// StaffMember staffMember07 = new StaffMember("Juliette", "Massey", new GregorianCalendar(1971, Calendar.OCTOBER, 4).getTime(), StaffMemberType.MECHANIC); +// StaffMember staffMember08 = new StaffMember("Brent", "Chang", new GregorianCalendar(1973, Calendar.JULY, 30).getTime(), StaffMemberType.MECHANIC); +// StaffMember staffMember09 = new StaffMember("Morgan", "Allen", new GregorianCalendar(1975, Calendar.JANUARY, 13).getTime(), StaffMemberType.CONDUCTOR); +// StaffMember staffMember10 = new StaffMember("Alexia", "Carter", new GregorianCalendar(1978, Calendar.APRIL, 25).getTime(), StaffMemberType.CONDUCTOR); // -// staffMember01.addScheduleItem(scheduleItem01); -// staffMember02.addScheduleItem(scheduleItem02); -// staffMember03.addScheduleItem(scheduleItem03); -// staffMember03.addScheduleItem(scheduleItem04); -// staffMember04.addScheduleItem(scheduleItem05); - - staffMemberRepository.save(staffMember01); - staffMemberRepository.save(staffMember02); - staffMemberRepository.save(staffMember03); - staffMemberRepository.save(staffMember04); - staffMemberRepository.save(staffMember05); - staffMemberRepository.save(staffMember06); - staffMemberRepository.save(staffMember07); - staffMemberRepository.save(staffMember08); - staffMemberRepository.save(staffMember09); - staffMemberRepository.save(staffMember10); - - logger.info("StaffMember01: " + staffMember01.toString()); - logger.info("StaffMember02: " + staffMember02.toString()); - logger.info("StaffMember03: " + staffMember03.toString()); - logger.info("StaffMember04: " + staffMember04.toString()); - logger.info("StaffMember05: " + staffMember05.toString()); - logger.info("StaffMember06: " + staffMember06.toString()); - logger.info("StaffMember07: " + staffMember07.toString()); - logger.info("StaffMember08: " + staffMember08.toString()); - logger.info("StaffMember09: " + staffMember09.toString()); - logger.info("StaffMember10: " + staffMember10.toString()); +//// ScheduleItem scheduleItem01 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 18, 13, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 18, 15, 0, 0, 0)); +//// ScheduleItem scheduleItem02 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 18, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 18, 18, 0, 0, 0)); +//// ScheduleItem scheduleItem03 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 20, 8, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 20, 10, 0, 0, 0)); +//// ScheduleItem scheduleItem04 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 22, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 22, 17, 30, 0, 0)); +//// ScheduleItem scheduleItem05 = new ScheduleItem(LocalDateTime.of(2019, Calendar.DECEMBER, 22, 15, 0, 0, 0), LocalDateTime.of(2019, Calendar.DECEMBER, 22, 17, 30, 0, 0)); +//// +//// staffMember01.addScheduleItem(scheduleItem01); +//// staffMember02.addScheduleItem(scheduleItem02); +//// staffMember03.addScheduleItem(scheduleItem03); +//// staffMember03.addScheduleItem(scheduleItem04); +//// staffMember04.addScheduleItem(scheduleItem05); +// +// staffMemberRepository.save(staffMember01); +// staffMemberRepository.save(staffMember02); +// staffMemberRepository.save(staffMember03); +// staffMemberRepository.save(staffMember04); +// staffMemberRepository.save(staffMember05); +// staffMemberRepository.save(staffMember06); +// staffMemberRepository.save(staffMember07); +// staffMemberRepository.save(staffMember08); +// staffMemberRepository.save(staffMember09); +// staffMemberRepository.save(staffMember10); +// +// logger.info("StaffMember01: " + staffMember01.toString()); +// logger.info("StaffMember02: " + staffMember02.toString()); +// logger.info("StaffMember03: " + staffMember03.toString()); +// logger.info("StaffMember04: " + staffMember04.toString()); +// logger.info("StaffMember05: " + staffMember05.toString()); +// logger.info("StaffMember06: " + staffMember06.toString()); +// logger.info("StaffMember07: " + staffMember07.toString()); +// logger.info("StaffMember08: " + staffMember08.toString()); +// logger.info("StaffMember09: " + staffMember09.toString()); +// logger.info("StaffMember10: " + staffMember10.toString()); }; } } diff --git a/railway-app-staff/src/main/resources/application.properties b/railway-app-staff/src/main/resources/application.properties index 2eeb2c6..485426e 100644 --- a/railway-app-staff/src/main/resources/application.properties +++ b/railway-app-staff/src/main/resources/application.properties @@ -1,7 +1,13 @@ server.port=2006 +spring.data.mongodb.host=staff-db +spring.data.mongodb.port=27017 + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.reserve_staff.content-type=application/json spring.cloud.stream.bindings.reserve_staff.destination=reserve_staff spring.cloud.stream.bindings.staff_reserved.content-type=application/json -spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved +spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved \ No newline at end of file diff --git a/railway-app-station/pom.xml b/railway-app-station/pom.xml index 31f8068..2f18ee8 100644 --- a/railway-app-station/pom.xml +++ b/railway-app-station/pom.xml @@ -34,11 +34,7 @@ org.springframework.boot spring-boot-starter-data-jpa - - com.h2database - h2 - runtime - + org.springframework.boot spring-boot-starter-web @@ -65,6 +61,11 @@ spring-kafka-test test + + mysql + mysql-connector-java + runtime + diff --git a/railway-app-station/src/main/java/com/railway/station_service/RailwayAppStationApplication.java b/railway-app-station/src/main/java/com/railway/station_service/RailwayAppStationApplication.java index e1fd27b..6cac847 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/RailwayAppStationApplication.java +++ b/railway-app-station/src/main/java/com/railway/station_service/RailwayAppStationApplication.java @@ -4,11 +4,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowire; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.stream.annotation.EnableBinding; import org.springframework.context.annotation.Bean; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; import com.railway.station_service.adapters.messaging.Channels; import com.railway.station_service.domain.Address; @@ -31,26 +34,30 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase (StationRepository stationRepository, PlatformRepository platformRepository, ScheduleItemRepository scheduleItemRepository) { - return(args)->{ + return(args)->{ this.stationRepository = stationRepository; this.platformRepository = platformRepository; - - createStation(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters", "Koningin Maria Hendrikaplein 1", "Gent", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort", "Oktrooiplein 10", "Gent", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk", "Stationsplein 8", "Kortrijk", "West-Vlaanderen", "België"); - createStation(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem", "Noorderlaan 71", "Waregem", "West-Vlaanderen", "België"); - createStation(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter", "Stationsplein 2", "Aalter", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte", "Stationsstraat 25", "De Pinte", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze", "Statieplein 4", "Deinze", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo", "Koningin Astridplein 1", "Eeklo", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem", "Wondelgemstationplein 36", "Wondelgem", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde", "Stationplein 1 Gewest", "Oudenaarde", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem", "Stationsplein 12", "Zottegem", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw", "Stationsplein", "Denderleeuw", "Oost-Vlaanderen", "België"); - createStation(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid", "Fonsnylaan 47b", "Brussel", "Brussels", "België"); + +// platformRepository.deleteAll(); +// stationRepository.deleteAll(); +// +// createStation(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters", "Koningin Maria Hendrikaplein 1", "Gent", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort", "Oktrooiplein 10", "Gent", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk", "Stationsplein 8", "Kortrijk", "West-Vlaanderen", "België"); +// createStation(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem", "Noorderlaan 71", "Waregem", "West-Vlaanderen", "België"); +// createStation(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter", "Stationsplein 2", "Aalter", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte", "Stationsstraat 25", "De Pinte", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze", "Statieplein 4", "Deinze", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo", "Koningin Astridplein 1", "Eeklo", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem", "Wondelgemstationplein 36", "Wondelgem", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde", "Stationplein 1 Gewest", "Oudenaarde", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem", "Stationsplein 12", "Zottegem", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw", "Stationsplein", "Denderleeuw", "Oost-Vlaanderen", "België"); +// createStation(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid", "Fonsnylaan 47b", "Brussel", "Brussels", "België"); }; } + @Transactional(isolation = Isolation.SERIALIZABLE) public void createStation(UUID id, String name, String street, String city, String province, String country) { Address address = new Address(street, city, province, country); Station station = new Station(name, address); diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java index 28a79cc..3b59d96 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java @@ -4,6 +4,8 @@ import java.util.List; import java.util.UUID; +import javax.transaction.Transactional; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -18,10 +20,12 @@ import org.springframework.web.bind.annotation.RestController; import com.railway.station_service.adapters.messaging.MessageGateway; +import com.railway.station_service.domain.Address; import com.railway.station_service.domain.Platform; import com.railway.station_service.domain.ScheduleItemResponse; import com.railway.station_service.domain.Station; import com.railway.station_service.domain.exception.BadRequestException; +import com.railway.station_service.persistence.PlatformRepository; import com.railway.station_service.persistence.ScheduleItemRepository; import com.railway.station_service.persistence.StationRepository; @@ -29,16 +33,66 @@ @RequestMapping("/station") public class StationRestController { private final StationRepository stationRepository; + private final PlatformRepository platformRepository; private final ScheduleItemRepository scheduleItemRepository; private MessageGateway gateway; @Autowired - public StationRestController(StationRepository stationRepository, ScheduleItemRepository scheduleItemRepository, MessageGateway gateway) { + public StationRestController(StationRepository stationRepository, PlatformRepository platformRepository, ScheduleItemRepository scheduleItemRepository, MessageGateway gateway) { this.stationRepository = stationRepository; + this.platformRepository = platformRepository; this.scheduleItemRepository = scheduleItemRepository; this.gateway = gateway; } + // Initial stations shouldn't be created in a bean on startup because + // they would get created again if a service is scaled or restarted by kubernetes + @PostMapping("/init") + @ResponseStatus(HttpStatus.OK) + @Transactional + public void initStations(){ + stationRepository.deleteAll(); + + createStation(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters", "Koningin Maria Hendrikaplein 1", "Gent", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort", "Oktrooiplein 10", "Gent", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk", "Stationsplein 8", "Kortrijk", "West-Vlaanderen", "België"); + createStation(UUID.fromString("73df5f20-33e9-4518-bc23-3cf143c59198"), "Waregem", "Noorderlaan 71", "Waregem", "West-Vlaanderen", "België"); + createStation(UUID.fromString("bc51f294-6823-41cd-be82-d5ba2da4b04d"), "Aalter", "Stationsplein 2", "Aalter", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("d6951807-1fcc-4966-aa30-d4f399685a90"), "De Pinte", "Stationsstraat 25", "De Pinte", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("1454163f-f24f-490f-9e06-f97ffaf008e3"), "Deinze", "Statieplein 4", "Deinze", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("4181c609-7ed5-473e-befe-8013cd75c24c"), "Eeklo", "Koningin Astridplein 1", "Eeklo", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("7b8d9768-7310-4b7d-b6e4-f58abbeac63e"), "Wondelgem", "Wondelgemstationplein 36", "Wondelgem", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("5514be96-c4f1-4dd7-ace4-ac5cbd29c17d"), "Oudenaarde", "Stationplein 1 Gewest", "Oudenaarde", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("5b659978-1c39-4372-97ec-a6e4d1418ef3"), "Zottegem", "Stationsplein 12", "Zottegem", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("b44c17fc-6df1-4808-83d6-838f5637c9c7"), "Denderleeuw", "Stationsplein", "Denderleeuw", "Oost-Vlaanderen", "België"); + createStation(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid", "Fonsnylaan 47b", "Brussel", "Brussels", "België"); + } + + @Transactional + private void createStation(UUID id, String name, String street, String city, String province, String country) { + Address address = new Address(street, city, province, country); + Station station = new Station(id, name, address); + + Platform p1 = new Platform(1); + Platform p2 = new Platform(2); + Platform p3 = new Platform(3); +// platformRepository.save(p1); +// platformRepository.save(p2); +// platformRepository.save(p3); + + station.getPlatforms().add(p1); + station.getPlatforms().add(p2); + station.getPlatforms().add(p3); + stationRepository.save(station); + +// p1.setStation(station); +// p2.setStation(station); +// p3.setStation(station); +// platformRepository.save(p1); +// platformRepository.save(p2); +// platformRepository.save(p3); + } + @GetMapping public Iterable getStations(){ return this.stationRepository.findAll(); diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java b/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java index 3636305..502e673 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java @@ -4,7 +4,14 @@ import java.util.List; import java.util.UUID; -import javax.persistence.*; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Embedded; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; @Entity @Table(name = "station") @@ -17,7 +24,7 @@ public class Station { @Embedded private Address address; - @OneToMany(fetch = FetchType.EAGER, mappedBy = "station") + @OneToMany(fetch = FetchType.EAGER, mappedBy = "station", cascade = CascadeType.ALL) private List platforms = new ArrayList(); @SuppressWarnings("unused") @@ -29,13 +36,17 @@ public Station(UUID id) { this.id = id; } - public Station(String name, Address address) { - // in production the "id" field should be an auto-generated field but this is easier for development/testing purposes - this(UUID.randomUUID()); + public Station(UUID id, String name, Address address) { + this.id = id; this.name = name; this.address = address; } + public Station(String name, Address address) { + // the "id" field should be an auto-generated field but this is easier for development/testing purposes + this(UUID.randomUUID(), name, address); + } + public List getPlatforms() { return platforms; } diff --git a/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java b/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java index 95accb8..1580492 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java +++ b/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java @@ -3,8 +3,8 @@ import java.util.List; import java.util.UUID; +import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -12,8 +12,8 @@ import com.railway.station_service.domain.Station; @Repository -public interface StationRepository extends CrudRepository{ - List findByName(@Param("name") String name); +public interface StationRepository extends JpaRepository{ + Station findByName(@Param("name") String name); @Query("select s.platforms from Station s where s.id = ?1") List getPlatformsByStationId(UUID id); diff --git a/railway-app-station/src/main/resources/application.properties b/railway-app-station/src/main/resources/application.properties index 41a725b..04a535b 100644 --- a/railway-app-station/src/main/resources/application.properties +++ b/railway-app-station/src/main/resources/application.properties @@ -1,6 +1,14 @@ server.port=2002 -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console + +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://station-db:3306/Station +spring.datasource.username=root +spring.datasource.password=stationdatabase +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.reserve_stations.content-type=application/json spring.cloud.stream.bindings.reserve_stations.destination=reserve_stations diff --git a/railway-app-ticket-sale/pom.xml b/railway-app-ticket-sale/pom.xml index dfb127e..5e8e175 100644 --- a/railway-app-ticket-sale/pom.xml +++ b/railway-app-ticket-sale/pom.xml @@ -43,11 +43,7 @@ org.springframework.boot spring-boot-starter-data-jpa - - com.h2database - h2 - runtime - + org.springframework.boot spring-boot-starter-web @@ -74,6 +70,11 @@ spring-cloud-stream-test-support test + + mysql + mysql-connector-java + runtime + diff --git a/railway-app-ticket-sale/src/main/java/com/railway/ticket_sale_service/RailwayAppTicketSaleApplication.java b/railway-app-ticket-sale/src/main/java/com/railway/ticket_sale_service/RailwayAppTicketSaleApplication.java index 68908e8..fe76673 100644 --- a/railway-app-ticket-sale/src/main/java/com/railway/ticket_sale_service/RailwayAppTicketSaleApplication.java +++ b/railway-app-ticket-sale/src/main/java/com/railway/ticket_sale_service/RailwayAppTicketSaleApplication.java @@ -16,7 +16,7 @@ @SpringBootApplication @EnableBinding(Channels.class) public class RailwayAppTicketSaleApplication { - private static Logger logger = LoggerFactory.getLogger(RailwayAppTicketSaleApplication.class); +// private static Logger logger = LoggerFactory.getLogger(RailwayAppTicketSaleApplication.class); public static void main(String[] args) { SpringApplication.run(RailwayAppTicketSaleApplication.class, args); @@ -25,17 +25,17 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(TicketRepository ticketRepository) { return (args) -> { - logger.info("Create some tickets to test the repository ..."); - - ticketRepository.deleteAll(); - - Ticket singleTicket1 = new Ticket("Gent", "Brussel", LocalDateTime.now(), 1L, 9.70, 1); - Ticket groupTicket1 = new Ticket("Oudenaarde", "Kortrijk", LocalDateTime.now(), 2L, 153.40, 16); - - ticketRepository.save(singleTicket1); - ticketRepository.save(groupTicket1); - - ticketRepository.findAll().forEach(ticket -> logger.info(ticket.toString())); +// logger.info("Create some tickets to test the repository ..."); +// +// ticketRepository.deleteAll(); +// +// Ticket singleTicket1 = new Ticket("Gent", "Brussel", LocalDateTime.now(), 1L, 9.70, 1); +// Ticket groupTicket1 = new Ticket("Oudenaarde", "Kortrijk", LocalDateTime.now(), 2L, 153.40, 16); +// +// ticketRepository.save(singleTicket1); +// ticketRepository.save(groupTicket1); +// +// ticketRepository.findAll().forEach(ticket -> logger.info(ticket.toString())); }; } } diff --git a/railway-app-ticket-sale/src/main/resources/application.properties b/railway-app-ticket-sale/src/main/resources/application.properties index 29454e0..67b08b5 100644 --- a/railway-app-ticket-sale/src/main/resources/application.properties +++ b/railway-app-ticket-sale/src/main/resources/application.properties @@ -1,7 +1,13 @@ server.port=2007 -# http://localhost:2007/h2-console -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console + +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://ticket-sale-db:3306/TicketSale +spring.datasource.username=root +spring.datasource.password=ticketsaledatabase +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container spring.cloud.stream.bindings.ticket_created.content-type=application/json spring.cloud.stream.bindings.ticket_created.destination=ticket_created diff --git a/railway-app-ticket-validation/pom.xml b/railway-app-ticket-validation/pom.xml index cd00936..5be8bdc 100644 --- a/railway-app-ticket-validation/pom.xml +++ b/railway-app-ticket-validation/pom.xml @@ -47,11 +47,7 @@ org.springframework.boot spring-boot-starter-web - - com.h2database - h2 - runtime - + org.springframework.kafka spring-kafka @@ -74,6 +70,11 @@ spring-cloud-stream-test-support test + + mysql + mysql-connector-java + runtime + diff --git a/railway-app-ticket-validation/src/main/java/com/railway/ticket_validation_service/RailwayAppTicketValidationApplication.java b/railway-app-ticket-validation/src/main/java/com/railway/ticket_validation_service/RailwayAppTicketValidationApplication.java index 62ff926..c069149 100644 --- a/railway-app-ticket-validation/src/main/java/com/railway/ticket_validation_service/RailwayAppTicketValidationApplication.java +++ b/railway-app-ticket-validation/src/main/java/com/railway/ticket_validation_service/RailwayAppTicketValidationApplication.java @@ -17,7 +17,7 @@ @SpringBootApplication @EnableBinding(Channels.class) public class RailwayAppTicketValidationApplication { - private static Logger logger = LoggerFactory.getLogger(TicketRepository.class); +// private static Logger logger = LoggerFactory.getLogger(TicketRepository.class); public static void main(String[] args) { SpringApplication.run(RailwayAppTicketValidationApplication.class, args); @@ -26,17 +26,17 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(TicketRepository ticketRepository) { return (args) -> { - logger.info("Create some tickets to test the repository ..."); - - ticketRepository.deleteAll(); - - Ticket singleTicket = new Ticket(92L, "Gent", "Brussel", LocalDateTime.now(), 1, UUID.randomUUID()); - Ticket groupTicket = new Ticket(99L, "Oudenaarde", "Brussel", LocalDateTime.now(), 16, UUID.randomUUID()); - - ticketRepository.save(singleTicket); - ticketRepository.save(groupTicket); - - ticketRepository.findAll().forEach(ticket -> logger.info(ticket.toString())); +// logger.info("Create some tickets to test the repository ..."); +// +// ticketRepository.deleteAll(); +// +// Ticket singleTicket = new Ticket(92L, "Gent", "Brussel", LocalDateTime.now(), 1, UUID.randomUUID()); +// Ticket groupTicket = new Ticket(99L, "Oudenaarde", "Brussel", LocalDateTime.now(), 16, UUID.randomUUID()); +// +// ticketRepository.save(singleTicket); +// ticketRepository.save(groupTicket); +// +// ticketRepository.findAll().forEach(ticket -> logger.info(ticket.toString())); }; } } diff --git a/railway-app-ticket-validation/src/main/resources/application.properties b/railway-app-ticket-validation/src/main/resources/application.properties index 5e160e4..cb0f82d 100644 --- a/railway-app-ticket-validation/src/main/resources/application.properties +++ b/railway-app-ticket-validation/src/main/resources/application.properties @@ -1,4 +1,13 @@ server.port=2008 +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://ticket-validation-db:3306/TicketValidation +spring.datasource.username=root +spring.datasource.password=ticketvalidationdatabase +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.ticket_created.content-type=application/json -spring.cloud.stream.bindings.ticket_created.destination=ticket_created +spring.cloud.stream.bindings.ticket_created.destination=ticket_created \ No newline at end of file diff --git a/railway-app-timetable/pom.xml b/railway-app-timetable/pom.xml index 410ad9d..0ded6c9 100644 --- a/railway-app-timetable/pom.xml +++ b/railway-app-timetable/pom.xml @@ -30,11 +30,7 @@ - - com.h2database - h2 - runtime - + org.springframework.boot spring-boot-starter-data-jpa @@ -65,6 +61,11 @@ spring-kafka-test test + + mysql + mysql-connector-java + runtime + diff --git a/railway-app-timetable/src/main/resources/application.properties b/railway-app-timetable/src/main/resources/application.properties index b5b7dd6..c10299f 100644 --- a/railway-app-timetable/src/main/resources/application.properties +++ b/railway-app-timetable/src/main/resources/application.properties @@ -1,7 +1,13 @@ server.port=2001 -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://timetable-db:3306/Timetable +spring.datasource.username=root +spring.datasource.password=timetabledatabase +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container spring.cloud.stream.bindings.get_route.content-type=application/json spring.cloud.stream.bindings.get_route.destination=get_route @@ -58,4 +64,4 @@ spring.cloud.stream.bindings.route_usage_checked.content-type=application/json spring.cloud.stream.bindings.route_usage_checked.destination=route_usage_checked spring.cloud.stream.bindings.notify_train_out_of_service.content-type=application/json -spring.cloud.stream.bindings.notify_train_out_of_service.destination=notify_train_out_of_service +spring.cloud.stream.bindings.notify_train_out_of_service.destination=notify_train_out_of_service \ No newline at end of file diff --git a/railway-app-train/src/main/java/com/railway/train_service/RailwayAppTrainApplication.java b/railway-app-train/src/main/java/com/railway/train_service/RailwayAppTrainApplication.java index 036e2e6..511a0be 100644 --- a/railway-app-train/src/main/java/com/railway/train_service/RailwayAppTrainApplication.java +++ b/railway-app-train/src/main/java/com/railway/train_service/RailwayAppTrainApplication.java @@ -26,28 +26,26 @@ public static void main(String[] args) { @Bean public CommandLineRunner populateDatabase(TrainRepository trainRepository) { - return (args) -> { - trainRepository.deleteAll(); - - TechnicalDetails technicalDetails01 = new TechnicalDetails(FuelType.DIESEL); - TechnicalDetails technicalDetails02 = new TechnicalDetails(FuelType.HYBRID); - TechnicalDetails technicalDetails03 = new TechnicalDetails(FuelType.HYBRID); - TechnicalDetails technicalDetails04 = new TechnicalDetails(FuelType.ELECTRIC); - - Train train01 = new Train(TrainType.IC, 150, 60, technicalDetails01); - Train train02 = new Train(TrainType.IR, 150, 60, technicalDetails02); - Train train03 = new Train(TrainType.IR, 140, 50, technicalDetails03); - Train train04 = new Train(TrainType.P, 100, 30, technicalDetails04); - - trainRepository.save(train01); - trainRepository.save(train02); - trainRepository.save(train03); - trainRepository.save(train04); - - logger.info("Train01: " + train01.toString()); - logger.info("Train02: " + train02.toString()); - logger.info("Train03: " + train03.toString()); - logger.info("Train04: " + train04.toString()); + return (args) -> { +// TechnicalDetails technicalDetails01 = new TechnicalDetails(FuelType.DIESEL); +// TechnicalDetails technicalDetails02 = new TechnicalDetails(FuelType.HYBRID); +// TechnicalDetails technicalDetails03 = new TechnicalDetails(FuelType.HYBRID); +// TechnicalDetails technicalDetails04 = new TechnicalDetails(FuelType.ELECTRIC); +// +// Train train01 = new Train(TrainType.IC, 150, 60, technicalDetails01); +// Train train02 = new Train(TrainType.IR, 150, 60, technicalDetails02); +// Train train03 = new Train(TrainType.IR, 140, 50, technicalDetails03); +// Train train04 = new Train(TrainType.P, 100, 30, technicalDetails04); +// +// trainRepository.save(train01); +// trainRepository.save(train02); +// trainRepository.save(train03); +// trainRepository.save(train04); +// +// logger.info("Train01: " + train01.toString()); +// logger.info("Train02: " + train02.toString()); +// logger.info("Train03: " + train03.toString()); +// logger.info("Train04: " + train04.toString()); }; } } diff --git a/railway-app-train/src/main/resources/application.properties b/railway-app-train/src/main/resources/application.properties index ce21868..15bccf8 100644 --- a/railway-app-train/src/main/resources/application.properties +++ b/railway-app-train/src/main/resources/application.properties @@ -1,5 +1,11 @@ server.port=2003 +spring.data.mongodb.host=train-db +spring.data.mongodb.port=27017 + +spring.cloud.stream.kafka.binder.brokers=kafka-container +spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container + spring.cloud.stream.bindings.reserve_train.content-type=application/json spring.cloud.stream.bindings.reserve_train.destination=reserve_train From 21842b2ddbf91b447db7f3120ae2e2ac174b9649 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Mon, 30 Dec 2019 14:07:11 +0100 Subject: [PATCH 04/42] Fix station repo --- .../adapters/rest/StationRestController.java | 53 +++++++++---------- .../station_service/domain/Station.java | 7 ++- .../persistence/StationRepository.java | 4 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java index 3b59d96..91799b0 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/rest/StationRestController.java @@ -1,11 +1,10 @@ package com.railway.station_service.adapters.rest; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.UUID; -import javax.transaction.Transactional; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -49,10 +48,7 @@ public StationRestController(StationRepository stationRepository, PlatformReposi // they would get created again if a service is scaled or restarted by kubernetes @PostMapping("/init") @ResponseStatus(HttpStatus.OK) - @Transactional - public void initStations(){ - stationRepository.deleteAll(); - + public void initStations(){ createStation(UUID.fromString("11018de0-1943-42b2-929d-a707f751f79c"), "Gent-Sint-Pieters", "Koningin Maria Hendrikaplein 1", "Gent", "Oost-Vlaanderen", "België"); createStation(UUID.fromString("a39b1971-fc82-49b2-809a-444105e03c8d"), "Gent-Dampoort", "Oktrooiplein 10", "Gent", "Oost-Vlaanderen", "België"); createStation(UUID.fromString("cf204af6-a407-47ea-af89-f0f989e7bd8a"), "Kortrijk", "Stationsplein 8", "Kortrijk", "West-Vlaanderen", "België"); @@ -68,29 +64,30 @@ public void initStations(){ createStation(UUID.fromString("05cce0f7-1409-4224-926a-db3b4c4a8ce5"), "Brussel-Zuid", "Fonsnylaan 47b", "Brussel", "Brussels", "België"); } - @Transactional private void createStation(UUID id, String name, String street, String city, String province, String country) { - Address address = new Address(street, city, province, country); - Station station = new Station(id, name, address); + if(stationRepository.findByName(name) == null) { + Address address = new Address(street, city, province, country); + Station station = new Station(id, name, address); - Platform p1 = new Platform(1); - Platform p2 = new Platform(2); - Platform p3 = new Platform(3); -// platformRepository.save(p1); -// platformRepository.save(p2); -// platformRepository.save(p3); - - station.getPlatforms().add(p1); - station.getPlatforms().add(p2); - station.getPlatforms().add(p3); - stationRepository.save(station); - -// p1.setStation(station); -// p2.setStation(station); -// p3.setStation(station); -// platformRepository.save(p1); -// platformRepository.save(p2); -// platformRepository.save(p3); + Platform p1 = new Platform(1); + Platform p2 = new Platform(2); + Platform p3 = new Platform(3); + p1 = platformRepository.save(p1); + p2 = platformRepository.save(p2); + p3 = platformRepository.save(p3); + + station.getPlatforms().add(p1); + station.getPlatforms().add(p2); + station.getPlatforms().add(p3); + station = stationRepository.save(station); + + p1.setStation(station); + p2.setStation(station); + p3.setStation(station); + platformRepository.save(p1); + platformRepository.save(p2); + platformRepository.save(p3); + } } @GetMapping @@ -100,7 +97,7 @@ public Iterable getStations(){ @GetMapping("/{id}") public ResponseEntity stationById(@PathVariable UUID id) { - Station station = stationRepository.getStationById(id); + Station station = stationRepository.findById(id).orElse(null); if(station != null) { return new ResponseEntity<>(station, HttpStatus.OK); } diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java b/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java index 502e673..2480166 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/Station.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.UUID; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; @@ -13,18 +12,22 @@ import javax.persistence.OneToMany; import javax.persistence.Table; +import org.hibernate.annotations.Type; + @Entity @Table(name = "station") public class Station { @Id + @Type(type="org.hibernate.type.UUIDCharType") private UUID id; + @Column(unique = true) private String name; @Embedded private Address address; - @OneToMany(fetch = FetchType.EAGER, mappedBy = "station", cascade = CascadeType.ALL) + @OneToMany(fetch = FetchType.EAGER, mappedBy = "station") private List platforms = new ArrayList(); @SuppressWarnings("unused") diff --git a/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java b/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java index 1580492..d539cf4 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java +++ b/railway-app-station/src/main/java/com/railway/station_service/persistence/StationRepository.java @@ -3,8 +3,8 @@ import java.util.List; import java.util.UUID; -import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -12,7 +12,7 @@ import com.railway.station_service.domain.Station; @Repository -public interface StationRepository extends JpaRepository{ +public interface StationRepository extends CrudRepository{ Station findByName(@Param("name") String name); @Query("select s.platforms from Station s where s.id = ?1") From 337229f88856abd61feb500cba7b17355b88ce35 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Mon, 30 Dec 2019 14:07:42 +0100 Subject: [PATCH 05/42] Update readme --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 507f0a0..aa2c0a8 100644 --- a/README.md +++ b/README.md @@ -1 +1,13 @@ -# RailwayCompany \ No newline at end of file +# Railway application + +## Run all the services + +``` +bash build.sh && docker-compose up --build +``` + +To initialise a basic railway network with stations, use the following REST calls; +``` +curl -X POST http://localhost:8080/network/init +curl -X POST http://localhost:8080/station/init +``` From a3337abf63ec5a475a8d68c9db13a258048bb247 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Thu, 2 Jan 2020 17:12:59 +0100 Subject: [PATCH 06/42] Dockerize frontend --- docker-compose.yaml | 13 +++++++++++ railway-app-frontend/Dockerfile | 22 +++++++++++++++++++ railway-app-frontend/nginx/nginx.conf | 15 +++++++++++++ .../src/components/NetworkPage.js | 4 ++++ 4 files changed, 54 insertions(+) create mode 100644 railway-app-frontend/Dockerfile create mode 100644 railway-app-frontend/nginx/nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml index 529ef51..32aa5fb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -193,3 +193,16 @@ services: - train-service ports: - 8080:8080 + + frontend: + build: ./railway-app-frontend + volumes: + - ./railway-app-frontend/target:/app + links: + - apigateway + - route-db + depends_on: + - apigateway + - route-db + ports: + - 80:80 diff --git a/railway-app-frontend/Dockerfile b/railway-app-frontend/Dockerfile new file mode 100644 index 0000000..d691424 --- /dev/null +++ b/railway-app-frontend/Dockerfile @@ -0,0 +1,22 @@ +# build stage +FROM node:12.2.0-alpine AS build + +WORKDIR /app + +RUN npm install --silent + +COPY . . + +RUN npm run build + +# production stage +FROM nginx:1.16.0-alpine + +WORKDIR /app +COPY --from=build /app/build /usr/share/nginx/html + +RUN rm /etc/nginx/conf.d/default.conf +COPY nginx/nginx.conf /etc/nginx/conf.d + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/railway-app-frontend/nginx/nginx.conf b/railway-app-frontend/nginx/nginx.conf new file mode 100644 index 0000000..80f79f1 --- /dev/null +++ b/railway-app-frontend/nginx/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root /usr/share/nginx/html; + } +} diff --git a/railway-app-frontend/src/components/NetworkPage.js b/railway-app-frontend/src/components/NetworkPage.js index 930770b..516a0dc 100644 --- a/railway-app-frontend/src/components/NetworkPage.js +++ b/railway-app-frontend/src/components/NetworkPage.js @@ -37,6 +37,10 @@ export default class NetworkPage extends Component { .then((result) => { this.setState({ routes: result.data }); + if(this.state.routes.length === 0) { + this.setState({ isRoutesLoading: false }); + } + this.state.routes.forEach((route, routeIndex) => { endpoints.getStationsOnRoute(route.id) .then((result) => { From b916a55c952073d2127ec0ac663ab60023ff2e83 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Thu, 2 Jan 2020 21:13:50 +0100 Subject: [PATCH 07/42] Add redis to docker compose --- docker-compose.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 32aa5fb..deacfe1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -22,6 +22,9 @@ services: - 7687:7687 # not good to expose a database port but this is just for the purpose of the frontend (graph visualisation) + delay-request-db: + image: redis + staff-db: image: mongo train-db: @@ -111,10 +114,12 @@ services: - kafka-container - zookeeper-container - station-db + - delay-request-db depends_on: - kafka-container - zookeeper-container - station-db + - delay-request-db ticket-sale-service: build: ./railway-app-ticket-sale volumes: From 87c4440ebe3009b9f890359ef8fd1ad6e9c7ac7d Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 4 Jan 2020 00:20:08 +0100 Subject: [PATCH 08/42] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa2c0a8..00c1dbf 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ bash build.sh && docker-compose up --build To initialise a basic railway network with stations, use the following REST calls; ``` -curl -X POST http://localhost:8080/network/init curl -X POST http://localhost:8080/station/init +curl -X POST http://localhost:8080/network/init ``` From dfe3562f0e9a96f0f7e3a75639b6e18692fcaa97 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 4 Jan 2020 03:07:52 +0100 Subject: [PATCH 09/42] Partial bug fix --- docker-compose.yaml | 6 ++++++ .../src/components/StaffSchedulePage.js | 6 +++--- .../adapters/messaging/Channels.java | 8 ++++---- .../adapters/messaging/MaintenanceEventHandler.java | 11 +++++++---- .../adapters/messaging/MessageGateway.java | 2 +- .../staff_service/adapters/messaging/Channels.java | 10 +++++++++- .../adapters/messaging/StaffCommandHandler.java | 11 ++++++++++- .../railway/staff_service/domain/StaffService.java | 2 +- railway-app-station/pom.xml | 5 ----- .../adapters/rest/TimetableItemRestAdapter.java | 8 ++++---- .../adapters/rest/TimetableItemRestController.java | 13 ++++++------- .../domain/CreateTimetableItemSaga.java | 6 +++++- .../com/railway/train_service/domain/Train.java | 4 ++-- 13 files changed, 58 insertions(+), 34 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index deacfe1..a876971 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -152,10 +152,16 @@ services: - kafka-container - zookeeper-container - timetable-db + - route-service + - station-service + - train-service depends_on: - kafka-container - zookeeper-container - timetable-db + - route-service + - station-service + - train-service train-service: build: ./railway-app-train volumes: diff --git a/railway-app-frontend/src/components/StaffSchedulePage.js b/railway-app-frontend/src/components/StaffSchedulePage.js index 66839a3..67aaa8e 100644 --- a/railway-app-frontend/src/components/StaffSchedulePage.js +++ b/railway-app-frontend/src/components/StaffSchedulePage.js @@ -23,7 +23,7 @@ export default class StaffSchedulePage extends Component { const { id, requestId, startDate, endDate } = scheduleItem; return ( - {id} + {requestId} {startDate} - {endDate} ); @@ -33,12 +33,12 @@ export default class StaffSchedulePage extends Component { render() { return (
-

Staff Schedules

+

Staff Schedules for staff id {this.props.match.params.id}

{!this.state.isLoading ? ( - + { this.renderStaff() } diff --git a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/Channels.java b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/Channels.java index 1f792eb..7d688c2 100644 --- a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/Channels.java +++ b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/Channels.java @@ -7,8 +7,8 @@ public interface Channels { static final String REQUEST_MAINTENANCE = "request_maintenance"; - static final String RESERVE_STAFF = "reserve_staff"; - static final String STAFF_RESERVED = "staff_reserved"; + static final String RESERVE_STAFF_M = "reserve_staff_m"; + static final String STAFF_RESERVED_M = "staff_reserved_m"; static final String CHANGE_TRAIN_STATUS = "change_train_status"; static final String NOTIFY_ACCIDENT = "notify_accident"; static final String NOTIFY_INFRASTRUCTURE_DAMAGE = "notify_infrastructure_damage"; @@ -19,10 +19,10 @@ public interface Channels { @Input(NOTIFY_ACCIDENT) SubscribableChannel notifyAccident(); - @Output(RESERVE_STAFF) + @Output(RESERVE_STAFF_M) MessageChannel reserveStaff(); - @Input(STAFF_RESERVED) + @Input(STAFF_RESERVED_M) SubscribableChannel staffReserved(); @Output(NOTIFY_INFRASTRUCTURE_DAMAGE) diff --git a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MaintenanceEventHandler.java b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MaintenanceEventHandler.java index 35f82cb..79ef763 100644 --- a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MaintenanceEventHandler.java +++ b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MaintenanceEventHandler.java @@ -19,14 +19,17 @@ public MaintenanceEventHandler(MaintenanceRepository maintenanceRepository) { this.maintenanceRepository = maintenanceRepository; } - @StreamListener(Channels.STAFF_RESERVED) + @StreamListener(Channels.STAFF_RESERVED_M) public void requestMaintenance(StaffResponse response) { logger.info("[Maintenance Event Handler] staff reserved event received"); ScheduleItem scheduleItem = maintenanceRepository.findByRequestId(response.getRequestId()); - scheduleItem.setStaffIds(response.getStaffIds()); - scheduleItem.setStaffReservationMessage(response.getResponseMessage()); - maintenanceRepository.save(scheduleItem); + if(scheduleItem != null) { + scheduleItem.setStaffIds(response.getStaffIds()); + scheduleItem.setStaffReservationMessage(response.getResponseMessage()); + + maintenanceRepository.save(scheduleItem); + } } } diff --git a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MessageGateway.java b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MessageGateway.java index 4102f30..1dd2b17 100644 --- a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MessageGateway.java +++ b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/adapters/messaging/MessageGateway.java @@ -5,7 +5,7 @@ @MessagingGateway public interface MessageGateway { - @Gateway(requestChannel = Channels.RESERVE_STAFF) + @Gateway(requestChannel = Channels.RESERVE_STAFF_M) public void reserveStaff(StaffRequest request); @Gateway(requestChannel = Channels.NOTIFY_INFRASTRUCTURE_DAMAGE) diff --git a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/Channels.java b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/Channels.java index f9bea33..248e602 100644 --- a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/Channels.java +++ b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/Channels.java @@ -7,15 +7,23 @@ public interface Channels { static final String RESERVE_STAFF = "reserve_staff"; + static final String RESERVE_STAFF_M = "reserve_staff_m"; static final String STAFF_RESERVED = "staff_reserved"; + static final String STAFF_RESERVED_M = "staff_reserved_m"; static final String DISCARD_STAFF_RESERVATIONS = "discard_staff_reservations"; - + @Input(RESERVE_STAFF) SubscribableChannel reserveStaff(); + @Input(RESERVE_STAFF_M) + SubscribableChannel reserveStaffMaintenance(); + @Output(STAFF_RESERVED) MessageChannel staffReserved(); + @Output(STAFF_RESERVED_M) + MessageChannel staffReservedMaintenance(); + @Input(DISCARD_STAFF_RESERVATIONS) SubscribableChannel discardStaffReservations(); } diff --git a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java index 10de205..07c22de 100644 --- a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java +++ b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java @@ -21,7 +21,16 @@ public StaffCommandHandler(StaffService staffService) { @StreamListener(Channels.RESERVE_STAFF) @SendTo(Channels.STAFF_RESERVED) - public StaffResponse requestMaintenance(StaffRequest request) { + public StaffResponse reserveStaff(StaffRequest request) { + logger.info("[Staff Command Handler] reserve staff command received"); + + StaffResponse response = staffService.reserveStaff(request.getRequestId(), request.getAmount(), request.getStaffMemberType(), request.getStartDate(), request.getEndDate()); + return response; + } + + @StreamListener(Channels.RESERVE_STAFF_M) + @SendTo(Channels.STAFF_RESERVED_M) + public StaffResponse reserveStaffMaintenance(StaffRequest request) { logger.info("[Staff Command Handler] reserve staff command received"); StaffResponse response = staffService.reserveStaff(request.getRequestId(), request.getAmount(), request.getStaffMemberType(), request.getStartDate(), request.getEndDate()); diff --git a/railway-app-staff/src/main/java/com/railway/staff_service/domain/StaffService.java b/railway-app-staff/src/main/java/com/railway/staff_service/domain/StaffService.java index 4f63aea..0a3c8db 100644 --- a/railway-app-staff/src/main/java/com/railway/staff_service/domain/StaffService.java +++ b/railway-app-staff/src/main/java/com/railway/staff_service/domain/StaffService.java @@ -83,7 +83,7 @@ public void discardStaffReservations(UUID requestId) { Iterator schedule = staffMember.getScheduleItems().iterator(); while(schedule.hasNext()) { ScheduleItem scheduleItem = schedule.next(); - if(scheduleItem.getRequestId().compareTo(requestId) == 0) { + if(scheduleItem != null && scheduleItem.getRequestId() != null && requestId != null && scheduleItem.getRequestId().compareTo(requestId) == 0) { schedule.remove(); staffMembersRepository.save(staffMember); } diff --git a/railway-app-station/pom.xml b/railway-app-station/pom.xml index 8199db2..96bd054 100644 --- a/railway-app-station/pom.xml +++ b/railway-app-station/pom.xml @@ -75,11 +75,6 @@ jedis jar - - redis.clients - jedis - jar - diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestAdapter.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestAdapter.java index 1799429..c29b0ae 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestAdapter.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestAdapter.java @@ -25,7 +25,7 @@ public class TimetableItemRestAdapter { public String getRouteName(Long routeId) { RestTemplate restTemplate = new RestTemplate(); - String url = "http://localhost:2000/network/route"; + String url = "http://route-service:2000/network/route"; ResponseEntity routeResponse = restTemplate.getForEntity(url + "/" + routeId.toString(), String.class); String routeName = null; @@ -44,7 +44,7 @@ public String getRouteName(Long routeId) { public Collection getRoutes(UUID startStationId, UUID endStationId) { RestTemplate restTemplate = new RestTemplate(); - String url = "http://localhost:2000/network/route"; + String url = "http://route-service:2000/network/route"; String endpoint = "?startStationId=" + startStationId.toString() + "&endStationId=" + endStationId.toString(); ResponseEntity> routesResponse = restTemplate.exchange(url + endpoint, HttpMethod.GET, null, new ParameterizedTypeReference>() {}); @@ -58,7 +58,7 @@ public Collection getRoutes(UUID startStationId, UUID endStationId) { public Collection getStationsByTimetableItemId(Long timetableId) { RestTemplate restTemplate = new RestTemplate(); - String url = "http://localhost:2002/station/timetable"; + String url = "http://station-service:2002/station/timetable"; ResponseEntity> scheduleItemResponse = restTemplate.exchange(url + "/" + timetableId.toString(), HttpMethod.GET, null, new ParameterizedTypeReference>() {}); if(scheduleItemResponse != null && scheduleItemResponse.getStatusCode().compareTo(HttpStatus.OK) == 0 && scheduleItemResponse.hasBody()) { @@ -71,7 +71,7 @@ public Collection getStationsByTimetableItemId(Long timeta public SpecificsResponse getSpecifics(String trainId) { RestTemplate restTemplate = new RestTemplate(); - String url = "http://localhost:2003/train"; + String url = "http://train-service:2003/train"; ResponseEntity trainResponse = restTemplate.getForEntity(url + "/" + trainId, String.class); if(trainResponse != null && trainResponse.getStatusCode().compareTo(HttpStatus.OK) == 0) { diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java index 3bd847f..4a008f6 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java @@ -78,6 +78,11 @@ private Collection getAllTimetableItems() { return response; } + @GetMapping("/all/raw") + private Iterable getAllRawTimetableItems() { + return timetableItemRepository.findAll(); + } + @GetMapping("/{id}") private TimetableItem getTimetableItemById(@PathVariable Long id) { TimetableItem timetableItem = timetableItemRepository.findById(id).orElse(null); @@ -147,18 +152,12 @@ private DeferredResult createTimetableItem(@RequestBody Timetable ); deferredResult.onTimeout(() -> { - timetableItem.setStaffIds(new ArrayList<>()); - timetableItemRepository.save(timetableItem); this.timetableService.discardAll(timetableItem); deferredResult.setErrorResult("Request timeout occurred"); }); - if(!isValidTimetableRequest(timetableRequest)) { - timetableItem.setStaffIds(new ArrayList<>()); - timetableItemRepository.save(timetableItem); - timetableItemRepository.delete(timetableItem); - + if(!isValidTimetableRequest(timetableRequest)) { deferredResult.setErrorResult("Request must contain the following fields in the body; \"routeId\", \"startDateTime\", \"requestedTrainType\" and \"amountOfTrainConductors\""); } else { timetableItemRepository.save(timetableItem); diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java index 72b73ca..beabb58 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java @@ -1,6 +1,7 @@ package com.railway.timetable_service.domain; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -271,6 +272,9 @@ public void discardAll(TimetableItem timetableItem) { discardTrainReservation(timetableItem.getId()); discardStaffReservations(timetableItem.getTrainOperatorRequestId()); discardStaffReservations(timetableItem.getTrainConductorRequestId()); - timetableItemRepository.delete(timetableItem); + +// timetableItem.setStaffIds(new ArrayList<>()); +// timetableItemRepository.save(timetableItem); +// timetableItemRepository.delete(timetableItem); } } diff --git a/railway-app-train/src/main/java/com/railway/train_service/domain/Train.java b/railway-app-train/src/main/java/com/railway/train_service/domain/Train.java index c59a5c1..e17f5ec 100644 --- a/railway-app-train/src/main/java/com/railway/train_service/domain/Train.java +++ b/railway-app-train/src/main/java/com/railway/train_service/domain/Train.java @@ -15,7 +15,7 @@ public class Train { private int groupCapacity; private TrainStatus status; private TechnicalDetails technicaldetails; - private List scheduleItems; + private List scheduleItems = new ArrayList<>(); @SuppressWarnings("unused") private Train() {} @@ -27,7 +27,7 @@ public Train(TrainType type, int totalCapacity, int groupCapacity, TrainStatus s this.groupCapacity = groupCapacity; this.status = status; this.technicaldetails = technicaldetails; - this.scheduleItems = scheduleItems; + this.scheduleItems = scheduleItems == null ? new ArrayList<>() : scheduleItems; } public Train(TrainType type, int totalCapacity, int groupCapacity, TechnicalDetails technicaldetails) { From 2961f5eb3b25d539f6ca92316b63bee73ace3e4a Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 4 Jan 2020 03:18:08 +0100 Subject: [PATCH 10/42] Partial bug fix --- .../adapters/rest/TimetableItemRestController.java | 4 +--- .../domain/CreateTimetableItemSaga.java | 11 ----------- .../timetable_service/domain/TimetableService.java | 4 ---- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java index 4a008f6..1fe7bac 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java @@ -151,9 +151,7 @@ private DeferredResult createTimetableItem(@RequestBody Timetable timetableRequest.getAmountOfTrainConductors() ); - deferredResult.onTimeout(() -> { - this.timetableService.discardAll(timetableItem); - + deferredResult.onTimeout(() -> { deferredResult.setErrorResult("Request timeout occurred"); }); diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java index beabb58..b7ad2ab 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/CreateTimetableItemSaga.java @@ -266,15 +266,4 @@ public void createTimetableItemComplete(TimetableItem timetableItem) { logger.info("[Create Timetable Item Saga] successfully created a timetable item"); this.listeners.forEach(l -> l.onCreateTimetableItemResult(timetableItem)); } - - public void discardAll(TimetableItem timetableItem) { - discardStationReservations(timetableItem.getId()); - discardTrainReservation(timetableItem.getId()); - discardStaffReservations(timetableItem.getTrainOperatorRequestId()); - discardStaffReservations(timetableItem.getTrainConductorRequestId()); - -// timetableItem.setStaffIds(new ArrayList<>()); -// timetableItemRepository.save(timetableItem); -// timetableItemRepository.delete(timetableItem); - } } diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java index 2ab983a..3f5f1da 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java @@ -192,10 +192,6 @@ public synchronized void trainReservationChanged(TrainOutOfServiceResponse train throw new NullPointerException(); } } - - public void discardAll(TimetableItem timetableItem) { - createTimetableItemSaga.discardAll(timetableItem); - } public void reserveGroupSeats(GroupSeatsRequest groupSeatsRequest) throws NotEnoughGroupSeatsException { TimetableItem timetableItem = timetableItemRepository.findById(groupSeatsRequest.getTimeTableId()).orElse(null); From 811b70c89c746bd528354bd59cfc981e1fd6a51d Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 4 Jan 2020 14:24:46 +0100 Subject: [PATCH 11/42] Fix staff reservation bug --- .../src/components/StaffPage.js | 1 + railway-app-maintenance/pom.xml | 6 -- .../src/main/resources/application.properties | 8 +-- .../src/main/resources/application.properties | 8 ++- .../rest/TimetableItemRestController.java | 2 +- .../domain/TimetableItem.java | 2 + .../domain/TimetableService.java | 65 +++++++++++-------- .../persistence/TimetableItemRepository.java | 3 + 8 files changed, 55 insertions(+), 40 deletions(-) diff --git a/railway-app-frontend/src/components/StaffPage.js b/railway-app-frontend/src/components/StaffPage.js index 91e6619..c35867e 100644 --- a/railway-app-frontend/src/components/StaffPage.js +++ b/railway-app-frontend/src/components/StaffPage.js @@ -117,6 +117,7 @@ export default class StaffPage extends Component { name='birthdate' onChange={this.createStaffFormChangeHandler} /> +  format: yyyy-mm-dd
diff --git a/railway-app-maintenance/pom.xml b/railway-app-maintenance/pom.xml index 85f37a3..b3702bb 100644 --- a/railway-app-maintenance/pom.xml +++ b/railway-app-maintenance/pom.xml @@ -70,12 +70,6 @@ mysql-connector-java runtime - - org.springframework.cloud - spring-cloud-stream - 3.0.0.RELEASE - compile - diff --git a/railway-app-maintenance/src/main/resources/application.properties b/railway-app-maintenance/src/main/resources/application.properties index 0b832d0..1d0b303 100644 --- a/railway-app-maintenance/src/main/resources/application.properties +++ b/railway-app-maintenance/src/main/resources/application.properties @@ -12,11 +12,11 @@ spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container spring.cloud.stream.bindings.request_maintenance.content-type=application/json spring.cloud.stream.bindings.request_maintenance.destination=request_maintenance -spring.cloud.stream.bindings.reserve_staff.content-type=application/json -spring.cloud.stream.bindings.reserve_staff.destination=reserve_staff +spring.cloud.stream.bindings.reserve_staff_m.content-type=application/json +spring.cloud.stream.bindings.reserve_staff_m.destination=reserve_staff_m -spring.cloud.stream.bindings.staff_reserved.content-type=application/json -spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved +spring.cloud.stream.bindings.staff_reserved_m.content-type=application/json +spring.cloud.stream.bindings.staff_reserved_m.destination=staff_reserved_m spring.cloud.stream.bindings.change_train_status.content-type=application/json spring.cloud.stream.bindings.change_train_status.destination=change_train_status diff --git a/railway-app-staff/src/main/resources/application.properties b/railway-app-staff/src/main/resources/application.properties index 485426e..30e5420 100644 --- a/railway-app-staff/src/main/resources/application.properties +++ b/railway-app-staff/src/main/resources/application.properties @@ -9,5 +9,11 @@ spring.cloud.stream.kafka.binder.zkNodes=zookeeper-container spring.cloud.stream.bindings.reserve_staff.content-type=application/json spring.cloud.stream.bindings.reserve_staff.destination=reserve_staff +spring.cloud.stream.bindings.reserve_staff_m.content-type=application/json +spring.cloud.stream.bindings.reserve_staff_m.destination=reserve_staff_m + spring.cloud.stream.bindings.staff_reserved.content-type=application/json -spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved \ No newline at end of file +spring.cloud.stream.bindings.staff_reserved.destination=staff_reserved + +spring.cloud.stream.bindings.staff_reserved_m.content-type=application/json +spring.cloud.stream.bindings.staff_reserved_m.destination=staff_reserved_m \ No newline at end of file diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java index 1fe7bac..73f5d60 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/rest/TimetableItemRestController.java @@ -142,7 +142,7 @@ private Iterable getTimetableItemByRouteId(@PathVariable Long rou private DeferredResult createTimetableItem(@RequestBody TimetableRequest timetableRequest) { logger.info("[Timetable Item Rest Controller] create timetable item"); - DeferredResult deferredResult = new DeferredResult<>(10000l); + DeferredResult deferredResult = new DeferredResult<>(12000l); TimetableItem timetableItem = new TimetableItem( timetableRequest.getRouteId(), diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableItem.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableItem.java index dac9534..22e37d9 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableItem.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableItem.java @@ -38,7 +38,9 @@ public class TimetableItem { private UUID stationsRequestId; + @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDCharType") private UUID trainOperatorRequestId; + @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDCharType") private UUID trainConductorRequestId; private int requestedTrainConductorsAmount; diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java index 3f5f1da..4097b02 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/domain/TimetableService.java @@ -125,38 +125,47 @@ public synchronized void trainReserved(TrainReservedResponse trainReservedRespon this.createTimetableItemSaga.onTrainReserved(timetableItem); } } - + public synchronized void staffReserved(StaffResponse response) { - // get the timetable item that contains the requestId - TimetableItem timetableItem = timetableItemRepository.findByStaffRequestId(response.getRequestId()); - if(timetableItem != null) { - // if the response has no staff ids it means that the reservation failed - if (response.getStaffIds().size() == 0 || - timetableItem.getTrainReservationStatus() == Status.FAILED || - timetableItem.getStationsReservationStatus() == Status.FAILED || - timetableItem.getStaffReservationStatus() == Status.FAILED) { - this.createTimetableItemSaga.discardTrainReservation(timetableItem.getId()); - this.createTimetableItemSaga.discardStationReservations(timetableItem.getId()); - this.createTimetableItemSaga.discardStaffReservations(timetableItem.getTrainOperatorRequestId()); - this.createTimetableItemSaga.discardStaffReservations(timetableItem.getTrainConductorRequestId()); - return; - } - - // save all staff ids - for (String staffId : response.getStaffIds()) { - synchronized (timetableItem) { - timetableItem = timetableItemRepository.findByStaffRequestId(response.getRequestId()); + // get the timetable item that contains the requestId + TimetableItem timetableItem = timetableItemRepository.findByTrainOperatorRequestId(response.getRequestId()); + if(timetableItem == null) { + timetableItem = timetableItemRepository.findByTrainConductorRequestId(response.getRequestId()); + } + + if(timetableItem == null) { + return; + } + + // if the response has no staff ids it means that the reservation failed + if (response.getStaffIds().size() == 0 || + timetableItem.getTrainReservationStatus() == Status.FAILED || + timetableItem.getStationsReservationStatus() == Status.FAILED || + timetableItem.getStaffReservationStatus() == Status.FAILED) { + this.createTimetableItemSaga.discardTrainReservation(timetableItem.getId()); + this.createTimetableItemSaga.discardStationReservations(timetableItem.getId()); + this.createTimetableItemSaga.discardStaffReservations(timetableItem.getTrainOperatorRequestId()); + this.createTimetableItemSaga.discardStaffReservations(timetableItem.getTrainConductorRequestId()); + return; + } + + // save all staff ids + for (String staffId : response.getStaffIds()) { + synchronized (timetableItem) { + timetableItem = timetableItemRepository.findByStaffRequestId(response.getRequestId()); + + if(timetableItem != null) { timetableItem.addStaffId(staffId); - timetableItemRepository.save(timetableItem); + timetableItem = timetableItemRepository.save(timetableItem); } } - - // if all staff is reserved (train operator[1] train conductor(s)[]) - if (timetableItem.getStaffIds().size() == timetableItem.getRequestedTrainConductorsAmount()+1) { - timetableItem.setStaffReservationStatus(Status.SUCCESSFUL); - timetableItemRepository.save(timetableItem); - this.createTimetableItemSaga.onStaffReserved(timetableItem); - } + } + + // if all staff is reserved (train operator[1] train conductor(s)[]) + if (timetableItem.getStaffIds().size() == timetableItem.getRequestedTrainConductorsAmount()+1) { + timetableItem.setStaffReservationStatus(Status.SUCCESSFUL); + timetableItemRepository.save(timetableItem); + this.createTimetableItemSaga.onStaffReserved(timetableItem); } } diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/persistence/TimetableItemRepository.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/persistence/TimetableItemRepository.java index 835d257..7a716f0 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/persistence/TimetableItemRepository.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/persistence/TimetableItemRepository.java @@ -18,6 +18,9 @@ public interface TimetableItemRepository extends CrudRepository findByRouteIdAndStartDateTimeBetweenOrderByStartDateTime(Long routeId, LocalDateTime fromDate, LocalDateTime toDate); } From 2536a776bed5f9408367e9f70d89c31c3137743f Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 4 Jan 2020 14:36:01 +0100 Subject: [PATCH 12/42] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00c1dbf..6d6324c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Railway application +# Railway System Architecture ## Run all the services @@ -6,7 +6,7 @@ bash build.sh && docker-compose up --build ``` -To initialise a basic railway network with stations, use the following REST calls; +To initialise a basic railway network with stations, use the following REST calls (either both should be executed or none); ``` curl -X POST http://localhost:8080/station/init curl -X POST http://localhost:8080/network/init From 969dfc64c773d173df2b50805d50bb4a5f9e5025 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 8 Jan 2020 20:04:27 +0100 Subject: [PATCH 13/42] Fix dockerfile to build frontend --- railway-app-frontend/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/railway-app-frontend/Dockerfile b/railway-app-frontend/Dockerfile index d691424..fb41ee9 100644 --- a/railway-app-frontend/Dockerfile +++ b/railway-app-frontend/Dockerfile @@ -3,7 +3,9 @@ FROM node:12.2.0-alpine AS build WORKDIR /app -RUN npm install --silent +COPY package*.json ./ + +RUN npm install COPY . . From 7948dc7b7cd5c30e0f69af05472d3c8423108b3e Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 8 Jan 2020 22:43:07 +0100 Subject: [PATCH 14/42] Partial fix for bug in delay --- .../adapters/messaging/Channels.java | 10 +++++++++- .../adapters/messaging/RouteCommandHandler.java | 10 ++++++++++ .../src/main/resources/application.properties | 6 ++++++ .../station_service/adapters/messaging/Channels.java | 8 ++++---- .../adapters/messaging/MessageGateway.java | 2 +- .../adapters/messaging/StationEventHandler.java | 2 +- .../src/main/resources/application.properties | 8 +++++++- 7 files changed, 38 insertions(+), 8 deletions(-) diff --git a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/Channels.java b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/Channels.java index ba0ba7e..e2235f2 100644 --- a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/Channels.java +++ b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/Channels.java @@ -8,19 +8,27 @@ public interface Channels { static final String GET_ROUTE = "get_route"; static final String ROUTE_FETCHED = "route_fetched"; + static final String GET_ROUTE_D = "get_route_d"; + static final String ROUTE_FETCHED_D = "route_fetched_d"; static final String STATION_CREATED = "station_created"; static final String STATION_DELETED = "station_deleted"; static final String GET_ROUTE_DETAILS= "get_route_details"; static final String ROUTE_DETAILS_FETCHED = "route_details_fetched"; static final String CHECK_ROUTE_USAGE = "check_route_usage"; static final String ROUTE_USAGE_CHECKED = "route_usage_checked"; - + @Input(GET_ROUTE) SubscribableChannel getRoute(); @Output(ROUTE_FETCHED) MessageChannel routeFetched(); + @Input(GET_ROUTE_D) + SubscribableChannel getRouteForDelay(); + + @Output(ROUTE_FETCHED_D) + MessageChannel routeFetchedForDelay(); + @Input(STATION_CREATED) MessageChannel stationCreated(); diff --git a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/RouteCommandHandler.java b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/RouteCommandHandler.java index dad6c2b..dcc7db0 100644 --- a/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/RouteCommandHandler.java +++ b/railway-app-route-management/src/main/java/com/railway/route_management_service/adapters/messaging/RouteCommandHandler.java @@ -27,6 +27,16 @@ public RouteCommandHandler(RouteService routeService) { @StreamListener(Channels.GET_ROUTE) @SendTo(Channels.ROUTE_FETCHED) public RouteResponse getRoute(RouteRequest request) { + return getRouteResponse(request); + } + + @StreamListener(Channels.GET_ROUTE_D) + @SendTo(Channels.ROUTE_FETCHED_D) + public RouteResponse getRouteForDelay(RouteRequest request) { + return getRouteResponse(request); + } + + public RouteResponse getRouteResponse(RouteRequest request) { logger.info("[Route Command Handler] get route command received"); Collection routeConnections = routeService.getRouteConnections(request.getRouteId()); Route route = routeService.getRoute(request.getRouteId()); diff --git a/railway-app-route-management/src/main/resources/application.properties b/railway-app-route-management/src/main/resources/application.properties index fb26b87..eed94ef 100644 --- a/railway-app-route-management/src/main/resources/application.properties +++ b/railway-app-route-management/src/main/resources/application.properties @@ -13,6 +13,12 @@ spring.cloud.stream.bindings.get_route.destination=get_route spring.cloud.stream.bindings.route_fetched.content-type=application/json spring.cloud.stream.bindings.route_fetched.destination=route_fetched +spring.cloud.stream.bindings.get_route_d.content-type=application/json +spring.cloud.stream.bindings.get_route_d.destination=get_route_d + +spring.cloud.stream.bindings.route_fetched_d.content-type=application/json +spring.cloud.stream.bindings.route_fetched_d.destination=route_fetched_d + spring.cloud.stream.bindings.station_created.content-type=application/json spring.cloud.stream.bindings.station_created.destination=station_created diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/Channels.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/Channels.java index ec2c97a..9a5f9fd 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/Channels.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/Channels.java @@ -12,8 +12,8 @@ public interface Channels { static final String STATION_CREATED = "station_created"; static final String STATION_DELETED = "station_deleted"; static final String NOTIFY_DELAY = "notify_delay"; - static final String GET_ROUTE = "get_route"; - static final String ROUTE_FETCHED = "route_fetched"; + static final String GET_ROUTE_D = "get_route_d"; + static final String ROUTE_FETCHED_D = "route_fetched_d"; static final String NOTIFY_EXTRA_DELAY = "notify_extra_delay"; @Input(RESERVE_STATIONS) @@ -34,12 +34,12 @@ public interface Channels { @Output(STATION_DELETED) MessageChannel stationDeleted(); - @Output(GET_ROUTE) + @Output(GET_ROUTE_D) MessageChannel getRoute(); @Output(NOTIFY_EXTRA_DELAY) MessageChannel notifyExtraDelay(); - @Input(ROUTE_FETCHED) + @Input(ROUTE_FETCHED_D) SubscribableChannel routeFetched(); } diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/MessageGateway.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/MessageGateway.java index f36b575..5101412 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/MessageGateway.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/MessageGateway.java @@ -13,7 +13,7 @@ public interface MessageGateway { @Gateway(requestChannel = Channels.STATION_DELETED) public void stationDeleted(Station station); - @Gateway(requestChannel = Channels.GET_ROUTE) + @Gateway(requestChannel = Channels.GET_ROUTE_D) public void getRoute(RouteRequest routeRequest); @Gateway(requestChannel = Channels.NOTIFY_EXTRA_DELAY) diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/StationEventHandler.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/StationEventHandler.java index 30ded2c..ee020c9 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/StationEventHandler.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/StationEventHandler.java @@ -18,7 +18,7 @@ public StationEventHandler(StationService stationService) { this.stationService = stationService; } - @StreamListener(Channels.ROUTE_FETCHED) + @StreamListener(Channels.ROUTE_FETCHED_D) public void processFetchedRoute(RouteFetchedResponse response) { if(response.getRouteConnections().size() != 0) { logger.info("[Station Event Handler] successfully fetched route"); diff --git a/railway-app-station/src/main/resources/application.properties b/railway-app-station/src/main/resources/application.properties index 04a535b..dfe7307 100644 --- a/railway-app-station/src/main/resources/application.properties +++ b/railway-app-station/src/main/resources/application.properties @@ -25,4 +25,10 @@ spring.cloud.stream.bindings.notify_delay.content-type=application/json spring.cloud.stream.bindings.notify_delay.destination=notify_delay spring.cloud.stream.bindings.notify_extra_delay.content-type=application/json -spring.cloud.stream.bindings.notify_extra_delay.destination=notify_extra_delay \ No newline at end of file +spring.cloud.stream.bindings.notify_extra_delay.destination=notify_extra_delay + +spring.cloud.stream.bindings.get_route_d.content-type=application/json +spring.cloud.stream.bindings.get_route_d.destination=get_route_d + +spring.cloud.stream.bindings.route_fetched_d.content-type=application/json +spring.cloud.stream.bindings.route_fetched_d.destination=route_fetched_d \ No newline at end of file From f1c419c6d5ebfcd62e8f2883bff80940b8ee431e Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Thu, 9 Jan 2020 16:39:54 +0100 Subject: [PATCH 15/42] Fix bugs in maintenance and delay --- .../adapters/messaging/DelayRequest.java | 8 ++-- .../src/components/DelayPage.js | 4 +- railway-app-maintenance/pom.xml | 2 + .../domain/ScheduleItem.java | 1 + .../messaging/StaffCommandHandler.java | 4 +- .../adapters/messaging/DelayRequest.java | 17 ++++--- .../domain/StationService.java | 48 +++++++++++-------- .../persistence/DelayRequestRepository.java | 2 +- .../adapters/messaging/DelayRequest.java | 8 ++-- 9 files changed, 54 insertions(+), 40 deletions(-) diff --git a/railway-app-delay/src/main/java/com/railway/delay_service/adapters/messaging/DelayRequest.java b/railway-app-delay/src/main/java/com/railway/delay_service/adapters/messaging/DelayRequest.java index f4cb11f..91363e2 100644 --- a/railway-app-delay/src/main/java/com/railway/delay_service/adapters/messaging/DelayRequest.java +++ b/railway-app-delay/src/main/java/com/railway/delay_service/adapters/messaging/DelayRequest.java @@ -6,12 +6,12 @@ public class DelayRequest { private Long timetableId; private Long routeId; - private Long startStationId; + private UUID startStationId; private int delayInMinutes; private String reasonForDelay; private UUID routeRequestId; - public DelayRequest(Long timetableId, Long routeId, Long startStationId, int delayInMinutes, String reasonForDelay) { + public DelayRequest(Long timetableId, Long routeId, UUID startStationId, int delayInMinutes, String reasonForDelay) { this.timetableId = timetableId; this.routeId = routeId; this.startStationId = startStationId; @@ -39,12 +39,12 @@ public void setRouteId(Long routeId) { } - public Long getStartStationId() { + public UUID getStartStationId() { return startStationId; } - public void setStartStationId(Long startStationId) { + public void setStartStationId(UUID startStationId) { this.startStationId = startStationId; } diff --git a/railway-app-frontend/src/components/DelayPage.js b/railway-app-frontend/src/components/DelayPage.js index 54643bd..f51b5cf 100644 --- a/railway-app-frontend/src/components/DelayPage.js +++ b/railway-app-frontend/src/components/DelayPage.js @@ -7,7 +7,7 @@ export default class DelayPage extends Component { this.state = { delay: { - timetableId: null, + timetableId: null, routeId: null, startStationId: null, delayInMinutes: null, @@ -56,7 +56,7 @@ export default class DelayPage extends Component { diff --git a/railway-app-maintenance/pom.xml b/railway-app-maintenance/pom.xml index b3702bb..0d0e6f2 100644 --- a/railway-app-maintenance/pom.xml +++ b/railway-app-maintenance/pom.xml @@ -46,6 +46,8 @@ org.springframework.cloud spring-cloud-stream + 3.0.0.RELEASE + compile org.springframework.cloud diff --git a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/domain/ScheduleItem.java b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/domain/ScheduleItem.java index 6af6cd8..8a1d86e 100644 --- a/railway-app-maintenance/src/main/java/com/railway/maintenance_service/domain/ScheduleItem.java +++ b/railway-app-maintenance/src/main/java/com/railway/maintenance_service/domain/ScheduleItem.java @@ -22,6 +22,7 @@ public class ScheduleItem { @ElementCollection private Collection staffIds; + @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDCharType") private UUID requestId; private String staffReservationMessage; private Status status; diff --git a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java index 07c22de..ee7e1f8 100644 --- a/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java +++ b/railway-app-staff/src/main/java/com/railway/staff_service/adapters/messaging/StaffCommandHandler.java @@ -22,7 +22,7 @@ public StaffCommandHandler(StaffService staffService) { @StreamListener(Channels.RESERVE_STAFF) @SendTo(Channels.STAFF_RESERVED) public StaffResponse reserveStaff(StaffRequest request) { - logger.info("[Staff Command Handler] reserve staff command received"); + logger.info("[Staff Command Handler] reserve staff (timetable) command received"); StaffResponse response = staffService.reserveStaff(request.getRequestId(), request.getAmount(), request.getStaffMemberType(), request.getStartDate(), request.getEndDate()); return response; @@ -31,7 +31,7 @@ public StaffResponse reserveStaff(StaffRequest request) { @StreamListener(Channels.RESERVE_STAFF_M) @SendTo(Channels.STAFF_RESERVED_M) public StaffResponse reserveStaffMaintenance(StaffRequest request) { - logger.info("[Staff Command Handler] reserve staff command received"); + logger.info("[Staff Command Handler] reserve staff (maintenance) command received"); StaffResponse response = staffService.reserveStaff(request.getRequestId(), request.getAmount(), request.getStaffMemberType(), request.getStartDate(), request.getEndDate()); return response; diff --git a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/DelayRequest.java b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/DelayRequest.java index aad0926..dc3c000 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/DelayRequest.java +++ b/railway-app-station/src/main/java/com/railway/station_service/adapters/messaging/DelayRequest.java @@ -11,14 +11,15 @@ public class DelayRequest implements Serializable { private Long timetableId; private Long routeId; - private Long startStationId; + @org.hibernate.annotations.Type(type="org.hibernate.type.UUIDCharType") + private UUID startStationId; private int delayInMinutes; private String reasonForDelay; // routeRequestId is the property that will be used to identify a request in the key-value store @Id - private UUID routeRequestId; + private String routeRequestId; - public DelayRequest(Long timetableId, Long routeId, Long startStationId, int delayInMinutes, String reasonForDelay) { + public DelayRequest(Long timetableId, Long routeId, UUID startStationId, int delayInMinutes, String reasonForDelay) { this.timetableId = timetableId; this.routeId = routeId; this.startStationId = startStationId; @@ -42,11 +43,11 @@ public void setRouteId(Long routeId) { this.routeId = routeId; } - public Long getStartStationId() { + public UUID getStartStationId() { return startStationId; } - public void setStartStationId(Long startStationId) { + public void setStartStationId(UUID startStationId) { this.startStationId = startStationId; } @@ -66,11 +67,15 @@ public void setReasonForDelay(String reasonForDelay) { this.reasonForDelay = reasonForDelay; } - public UUID getRouteRequestId() { + public String getRouteRequestId() { return routeRequestId; } public void setRouteRequestId(UUID routeRequestId) { + this.routeRequestId = routeRequestId.toString(); + } + + public void setRouteRequestId(String routeRequestId) { this.routeRequestId = routeRequestId; } } diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index ee8e473..52e6d4f 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -94,32 +94,34 @@ public void processDelay(DelayRequest delayRequest) { // fetching routes to get all the stations on that route that will be affected by the delay public void routeFetched(RouteFetchedResponse routeFetchedResponse) { // get the delay request in the key-value store and delete it - DelayRequest dr = delayRequestRepository.findByRouteRequestId(routeFetchedResponse.getRequestId()); + DelayRequest dr = delayRequestRepository.findById(routeFetchedResponse.getRequestId()).orElse(null); delayRequestRepository.deleteById(routeFetchedResponse.getRequestId()); if(dr != null) { //find first station of route that will be affected by delay //if no start station is present in delay request then all stations on the given route are notified of the delay StationOnRoute startStation = null; - if(dr.getStartStationId() != null) { - for(RouteConnection rc : routeFetchedResponse.getRoute().getRouteConnections()) { - if(rc.getStation().getId() == dr.getStartStationId()) { - startStation = rc.getStation(); - break; - } - } - } else { - startStation = getStart(routeFetchedResponse.getRoute()); - } + startStation = getStart(routeFetchedResponse.getRoute()); //get following stations on that route List stations = new ArrayList<>(); StationOnRoute previous = startStation; - stations.add(startStation); + + if(dr.getStartStationId() == null) { + stations.add(startStation); + } + StationOnRoute current = null; Collection allRouteConnections = routeFetchedResponse.getRouteConnections(); + + boolean partOfDelay = false; + while(allRouteConnections.size() > 0) { RoutePart routePart = getNextRoutePart(allRouteConnections, UUID.fromString(previous.getStationId())); + if(routePart == null) { + break; + } + // remove route part for next iteration allRouteConnections.removeIf(r -> r.getId() == routePart.getId()); @@ -128,12 +130,18 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { } else { current = routePart.getStationX(); } - stations.add(current); + + if(current.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { + partOfDelay = true; + } + + if(partOfDelay) { + stations.add(current); + } previous=current; } getStationsFromDatabase(stations, dr); } - } private StationOnRoute getStart(Route route) { @@ -161,9 +169,9 @@ private RoutePart getNextRoutePart(Collection allRouteParts, UUID pre private void getStationsFromDatabase(List stations, DelayRequest request) { for (StationOnRoute s : stations) { - requestDelay = request.getDelayInMinutes(); UUID id = UUID.fromString(s.getStationId()); - Station station = stationRepository.findById(id).get(); + requestDelay = request.getDelayInMinutes(); + Station station = stationRepository.findById(id).orElse(null); if (station != null) { logger.info("[getStationsFromDatabase] station found in db " + station.getName()); iteratePlatforms(station, request); @@ -191,10 +199,10 @@ private void iterateScheduleItems(Platform p, DelayRequest request, Station stat } private void addDelay(ScheduleItem item, DelayRequest request, Station station, Platform p) { - logger.info("[getStationsFromDatabase] scheduleItem found "); + logger.info("[getStationsFromDatabase] scheduleItem found"); //original scheduleitem can already have delay -> so total delay is calculated int totalDelay = item.getDelayInMinutes() + requestDelay; - requestDelay = 0; + int requestDelay = 0; LocalDateTime newArrivalTime = item.getArrivalDateTime().plusMinutes(totalDelay); //check if the new arrivaltime causes a conflict with another train on the same platform boolean overlap = newArrivalTimeOverlaps(p, newArrivalTime, item.getId()); @@ -202,9 +210,7 @@ private void addDelay(ScheduleItem item, DelayRequest request, Station station, if(!overlap) { item.setDelayInMinutes(totalDelay); scheduleItemRepository.save(item); - - } - else { + } else { //search new platform starting on time = newArrivalTime Object[] pair = searchNewTimeSlot(station, newArrivalTime,0, item.getId()); //found platform, arrivaltime and additional delay when nothing was available on newArrivalTime diff --git a/railway-app-station/src/main/java/com/railway/station_service/persistence/DelayRequestRepository.java b/railway-app-station/src/main/java/com/railway/station_service/persistence/DelayRequestRepository.java index 92719d6..a70e9b5 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/persistence/DelayRequestRepository.java +++ b/railway-app-station/src/main/java/com/railway/station_service/persistence/DelayRequestRepository.java @@ -9,5 +9,5 @@ @Repository public interface DelayRequestRepository extends CrudRepository { - DelayRequest findByRouteRequestId(UUID routeRequestId); + } diff --git a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/messaging/DelayRequest.java b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/messaging/DelayRequest.java index 220c923..6c079d3 100644 --- a/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/messaging/DelayRequest.java +++ b/railway-app-timetable/src/main/java/com/railway/timetable_service/adapters/messaging/DelayRequest.java @@ -5,12 +5,12 @@ public class DelayRequest { private Long timetableId; private Long routeId; - private Long startStationId; + private UUID startStationId; private int delayInMinutes; private String reasonForDelay; private UUID routeRequestId; - public DelayRequest(Long timetableId, Long routeId, Long startStationId, int delayInMinutes, String reasonForDelay) { + public DelayRequest(Long timetableId, Long routeId, UUID startStationId, int delayInMinutes, String reasonForDelay) { this.timetableId = timetableId; this.routeId = routeId; this.startStationId = startStationId; @@ -39,12 +39,12 @@ public void setRouteId(Long routeId) { } - public Long getStartStationId() { + public UUID getStartStationId() { return startStationId; } - public void setStartStationId(Long startStationId) { + public void setStartStationId(UUID startStationId) { this.startStationId = startStationId; } From 0ada0583e6e846eddfb5b2574aa9f8e029524c76 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Thu, 9 Jan 2020 18:14:31 +0100 Subject: [PATCH 16/42] Add image keys --- docker-compose.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index a876971..2a6c8d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,8 +60,10 @@ services: environment: - MYSQL_ROOT_PASSWORD=timetabledatabase - MYSQL_DATABASE=Timetable + delay-service: build: ./railway-app-delay + image: gilliswerrebrouck/railway-app-delay-service volumes: - ./railway-app-delay/target:/app links: @@ -72,6 +74,7 @@ services: - zookeeper-container maintenance-service: build: ./railway-app-maintenance + image: gilliswerrebrouck/railway-app-maintenance-service volumes: - ./railway-app-maintenance/target:/app links: @@ -84,6 +87,7 @@ services: - maintenance-db route-service: build: ./railway-app-route-management + image: gilliswerrebrouck/railway-app-route-management-service volumes: - ./railway-app-route-management/target:/app links: @@ -96,6 +100,7 @@ services: - route-db staff-service: build: ./railway-app-staff + image: gilliswerrebrouck/railway-app-staff-service volumes: - ./railway-app-staff/target:/app links: @@ -108,6 +113,7 @@ services: - staff-db station-service: build: ./railway-app-station + image: gilliswerrebrouck/railway-app-station-service volumes: - ./railway-app-station/target:/app links: @@ -122,6 +128,7 @@ services: - delay-request-db ticket-sale-service: build: ./railway-app-ticket-sale + image: gilliswerrebrouck/railway-app-ticket-sale-service volumes: - ./railway-app-ticket-sale/target:/app links: @@ -134,6 +141,7 @@ services: - ticket-sale-db ticket-validation-service: build: ./railway-app-ticket-validation + image: gilliswerrebrouck/railway-app-ticket-validation-service volumes: - ./railway-app-ticket-validation/target:/app links: @@ -146,6 +154,7 @@ services: - ticket-validation-db timetable-service: build: ./railway-app-timetable + image: gilliswerrebrouck/railway-app-timetable-service volumes: - ./railway-app-timetable/target:/app links: @@ -164,6 +173,7 @@ services: - train-service train-service: build: ./railway-app-train + image: gilliswerrebrouck/railway-app-train-service volumes: - ./railway-app-train/target:/app links: @@ -176,6 +186,7 @@ services: - train-db apigateway: build: ./railway-app-api-gateway + image: gilliswerrebrouck/railway-app-api-gateway-service volumes: - ./railway-app-api-gateway/target:/app links: @@ -207,6 +218,7 @@ services: frontend: build: ./railway-app-frontend + image: gilliswerrebrouck/railway-app-frontend volumes: - ./railway-app-frontend/target:/app links: From 4987e61bbbef9481bd82c87b949948e775947cbd Mon Sep 17 00:00:00 2001 From: gillis Date: Sat, 11 Jan 2020 04:04:57 -0700 Subject: [PATCH 17/42] Generated kubernetes config (kompose convert ...) --- kubernetes-config/apigateway-deployment.yaml | 38 +++++++++++++++++++ kubernetes-config/apigateway-service.yaml | 19 ++++++++++ .../delay-request-db-deployment.yaml | 28 ++++++++++++++ .../delay-service-deployment.yaml | 36 ++++++++++++++++++ kubernetes-config/frontend-deployment.yaml | 38 +++++++++++++++++++ kubernetes-config/frontend-service.yaml | 19 ++++++++++ .../kafka-container-deployment.yaml | 37 ++++++++++++++++++ .../maintenance-db-deployment.yaml | 35 +++++++++++++++++ .../maintenance-service-deployment.yaml | 36 ++++++++++++++++++ kubernetes-config/route-db-deployment.yaml | 33 ++++++++++++++++ kubernetes-config/route-db-service.yaml | 19 ++++++++++ .../route-service-deployment.yaml | 36 ++++++++++++++++++ kubernetes-config/staff-db-deployment.yaml | 28 ++++++++++++++ .../staff-service-deployment.yaml | 36 ++++++++++++++++++ kubernetes-config/station-db-deployment.yaml | 35 +++++++++++++++++ .../station-service-deployment.yaml | 36 ++++++++++++++++++ .../ticket-sale-db-deployment.yaml | 35 +++++++++++++++++ .../ticket-sale-service-deployment.yaml | 36 ++++++++++++++++++ .../ticket-validation-db-deployment.yaml | 35 +++++++++++++++++ .../ticket-validation-service-deployment.yaml | 36 ++++++++++++++++++ .../timetable-db-deployment.yaml | 35 +++++++++++++++++ .../timetable-service-deployment.yaml | 36 ++++++++++++++++++ kubernetes-config/train-db-deployment.yaml | 28 ++++++++++++++ .../train-service-deployment.yaml | 36 ++++++++++++++++++ .../zookeeper-container-deployment.yaml | 31 +++++++++++++++ 25 files changed, 817 insertions(+) create mode 100644 kubernetes-config/apigateway-deployment.yaml create mode 100644 kubernetes-config/apigateway-service.yaml create mode 100644 kubernetes-config/delay-request-db-deployment.yaml create mode 100644 kubernetes-config/delay-service-deployment.yaml create mode 100644 kubernetes-config/frontend-deployment.yaml create mode 100644 kubernetes-config/frontend-service.yaml create mode 100644 kubernetes-config/kafka-container-deployment.yaml create mode 100644 kubernetes-config/maintenance-db-deployment.yaml create mode 100644 kubernetes-config/maintenance-service-deployment.yaml create mode 100644 kubernetes-config/route-db-deployment.yaml create mode 100644 kubernetes-config/route-db-service.yaml create mode 100644 kubernetes-config/route-service-deployment.yaml create mode 100644 kubernetes-config/staff-db-deployment.yaml create mode 100644 kubernetes-config/staff-service-deployment.yaml create mode 100644 kubernetes-config/station-db-deployment.yaml create mode 100644 kubernetes-config/station-service-deployment.yaml create mode 100644 kubernetes-config/ticket-sale-db-deployment.yaml create mode 100644 kubernetes-config/ticket-sale-service-deployment.yaml create mode 100644 kubernetes-config/ticket-validation-db-deployment.yaml create mode 100644 kubernetes-config/ticket-validation-service-deployment.yaml create mode 100644 kubernetes-config/timetable-db-deployment.yaml create mode 100644 kubernetes-config/timetable-service-deployment.yaml create mode 100644 kubernetes-config/train-db-deployment.yaml create mode 100644 kubernetes-config/train-service-deployment.yaml create mode 100644 kubernetes-config/zookeeper-container-deployment.yaml diff --git a/kubernetes-config/apigateway-deployment.yaml b/kubernetes-config/apigateway-deployment.yaml new file mode 100644 index 0000000..2a7bbb7 --- /dev/null +++ b/kubernetes-config/apigateway-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + spec: + containers: + - image: gilliswerrebrouck/railway-app-api-gateway-service + name: apigateway + ports: + - containerPort: 8080 + resources: {} + volumeMounts: + - mountPath: /app + name: apigateway-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target + name: apigateway-hostpath0 +status: {} diff --git a/kubernetes-config/apigateway-service.yaml b/kubernetes-config/apigateway-service.yaml new file mode 100644 index 0000000..ad1c356 --- /dev/null +++ b/kubernetes-config/apigateway-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway +spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: apigateway +status: + loadBalancer: {} diff --git a/kubernetes-config/delay-request-db-deployment.yaml b/kubernetes-config/delay-request-db-deployment.yaml new file mode 100644 index 0000000..d6c2ef2 --- /dev/null +++ b/kubernetes-config/delay-request-db-deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + name: delay-request-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + spec: + containers: + - image: redis + name: delay-request-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/delay-service-deployment.yaml b/kubernetes-config/delay-service-deployment.yaml new file mode 100644 index 0000000..5179d89 --- /dev/null +++ b/kubernetes-config/delay-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + name: delay-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-delay-service + name: delay-service + resources: {} + volumeMounts: + - mountPath: /app + name: delay-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target + name: delay-service-hostpath0 +status: {} diff --git a/kubernetes-config/frontend-deployment.yaml b/kubernetes-config/frontend-deployment.yaml new file mode 100644 index 0000000..a3d87b9 --- /dev/null +++ b/kubernetes-config/frontend-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + spec: + containers: + - image: gilliswerrebrouck/railway-app-frontend + name: frontend + ports: + - containerPort: 80 + resources: {} + volumeMounts: + - mountPath: /app + name: frontend-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target + name: frontend-hostpath0 +status: {} diff --git a/kubernetes-config/frontend-service.yaml b/kubernetes-config/frontend-service.yaml new file mode 100644 index 0000000..bdcff3b --- /dev/null +++ b/kubernetes-config/frontend-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend +spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: frontend +status: + loadBalancer: {} diff --git a/kubernetes-config/kafka-container-deployment.yaml b/kubernetes-config/kafka-container-deployment.yaml new file mode 100644 index 0000000..94c5b0a --- /dev/null +++ b/kubernetes-config/kafka-container-deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + spec: + containers: + - env: + - name: KAFKA_ADVERTISED_LISTENERS + value: PLAINTEXT://kafka-container:9092 + - name: KAFKA_BROKER_ID + value: "1" + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: "1" + - name: KAFKA_ZOOKEEPER_CONNECT + value: zookeeper-container:2181 + image: confluentinc/cp-kafka + name: kafka-container + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/maintenance-db-deployment.yaml b/kubernetes-config/maintenance-db-deployment.yaml new file mode 100644 index 0000000..b806f3d --- /dev/null +++ b/kubernetes-config/maintenance-db-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Maintenance + - name: MYSQL_ROOT_PASSWORD + value: maintenancedatabase + image: mysql:5.7 + name: maintenance-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/maintenance-service-deployment.yaml b/kubernetes-config/maintenance-service-deployment.yaml new file mode 100644 index 0000000..06742cc --- /dev/null +++ b/kubernetes-config/maintenance-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + name: maintenance-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-maintenance-service + name: maintenance-service + resources: {} + volumeMounts: + - mountPath: /app + name: maintenance-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target + name: maintenance-service-hostpath0 +status: {} diff --git a/kubernetes-config/route-db-deployment.yaml b/kubernetes-config/route-db-deployment.yaml new file mode 100644 index 0000000..e5b62b8 --- /dev/null +++ b/kubernetes-config/route-db-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + spec: + containers: + - env: + - name: NEO4J_AUTH + value: neo4j/route + image: neo4j:3.5.6 + name: route-db + ports: + - containerPort: 7687 + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/route-db-service.yaml b/kubernetes-config/route-db-service.yaml new file mode 100644 index 0000000..46e3037 --- /dev/null +++ b/kubernetes-config/route-db-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db +spec: + ports: + - name: "7687" + port: 7687 + targetPort: 7687 + selector: + io.kompose.service: route-db +status: + loadBalancer: {} diff --git a/kubernetes-config/route-service-deployment.yaml b/kubernetes-config/route-service-deployment.yaml new file mode 100644 index 0000000..261d416 --- /dev/null +++ b/kubernetes-config/route-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + name: route-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-route-management-service + name: route-service + resources: {} + volumeMounts: + - mountPath: /app + name: route-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target + name: route-service-hostpath0 +status: {} diff --git a/kubernetes-config/staff-db-deployment.yaml b/kubernetes-config/staff-db-deployment.yaml new file mode 100644 index 0000000..0fb83e7 --- /dev/null +++ b/kubernetes-config/staff-db-deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + name: staff-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + spec: + containers: + - image: mongo + name: staff-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/staff-service-deployment.yaml b/kubernetes-config/staff-service-deployment.yaml new file mode 100644 index 0000000..1b3ab69 --- /dev/null +++ b/kubernetes-config/staff-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + name: staff-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-staff-service + name: staff-service + resources: {} + volumeMounts: + - mountPath: /app + name: staff-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target + name: staff-service-hostpath0 +status: {} diff --git a/kubernetes-config/station-db-deployment.yaml b/kubernetes-config/station-db-deployment.yaml new file mode 100644 index 0000000..5276e82 --- /dev/null +++ b/kubernetes-config/station-db-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + name: station-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Station + - name: MYSQL_ROOT_PASSWORD + value: stationdatabase + image: mysql:5.7 + name: station-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/station-service-deployment.yaml b/kubernetes-config/station-service-deployment.yaml new file mode 100644 index 0000000..e87f924 --- /dev/null +++ b/kubernetes-config/station-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + name: station-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-station-service + name: station-service + resources: {} + volumeMounts: + - mountPath: /app + name: station-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target + name: station-service-hostpath0 +status: {} diff --git a/kubernetes-config/ticket-sale-db-deployment.yaml b/kubernetes-config/ticket-sale-db-deployment.yaml new file mode 100644 index 0000000..6e6354a --- /dev/null +++ b/kubernetes-config/ticket-sale-db-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + name: ticket-sale-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketSale + - name: MYSQL_ROOT_PASSWORD + value: ticketsaledatabase + image: mysql:5.7 + name: ticket-sale-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/ticket-sale-service-deployment.yaml b/kubernetes-config/ticket-sale-service-deployment.yaml new file mode 100644 index 0000000..9378212 --- /dev/null +++ b/kubernetes-config/ticket-sale-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + name: ticket-sale-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-sale-service + name: ticket-sale-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-sale-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target + name: ticket-sale-service-hostpath0 +status: {} diff --git a/kubernetes-config/ticket-validation-db-deployment.yaml b/kubernetes-config/ticket-validation-db-deployment.yaml new file mode 100644 index 0000000..bc9104e --- /dev/null +++ b/kubernetes-config/ticket-validation-db-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + name: ticket-validation-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketValidation + - name: MYSQL_ROOT_PASSWORD + value: ticketvalidationdatabase + image: mysql:5.7 + name: ticket-validation-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/ticket-validation-service-deployment.yaml b/kubernetes-config/ticket-validation-service-deployment.yaml new file mode 100644 index 0000000..ccd5794 --- /dev/null +++ b/kubernetes-config/ticket-validation-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + name: ticket-validation-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-validation-service + name: ticket-validation-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-validation-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target + name: ticket-validation-service-hostpath0 +status: {} diff --git a/kubernetes-config/timetable-db-deployment.yaml b/kubernetes-config/timetable-db-deployment.yaml new file mode 100644 index 0000000..e27cd95 --- /dev/null +++ b/kubernetes-config/timetable-db-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + name: timetable-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Timetable + - name: MYSQL_ROOT_PASSWORD + value: timetabledatabase + image: mysql:5.7 + name: timetable-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/timetable-service-deployment.yaml b/kubernetes-config/timetable-service-deployment.yaml new file mode 100644 index 0000000..5938f40 --- /dev/null +++ b/kubernetes-config/timetable-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + name: timetable-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-timetable-service + name: timetable-service + resources: {} + volumeMounts: + - mountPath: /app + name: timetable-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target + name: timetable-service-hostpath0 +status: {} diff --git a/kubernetes-config/train-db-deployment.yaml b/kubernetes-config/train-db-deployment.yaml new file mode 100644 index 0000000..3607e76 --- /dev/null +++ b/kubernetes-config/train-db-deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + name: train-db +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + spec: + containers: + - image: mongo + name: train-db + resources: {} + restartPolicy: Always +status: {} diff --git a/kubernetes-config/train-service-deployment.yaml b/kubernetes-config/train-service-deployment.yaml new file mode 100644 index 0000000..6e71fb1 --- /dev/null +++ b/kubernetes-config/train-service-deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + name: train-service +spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-train-service + name: train-service + resources: {} + volumeMounts: + - mountPath: /app + name: train-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target + name: train-service-hostpath0 +status: {} diff --git a/kubernetes-config/zookeeper-container-deployment.yaml b/kubernetes-config/zookeeper-container-deployment.yaml new file mode 100644 index 0000000..ffde87e --- /dev/null +++ b/kubernetes-config/zookeeper-container-deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container +spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + spec: + containers: + - env: + - name: ZOOKEEPER_CLIENT_PORT + value: "2181" + image: confluentinc/cp-zookeeper + name: zookeeper-container + resources: {} + restartPolicy: Always +status: {} From a20cc9f158d4c400b555097acfe00818c393f79d Mon Sep 17 00:00:00 2001 From: gillis Date: Sat, 11 Jan 2020 04:13:57 -0700 Subject: [PATCH 18/42] Regenerated kubernetes config --- kubernetes-config/apigateway-deployment.yaml | 38 - kubernetes-config/apigateway-service.yaml | 19 - .../delay-request-db-deployment.yaml | 28 - .../delay-service-deployment.yaml | 36 - kubernetes-config/frontend-deployment.yaml | 38 - kubernetes-config/frontend-service.yaml | 19 - .../kafka-container-deployment.yaml | 37 - .../maintenance-db-deployment.yaml | 35 - .../maintenance-service-deployment.yaml | 36 - kubernetes-config/route-db-deployment.yaml | 33 - kubernetes-config/route-db-service.yaml | 19 - .../route-service-deployment.yaml | 36 - kubernetes-config/staff-db-deployment.yaml | 28 - .../staff-service-deployment.yaml | 36 - kubernetes-config/station-db-deployment.yaml | 35 - .../station-service-deployment.yaml | 36 - .../ticket-sale-db-deployment.yaml | 35 - .../ticket-sale-service-deployment.yaml | 36 - .../ticket-validation-db-deployment.yaml | 35 - .../ticket-validation-service-deployment.yaml | 36 - .../timetable-db-deployment.yaml | 35 - .../timetable-service-deployment.yaml | 36 - kubernetes-config/train-db-deployment.yaml | 28 - .../train-service-deployment.yaml | 36 - .../zookeeper-container-deployment.yaml | 31 - kubernetes-deployment.yaml | 869 ++++++++++++++++++ 26 files changed, 869 insertions(+), 817 deletions(-) delete mode 100644 kubernetes-config/apigateway-deployment.yaml delete mode 100644 kubernetes-config/apigateway-service.yaml delete mode 100644 kubernetes-config/delay-request-db-deployment.yaml delete mode 100644 kubernetes-config/delay-service-deployment.yaml delete mode 100644 kubernetes-config/frontend-deployment.yaml delete mode 100644 kubernetes-config/frontend-service.yaml delete mode 100644 kubernetes-config/kafka-container-deployment.yaml delete mode 100644 kubernetes-config/maintenance-db-deployment.yaml delete mode 100644 kubernetes-config/maintenance-service-deployment.yaml delete mode 100644 kubernetes-config/route-db-deployment.yaml delete mode 100644 kubernetes-config/route-db-service.yaml delete mode 100644 kubernetes-config/route-service-deployment.yaml delete mode 100644 kubernetes-config/staff-db-deployment.yaml delete mode 100644 kubernetes-config/staff-service-deployment.yaml delete mode 100644 kubernetes-config/station-db-deployment.yaml delete mode 100644 kubernetes-config/station-service-deployment.yaml delete mode 100644 kubernetes-config/ticket-sale-db-deployment.yaml delete mode 100644 kubernetes-config/ticket-sale-service-deployment.yaml delete mode 100644 kubernetes-config/ticket-validation-db-deployment.yaml delete mode 100644 kubernetes-config/ticket-validation-service-deployment.yaml delete mode 100644 kubernetes-config/timetable-db-deployment.yaml delete mode 100644 kubernetes-config/timetable-service-deployment.yaml delete mode 100644 kubernetes-config/train-db-deployment.yaml delete mode 100644 kubernetes-config/train-service-deployment.yaml delete mode 100644 kubernetes-config/zookeeper-container-deployment.yaml create mode 100644 kubernetes-deployment.yaml diff --git a/kubernetes-config/apigateway-deployment.yaml b/kubernetes-config/apigateway-deployment.yaml deleted file mode 100644 index 2a7bbb7..0000000 --- a/kubernetes-config/apigateway-deployment.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - name: apigateway -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - spec: - containers: - - image: gilliswerrebrouck/railway-app-api-gateway-service - name: apigateway - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - mountPath: /app - name: apigateway-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target - name: apigateway-hostpath0 -status: {} diff --git a/kubernetes-config/apigateway-service.yaml b/kubernetes-config/apigateway-service.yaml deleted file mode 100644 index ad1c356..0000000 --- a/kubernetes-config/apigateway-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - name: apigateway -spec: - ports: - - name: "8080" - port: 8080 - targetPort: 8080 - selector: - io.kompose.service: apigateway -status: - loadBalancer: {} diff --git a/kubernetes-config/delay-request-db-deployment.yaml b/kubernetes-config/delay-request-db-deployment.yaml deleted file mode 100644 index d6c2ef2..0000000 --- a/kubernetes-config/delay-request-db-deployment.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-request-db - name: delay-request-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-request-db - spec: - containers: - - image: redis - name: delay-request-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/delay-service-deployment.yaml b/kubernetes-config/delay-service-deployment.yaml deleted file mode 100644 index 5179d89..0000000 --- a/kubernetes-config/delay-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-service - name: delay-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-delay-service - name: delay-service - resources: {} - volumeMounts: - - mountPath: /app - name: delay-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target - name: delay-service-hostpath0 -status: {} diff --git a/kubernetes-config/frontend-deployment.yaml b/kubernetes-config/frontend-deployment.yaml deleted file mode 100644 index a3d87b9..0000000 --- a/kubernetes-config/frontend-deployment.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - name: frontend -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - spec: - containers: - - image: gilliswerrebrouck/railway-app-frontend - name: frontend - ports: - - containerPort: 80 - resources: {} - volumeMounts: - - mountPath: /app - name: frontend-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target - name: frontend-hostpath0 -status: {} diff --git a/kubernetes-config/frontend-service.yaml b/kubernetes-config/frontend-service.yaml deleted file mode 100644 index bdcff3b..0000000 --- a/kubernetes-config/frontend-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - name: frontend -spec: - ports: - - name: "80" - port: 80 - targetPort: 80 - selector: - io.kompose.service: frontend -status: - loadBalancer: {} diff --git a/kubernetes-config/kafka-container-deployment.yaml b/kubernetes-config/kafka-container-deployment.yaml deleted file mode 100644 index 94c5b0a..0000000 --- a/kubernetes-config/kafka-container-deployment.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: kafka-container - name: kafka-container -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: kafka-container - spec: - containers: - - env: - - name: KAFKA_ADVERTISED_LISTENERS - value: PLAINTEXT://kafka-container:9092 - - name: KAFKA_BROKER_ID - value: "1" - - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR - value: "1" - - name: KAFKA_ZOOKEEPER_CONNECT - value: zookeeper-container:2181 - image: confluentinc/cp-kafka - name: kafka-container - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/maintenance-db-deployment.yaml b/kubernetes-config/maintenance-db-deployment.yaml deleted file mode 100644 index b806f3d..0000000 --- a/kubernetes-config/maintenance-db-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - name: maintenance-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Maintenance - - name: MYSQL_ROOT_PASSWORD - value: maintenancedatabase - image: mysql:5.7 - name: maintenance-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/maintenance-service-deployment.yaml b/kubernetes-config/maintenance-service-deployment.yaml deleted file mode 100644 index 06742cc..0000000 --- a/kubernetes-config/maintenance-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-service - name: maintenance-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-maintenance-service - name: maintenance-service - resources: {} - volumeMounts: - - mountPath: /app - name: maintenance-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target - name: maintenance-service-hostpath0 -status: {} diff --git a/kubernetes-config/route-db-deployment.yaml b/kubernetes-config/route-db-deployment.yaml deleted file mode 100644 index e5b62b8..0000000 --- a/kubernetes-config/route-db-deployment.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - spec: - containers: - - env: - - name: NEO4J_AUTH - value: neo4j/route - image: neo4j:3.5.6 - name: route-db - ports: - - containerPort: 7687 - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/route-db-service.yaml b/kubernetes-config/route-db-service.yaml deleted file mode 100644 index 46e3037..0000000 --- a/kubernetes-config/route-db-service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db -spec: - ports: - - name: "7687" - port: 7687 - targetPort: 7687 - selector: - io.kompose.service: route-db -status: - loadBalancer: {} diff --git a/kubernetes-config/route-service-deployment.yaml b/kubernetes-config/route-service-deployment.yaml deleted file mode 100644 index 261d416..0000000 --- a/kubernetes-config/route-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-service - name: route-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-route-management-service - name: route-service - resources: {} - volumeMounts: - - mountPath: /app - name: route-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target - name: route-service-hostpath0 -status: {} diff --git a/kubernetes-config/staff-db-deployment.yaml b/kubernetes-config/staff-db-deployment.yaml deleted file mode 100644 index 0fb83e7..0000000 --- a/kubernetes-config/staff-db-deployment.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - name: staff-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - spec: - containers: - - image: mongo - name: staff-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/staff-service-deployment.yaml b/kubernetes-config/staff-service-deployment.yaml deleted file mode 100644 index 1b3ab69..0000000 --- a/kubernetes-config/staff-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-service - name: staff-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-staff-service - name: staff-service - resources: {} - volumeMounts: - - mountPath: /app - name: staff-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target - name: staff-service-hostpath0 -status: {} diff --git a/kubernetes-config/station-db-deployment.yaml b/kubernetes-config/station-db-deployment.yaml deleted file mode 100644 index 5276e82..0000000 --- a/kubernetes-config/station-db-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - name: station-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Station - - name: MYSQL_ROOT_PASSWORD - value: stationdatabase - image: mysql:5.7 - name: station-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/station-service-deployment.yaml b/kubernetes-config/station-service-deployment.yaml deleted file mode 100644 index e87f924..0000000 --- a/kubernetes-config/station-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-service - name: station-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-station-service - name: station-service - resources: {} - volumeMounts: - - mountPath: /app - name: station-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target - name: station-service-hostpath0 -status: {} diff --git a/kubernetes-config/ticket-sale-db-deployment.yaml b/kubernetes-config/ticket-sale-db-deployment.yaml deleted file mode 100644 index 6e6354a..0000000 --- a/kubernetes-config/ticket-sale-db-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - name: ticket-sale-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketSale - - name: MYSQL_ROOT_PASSWORD - value: ticketsaledatabase - image: mysql:5.7 - name: ticket-sale-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/ticket-sale-service-deployment.yaml b/kubernetes-config/ticket-sale-service-deployment.yaml deleted file mode 100644 index 9378212..0000000 --- a/kubernetes-config/ticket-sale-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-service - name: ticket-sale-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-sale-service - name: ticket-sale-service - resources: {} - volumeMounts: - - mountPath: /app - name: ticket-sale-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target - name: ticket-sale-service-hostpath0 -status: {} diff --git a/kubernetes-config/ticket-validation-db-deployment.yaml b/kubernetes-config/ticket-validation-db-deployment.yaml deleted file mode 100644 index bc9104e..0000000 --- a/kubernetes-config/ticket-validation-db-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - name: ticket-validation-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketValidation - - name: MYSQL_ROOT_PASSWORD - value: ticketvalidationdatabase - image: mysql:5.7 - name: ticket-validation-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/ticket-validation-service-deployment.yaml b/kubernetes-config/ticket-validation-service-deployment.yaml deleted file mode 100644 index ccd5794..0000000 --- a/kubernetes-config/ticket-validation-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-service - name: ticket-validation-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-validation-service - name: ticket-validation-service - resources: {} - volumeMounts: - - mountPath: /app - name: ticket-validation-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target - name: ticket-validation-service-hostpath0 -status: {} diff --git a/kubernetes-config/timetable-db-deployment.yaml b/kubernetes-config/timetable-db-deployment.yaml deleted file mode 100644 index e27cd95..0000000 --- a/kubernetes-config/timetable-db-deployment.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - name: timetable-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Timetable - - name: MYSQL_ROOT_PASSWORD - value: timetabledatabase - image: mysql:5.7 - name: timetable-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/timetable-service-deployment.yaml b/kubernetes-config/timetable-service-deployment.yaml deleted file mode 100644 index 5938f40..0000000 --- a/kubernetes-config/timetable-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-service - name: timetable-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-timetable-service - name: timetable-service - resources: {} - volumeMounts: - - mountPath: /app - name: timetable-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target - name: timetable-service-hostpath0 -status: {} diff --git a/kubernetes-config/train-db-deployment.yaml b/kubernetes-config/train-db-deployment.yaml deleted file mode 100644 index 3607e76..0000000 --- a/kubernetes-config/train-db-deployment.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - name: train-db -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - spec: - containers: - - image: mongo - name: train-db - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-config/train-service-deployment.yaml b/kubernetes-config/train-service-deployment.yaml deleted file mode 100644 index 6e71fb1..0000000 --- a/kubernetes-config/train-service-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-service - name: train-service -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-train-service - name: train-service - resources: {} - volumeMounts: - - mountPath: /app - name: train-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target - name: train-service-hostpath0 -status: {} diff --git a/kubernetes-config/zookeeper-container-deployment.yaml b/kubernetes-config/zookeeper-container-deployment.yaml deleted file mode 100644 index ffde87e..0000000 --- a/kubernetes-config/zookeeper-container-deployment.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: zookeeper-container - name: zookeeper-container -spec: - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f ../docker-compose.yaml --volumes hostPath - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: zookeeper-container - spec: - containers: - - env: - - name: ZOOKEEPER_CLIENT_PORT - value: "2181" - image: confluentinc/cp-zookeeper - name: zookeeper-container - resources: {} - restartPolicy: Always -status: {} diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml new file mode 100644 index 0000000..eebeffd --- /dev/null +++ b/kubernetes-deployment.yaml @@ -0,0 +1,869 @@ +apiVersion: v1 +items: +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: apigateway + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: frontend + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db + spec: + ports: + - name: "7687" + port: 7687 + targetPort: 7687 + selector: + io.kompose.service: route-db + status: + loadBalancer: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + spec: + containers: + - image: gilliswerrebrouck/railway-app-api-gateway-service + name: apigateway + ports: + - containerPort: 8080 + resources: {} + volumeMounts: + - mountPath: /app + name: apigateway-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target + name: apigateway-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + name: delay-request-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + spec: + containers: + - image: redis + name: delay-request-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + name: delay-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-delay-service + name: delay-service + resources: {} + volumeMounts: + - mountPath: /app + name: delay-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target + name: delay-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + spec: + containers: + - image: gilliswerrebrouck/railway-app-frontend + name: frontend + ports: + - containerPort: 80 + resources: {} + volumeMounts: + - mountPath: /app + name: frontend-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target + name: frontend-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + spec: + containers: + - env: + - name: KAFKA_ADVERTISED_LISTENERS + value: PLAINTEXT://kafka-container:9092 + - name: KAFKA_BROKER_ID + value: "1" + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: "1" + - name: KAFKA_ZOOKEEPER_CONNECT + value: zookeeper-container:2181 + image: confluentinc/cp-kafka + name: kafka-container + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Maintenance + - name: MYSQL_ROOT_PASSWORD + value: maintenancedatabase + image: mysql:5.7 + name: maintenance-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + name: maintenance-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-maintenance-service + name: maintenance-service + resources: {} + volumeMounts: + - mountPath: /app + name: maintenance-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target + name: maintenance-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + spec: + containers: + - env: + - name: NEO4J_AUTH + value: neo4j/route + image: neo4j:3.5.6 + name: route-db + ports: + - containerPort: 7687 + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + name: route-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-route-management-service + name: route-service + resources: {} + volumeMounts: + - mountPath: /app + name: route-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target + name: route-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + name: staff-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + spec: + containers: + - image: mongo + name: staff-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + name: staff-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-staff-service + name: staff-service + resources: {} + volumeMounts: + - mountPath: /app + name: staff-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target + name: staff-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + name: station-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Station + - name: MYSQL_ROOT_PASSWORD + value: stationdatabase + image: mysql:5.7 + name: station-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + name: station-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-station-service + name: station-service + resources: {} + volumeMounts: + - mountPath: /app + name: station-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target + name: station-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + name: ticket-sale-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketSale + - name: MYSQL_ROOT_PASSWORD + value: ticketsaledatabase + image: mysql:5.7 + name: ticket-sale-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + name: ticket-sale-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-sale-service + name: ticket-sale-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-sale-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target + name: ticket-sale-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + name: ticket-validation-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketValidation + - name: MYSQL_ROOT_PASSWORD + value: ticketvalidationdatabase + image: mysql:5.7 + name: ticket-validation-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + name: ticket-validation-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-validation-service + name: ticket-validation-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-validation-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target + name: ticket-validation-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + name: timetable-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Timetable + - name: MYSQL_ROOT_PASSWORD + value: timetabledatabase + image: mysql:5.7 + name: timetable-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + name: timetable-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-timetable-service + name: timetable-service + resources: {} + volumeMounts: + - mountPath: /app + name: timetable-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target + name: timetable-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + name: train-db + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + spec: + containers: + - image: mongo + name: train-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + name: train-service + spec: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-train-service + name: train-service + resources: {} + volumeMounts: + - mountPath: /app + name: train-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target + name: train-service-hostpath0 + status: {} +- apiVersion: extensions/v1beta1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container + spec: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + spec: + containers: + - env: + - name: ZOOKEEPER_CLIENT_PORT + value: "2181" + image: confluentinc/cp-zookeeper + name: zookeeper-container + resources: {} + restartPolicy: Always + status: {} +kind: List +metadata: {} + From 60470b31ac040f44d1cd876e4de82e197aa4c40d Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 11 Jan 2020 12:54:36 +0100 Subject: [PATCH 19/42] Modify kubernetes config --- kubernetes-deployment.yaml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index eebeffd..9aea8c5 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -60,7 +60,7 @@ items: io.kompose.service: route-db status: loadBalancer: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -100,7 +100,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target name: apigateway-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -130,7 +130,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -168,7 +168,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target name: delay-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -208,7 +208,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target name: frontend-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -247,7 +247,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -284,7 +284,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -322,7 +322,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target name: maintenance-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -357,7 +357,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -395,7 +395,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target name: route-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -425,7 +425,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -463,7 +463,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target name: staff-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -500,7 +500,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -538,7 +538,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target name: station-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -575,7 +575,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -613,7 +613,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target name: ticket-sale-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -650,7 +650,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -688,7 +688,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target name: ticket-validation-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -725,7 +725,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -763,7 +763,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target name: timetable-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -793,7 +793,7 @@ items: resources: {} restartPolicy: Always status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: @@ -831,7 +831,7 @@ items: path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target name: train-service-hostpath0 status: {} -- apiVersion: extensions/v1beta1 +- apiVersion: apps/v1 kind: Deployment metadata: annotations: From 1e5b884a184354c76a3a0630eceec101c4237328 Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 11 Jan 2020 13:00:59 +0100 Subject: [PATCH 20/42] Modify kubernetes config --- kubernetes-deployment.yaml | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 9aea8c5..881099d 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -72,6 +72,9 @@ items: io.kompose.service: apigateway name: apigateway spec: + selector: + matchLabels: + io.kompose.service: apigateway replicas: 1 strategy: type: Recreate @@ -112,6 +115,9 @@ items: io.kompose.service: delay-request-db name: delay-request-db spec: + selector: + matchLabels: + io.kompose.service: delay-request-db replicas: 1 strategy: {} template: @@ -142,6 +148,9 @@ items: io.kompose.service: delay-service name: delay-service spec: + selector: + matchLabels: + io.kompose.service: delay-service replicas: 1 strategy: type: Recreate @@ -180,6 +189,9 @@ items: io.kompose.service: frontend name: frontend spec: + selector: + matchLabels: + io.kompose.service: frontend replicas: 1 strategy: type: Recreate @@ -220,6 +232,9 @@ items: io.kompose.service: kafka-container name: kafka-container spec: + selector: + matchLabels: + io.kompose.service: kafka-container replicas: 1 strategy: {} template: @@ -259,6 +274,9 @@ items: io.kompose.service: maintenance-db name: maintenance-db spec: + selector: + matchLabels: + io.kompose.service: maintenance-db replicas: 1 strategy: {} template: @@ -296,6 +314,9 @@ items: io.kompose.service: maintenance-service name: maintenance-service spec: + selector: + matchLabels: + io.kompose.service: maintenance-service replicas: 1 strategy: type: Recreate @@ -334,6 +355,9 @@ items: io.kompose.service: route-db name: route-db spec: + selector: + matchLabels: + io.kompose.service: route-db replicas: 1 strategy: {} template: @@ -369,6 +393,9 @@ items: io.kompose.service: route-service name: route-service spec: + selector: + matchLabels: + io.kompose.service: route-service replicas: 1 strategy: type: Recreate @@ -407,6 +434,9 @@ items: io.kompose.service: staff-db name: staff-db spec: + selector: + matchLabels: + io.kompose.service: staff-db replicas: 1 strategy: {} template: @@ -437,6 +467,9 @@ items: io.kompose.service: staff-service name: staff-service spec: + selector: + matchLabels: + io.kompose.service: staff-service replicas: 1 strategy: type: Recreate @@ -475,6 +508,9 @@ items: io.kompose.service: station-db name: station-db spec: + selector: + matchLabels: + io.kompose.service: station-db replicas: 1 strategy: {} template: @@ -512,6 +548,9 @@ items: io.kompose.service: station-service name: station-service spec: + selector: + matchLabels: + io.kompose.service: station-service replicas: 1 strategy: type: Recreate @@ -550,6 +589,9 @@ items: io.kompose.service: ticket-sale-db name: ticket-sale-db spec: + selector: + matchLabels: + io.kompose.service: ticket-sale-db replicas: 1 strategy: {} template: @@ -587,6 +629,9 @@ items: io.kompose.service: ticket-sale-service name: ticket-sale-service spec: + selector: + matchLabels: + io.kompose.service: ticket-sale-service replicas: 1 strategy: type: Recreate @@ -625,6 +670,9 @@ items: io.kompose.service: ticket-validation-db name: ticket-validation-db spec: + selector: + matchLabels: + io.kompose.service: ticket-validation-db replicas: 1 strategy: {} template: @@ -662,6 +710,9 @@ items: io.kompose.service: ticket-validation-service name: ticket-validation-service spec: + selector: + matchLabels: + io.kompose.service: ticket-validation-service replicas: 1 strategy: type: Recreate @@ -700,6 +751,9 @@ items: io.kompose.service: timetable-db name: timetable-db spec: + selector: + matchLabels: + io.kompose.service: timetable-db replicas: 1 strategy: {} template: @@ -737,6 +791,9 @@ items: io.kompose.service: timetable-service name: timetable-service spec: + selector: + matchLabels: + io.kompose.service: timetable-service replicas: 1 strategy: type: Recreate @@ -775,6 +832,9 @@ items: io.kompose.service: train-db name: train-db spec: + selector: + matchLabels: + io.kompose.service: train-db replicas: 1 strategy: {} template: @@ -805,6 +865,9 @@ items: io.kompose.service: train-service name: train-service spec: + selector: + matchLabels: + io.kompose.service: train-service replicas: 1 strategy: type: Recreate @@ -843,6 +906,9 @@ items: io.kompose.service: zookeeper-container name: zookeeper-container spec: + selector: + matchLabels: + io.kompose.service: zookeeper-container replicas: 1 strategy: {} template: From 2d6a0d27d115c6ffd4d0438f9f703538ccc951fc Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 11 Jan 2020 13:57:20 +0100 Subject: [PATCH 21/42] Update dockerfiles for java services --- railway-app-api-gateway/Dockerfile | 6 +++--- railway-app-delay/Dockerfile | 6 +++--- railway-app-maintenance/Dockerfile | 6 +++--- railway-app-route-management/Dockerfile | 6 +++--- railway-app-staff/Dockerfile | 6 +++--- railway-app-station/Dockerfile | 6 +++--- railway-app-ticket-sale/Dockerfile | 6 +++--- railway-app-ticket-validation/Dockerfile | 6 +++--- railway-app-timetable/Dockerfile | 6 +++--- railway-app-train/Dockerfile | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/railway-app-api-gateway/Dockerfile b/railway-app-api-gateway/Dockerfile index 25c4d20..9e4dce5 100644 --- a/railway-app-api-gateway/Dockerfile +++ b/railway-app-api-gateway/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-api-gateway-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-api-gateway-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-api-gateway-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-delay/Dockerfile b/railway-app-delay/Dockerfile index 8c61792..61a8174 100644 --- a/railway-app-delay/Dockerfile +++ b/railway-app-delay/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-delay-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-delay-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-delay-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-maintenance/Dockerfile b/railway-app-maintenance/Dockerfile index abcebcd..de54623 100644 --- a/railway-app-maintenance/Dockerfile +++ b/railway-app-maintenance/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-maintenance-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-maintenance-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-maintenance-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-route-management/Dockerfile b/railway-app-route-management/Dockerfile index 10f42b4..8e64fd4 100644 --- a/railway-app-route-management/Dockerfile +++ b/railway-app-route-management/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-route-management-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-route-management-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-route-management-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-staff/Dockerfile b/railway-app-staff/Dockerfile index 9734a9a..6edafd0 100644 --- a/railway-app-staff/Dockerfile +++ b/railway-app-staff/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-staff-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-staff-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-staff-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-station/Dockerfile b/railway-app-station/Dockerfile index a8bd275..6a80b76 100644 --- a/railway-app-station/Dockerfile +++ b/railway-app-station/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-station-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-station-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-station-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-ticket-sale/Dockerfile b/railway-app-ticket-sale/Dockerfile index d267003..ecb00db 100644 --- a/railway-app-ticket-sale/Dockerfile +++ b/railway-app-ticket-sale/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-ticket-sale-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-ticket-sale-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-ticket-sale-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-ticket-validation/Dockerfile b/railway-app-ticket-validation/Dockerfile index 1bdaf80..0d55d16 100644 --- a/railway-app-ticket-validation/Dockerfile +++ b/railway-app-ticket-validation/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-ticket-validation-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-ticket-validation-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-ticket-validation-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-timetable/Dockerfile b/railway-app-timetable/Dockerfile index cbce685..f7f19e3 100644 --- a/railway-app-timetable/Dockerfile +++ b/railway-app-timetable/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-timetable-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-timetable-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-timetable-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/railway-app-train/Dockerfile b/railway-app-train/Dockerfile index e588cd9..6736161 100644 --- a/railway-app-train/Dockerfile +++ b/railway-app-train/Dockerfile @@ -1,3 +1,3 @@ -from openjdk:8 -CMD ["java", "-jar", "app/railway-app-train-0.0.1-SNAPSHOT.jar"] - +FROM openjdk:8 +COPY ./target/railway-app-train-0.0.1-SNAPSHOT.jar . +CMD ["java", "-jar", "railway-app-train-0.0.1-SNAPSHOT.jar"] \ No newline at end of file From e47f8d0065f98a118862f0ebf5298dc0058aeb92 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 15 Jan 2020 19:21:54 +0100 Subject: [PATCH 22/42] Add services to kubernetes config --- kubernetes-deployment.yaml | 41 +++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 881099d..2c42ec2 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -20,6 +20,46 @@ items: io.kompose.service: apigateway status: loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container + spec: + ports: + - name: "2181" + port: 2181 + targetPort: 2181 + selector: + io.kompose.service: zookeeper-container + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + ports: + - name: "9092" + port: 9092 + targetPort: 9092 + selector: + io.kompose.service: kafka-container + status: + loadBalancer: {} - apiVersion: v1 kind: Service metadata: @@ -932,4 +972,3 @@ items: status: {} kind: List metadata: {} - From cc11cb7e447ae897110233042b5c4cfab9a6ecf3 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 15 Jan 2020 23:00:26 +0100 Subject: [PATCH 23/42] Add service for maintenance db --- kubernetes-deployment.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 2c42ec2..c95bf24 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -100,6 +100,26 @@ items: io.kompose.service: route-db status: loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db + spec: + ports: + - name: "3306" + port: 3306 + targetPort: 3306 + selector: + io.kompose.service: maintenance-db + status: + loadBalancer: {} - apiVersion: apps/v1 kind: Deployment metadata: From 048a24656dca7d6770a3ee2083a4009217a610fa Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 15 Jan 2020 23:13:14 +0100 Subject: [PATCH 24/42] Add hostname --- kubernetes-deployment.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index c95bf24..1494f12 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -100,26 +100,6 @@ items: io.kompose.service: route-db status: loadBalancer: {} -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - name: maintenance-db - spec: - ports: - - name: "3306" - port: 3306 - targetPort: 3306 - selector: - io.kompose.service: maintenance-db - status: - loadBalancer: {} - apiVersion: apps/v1 kind: Deployment metadata: @@ -334,6 +314,7 @@ items: io.kompose.service: maintenance-db name: maintenance-db spec: + hostname: maintenance-db selector: matchLabels: io.kompose.service: maintenance-db From 437d38b1402eef655514d201bb9b250ebafe0eaf Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Wed, 15 Jan 2020 23:25:40 +0100 Subject: [PATCH 25/42] Remove hostname --- kubernetes-deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 1494f12..2c42ec2 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -314,7 +314,6 @@ items: io.kompose.service: maintenance-db name: maintenance-db spec: - hostname: maintenance-db selector: matchLabels: io.kompose.service: maintenance-db From 17dd7bf701cc1d3437e0609b2659eef79403cef8 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 21:54:29 +0100 Subject: [PATCH 26/42] Add services for databases --- kubernetes-deployment.yaml | 1882 +++++++++++++++++++----------------- 1 file changed, 1009 insertions(+), 873 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 2c42ec2..aa6d1d7 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -1,124 +1,7 @@ apiVersion: v1 items: -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - name: apigateway - spec: - ports: - - name: "8080" - port: 8080 - targetPort: 8080 - selector: - io.kompose.service: apigateway - status: - loadBalancer: {} -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: zookeeper-container - name: zookeeper-container - spec: - ports: - - name: "2181" - port: 2181 - targetPort: 2181 - selector: - io.kompose.service: zookeeper-container - status: - loadBalancer: {} -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: kafka-container - name: kafka-container - spec: - ports: - - name: "9092" - port: 9092 - targetPort: 9092 - selector: - io.kompose.service: kafka-container - status: - loadBalancer: {} -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - name: frontend - spec: - ports: - - name: "80" - port: 80 - targetPort: 80 - selector: - io.kompose.service: frontend - status: - loadBalancer: {} -- apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db - spec: - ports: - - name: "7687" - port: 7687 - targetPort: 7687 - selector: - io.kompose.service: route-db - status: - loadBalancer: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - name: apigateway - spec: - selector: - matchLabels: - io.kompose.service: apigateway - replicas: 1 - strategy: - type: Recreate - template: + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -126,41 +9,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: apigateway + io.kompose.service: route-db + name: route-db spec: - containers: - - image: gilliswerrebrouck/railway-app-api-gateway-service - name: apigateway - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - mountPath: /app - name: apigateway-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target - name: apigateway-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-request-db - name: delay-request-db - spec: - selector: - matchLabels: - io.kompose.service: delay-request-db - replicas: 1 - strategy: {} - template: + ports: + - port: 7687 + selector: + io.kompose.service: route-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -168,33 +27,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: delay-request-db + io.kompose.service: staff-db + name: staff-db spec: - containers: - - image: redis - name: delay-request-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-service - name: delay-service - spec: - selector: - matchLabels: - io.kompose.service: delay-service - replicas: 1 - strategy: - type: Recreate - template: + ports: + - port: 27017 + selector: + io.kompose.service: staff-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -202,40 +45,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: delay-service + io.kompose.service: train-db + name: train-db spec: - containers: - - image: gilliswerrebrouck/railway-app-delay-service - name: delay-service - resources: {} - volumeMounts: - - mountPath: /app - name: delay-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target - name: delay-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - name: frontend - spec: - selector: - matchLabels: - io.kompose.service: frontend - replicas: 1 - strategy: - type: Recreate - template: + ports: + - port: 27017 + selector: + io.kompose.service: train-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -243,41 +63,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: frontend + io.kompose.service: maintenance-db + name: maintenance-db spec: - containers: - - image: gilliswerrebrouck/railway-app-frontend - name: frontend - ports: - - containerPort: 80 - resources: {} - volumeMounts: - - mountPath: /app - name: frontend-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target - name: frontend-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: kafka-container - name: kafka-container - spec: - selector: - matchLabels: - io.kompose.service: kafka-container - replicas: 1 - strategy: {} - template: + ports: + - port: 3306 + selector: + io.kompose.service: maintenance-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -285,41 +81,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: kafka-container + io.kompose.service: station-db + name: station-db spec: - containers: - - env: - - name: KAFKA_ADVERTISED_LISTENERS - value: PLAINTEXT://kafka-container:9092 - - name: KAFKA_BROKER_ID - value: "1" - - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR - value: "1" - - name: KAFKA_ZOOKEEPER_CONNECT - value: zookeeper-container:2181 - image: confluentinc/cp-kafka - name: kafka-container - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - name: maintenance-db - spec: - selector: - matchLabels: - io.kompose.service: maintenance-db - replicas: 1 - strategy: {} - template: + ports: + - port: 3306 + selector: + io.kompose.service: station-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -327,40 +99,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: maintenance-db + io.kompose.service: ticket-sale-db + name: ticket-sale-db spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Maintenance - - name: MYSQL_ROOT_PASSWORD - value: maintenancedatabase - image: mysql:5.7 - name: maintenance-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-service - name: maintenance-service - spec: - selector: - matchLabels: - io.kompose.service: maintenance-service - replicas: 1 - strategy: - type: Recreate - template: + ports: + - port: 3306 + selector: + io.kompose.service: ticket-sale-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -368,39 +117,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: maintenance-service + io.kompose.service: ticket-validation-db + name: ticket-validation-db spec: - containers: - - image: gilliswerrebrouck/railway-app-maintenance-service - name: maintenance-service - resources: {} - volumeMounts: - - mountPath: /app - name: maintenance-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target - name: maintenance-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db - spec: - selector: - matchLabels: - io.kompose.service: route-db - replicas: 1 - strategy: {} - template: + ports: + - port: 3306 + selector: + io.kompose.service: ticket-validation-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -408,567 +135,976 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: route-db + io.kompose.service: timetable-db + name: timetable-db spec: - containers: - - env: - - name: NEO4J_AUTH - value: neo4j/route - image: neo4j:3.5.6 - name: route-db - ports: - - containerPort: 7687 - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-service - name: route-service - spec: - selector: - matchLabels: + ports: + - port: 3306 + selector: + io.kompose.service: timetable-db + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: apigateway + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container + spec: + ports: + - name: "2181" + port: 2181 + targetPort: 2181 + selector: + io.kompose.service: zookeeper-container + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + ports: + - name: "9092" + port: 9092 + targetPort: 9092 + selector: + io.kompose.service: kafka-container + status: + loadBalancer: {} + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: frontend + status: + loadBalancer: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + selector: + matchLabels: + io.kompose.service: apigateway + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + spec: + containers: + - image: gilliswerrebrouck/railway-app-api-gateway-service + name: apigateway + ports: + - containerPort: 8080 + resources: {} + volumeMounts: + - mountPath: /app + name: apigateway-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target + name: apigateway-hostpath0 + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + name: delay-request-db + spec: + selector: + matchLabels: + io.kompose.service: delay-request-db + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + spec: + containers: + - image: redis + name: delay-request-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + name: delay-service + spec: + selector: + matchLabels: + io.kompose.service: delay-service + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-delay-service + name: delay-service + resources: {} + volumeMounts: + - mountPath: /app + name: delay-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target + name: delay-service-hostpath0 + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + selector: + matchLabels: + io.kompose.service: frontend + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + spec: + containers: + - image: gilliswerrebrouck/railway-app-frontend + name: frontend + ports: + - containerPort: 80 + resources: {} + volumeMounts: + - mountPath: /app + name: frontend-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target + name: frontend-hostpath0 + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + selector: + matchLabels: + io.kompose.service: kafka-container + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + spec: + containers: + - env: + - name: KAFKA_ADVERTISED_LISTENERS + value: PLAINTEXT://kafka-container:9092 + - name: KAFKA_BROKER_ID + value: "1" + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: "1" + - name: KAFKA_ZOOKEEPER_CONNECT + value: zookeeper-container:2181 + image: confluentinc/cp-kafka + name: kafka-container + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db + spec: + selector: + matchLabels: + io.kompose.service: maintenance-db + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Maintenance + - name: MYSQL_ROOT_PASSWORD + value: maintenancedatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: maintenance-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + name: maintenance-service + spec: + selector: + matchLabels: + io.kompose.service: maintenance-service + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-maintenance-service + name: maintenance-service + resources: {} + volumeMounts: + - mountPath: /app + name: maintenance-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target + name: maintenance-service-hostpath0 + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db + spec: + selector: + matchLabels: + io.kompose.service: route-db + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + spec: + containers: + - env: + - name: NEO4J_AUTH + value: neo4j/route + image: neo4j:3.5.6 + name: route-db + ports: + - containerPort: 7687 + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: route-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: route-service + spec: + selector: + matchLabels: io.kompose.service: route-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-route-management-service - name: route-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-route-management-service + name: route-service + resources: {} + volumeMounts: + - mountPath: /app + name: route-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target name: route-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target - name: route-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - name: staff-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: staff-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: staff-db + spec: + selector: + matchLabels: io.kompose.service: staff-db - spec: - containers: - - image: mongo - name: staff-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-service - name: staff-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + spec: + containers: + - image: mongo + name: staff-db + ports: + - containerPort: 27017 + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: staff-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: staff-service + spec: + selector: + matchLabels: io.kompose.service: staff-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-staff-service - name: staff-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-staff-service + name: staff-service + resources: {} + volumeMounts: + - mountPath: /app + name: staff-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target name: staff-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target - name: staff-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - name: station-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: station-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: station-db + spec: + selector: + matchLabels: io.kompose.service: station-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Station - - name: MYSQL_ROOT_PASSWORD - value: stationdatabase - image: mysql:5.7 - name: station-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-service - name: station-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Station + - name: MYSQL_ROOT_PASSWORD + value: stationdatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: station-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: station-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: station-service + spec: + selector: + matchLabels: io.kompose.service: station-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-station-service - name: station-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-station-service + name: station-service + resources: {} + volumeMounts: + - mountPath: /app + name: station-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target name: station-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target - name: station-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - name: ticket-sale-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-sale-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: ticket-sale-db + spec: + selector: + matchLabels: io.kompose.service: ticket-sale-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketSale - - name: MYSQL_ROOT_PASSWORD - value: ticketsaledatabase - image: mysql:5.7 - name: ticket-sale-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-service - name: ticket-sale-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketSale + - name: MYSQL_ROOT_PASSWORD + value: ticketsaledatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: ticket-sale-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-sale-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: ticket-sale-service + spec: + selector: + matchLabels: io.kompose.service: ticket-sale-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-sale-service - name: ticket-sale-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-sale-service + name: ticket-sale-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-sale-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target name: ticket-sale-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target - name: ticket-sale-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - name: ticket-validation-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-validation-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: ticket-validation-db + spec: + selector: + matchLabels: io.kompose.service: ticket-validation-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketValidation - - name: MYSQL_ROOT_PASSWORD - value: ticketvalidationdatabase - image: mysql:5.7 - name: ticket-validation-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-service - name: ticket-validation-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketValidation + - name: MYSQL_ROOT_PASSWORD + value: ticketvalidationdatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: ticket-validation-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-validation-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: ticket-validation-service + spec: + selector: + matchLabels: io.kompose.service: ticket-validation-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-validation-service - name: ticket-validation-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-validation-service + name: ticket-validation-service + resources: {} + volumeMounts: + - mountPath: /app + name: ticket-validation-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target name: ticket-validation-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target - name: ticket-validation-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - name: timetable-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: timetable-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: timetable-db + spec: + selector: + matchLabels: io.kompose.service: timetable-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Timetable - - name: MYSQL_ROOT_PASSWORD - value: timetabledatabase - image: mysql:5.7 - name: timetable-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-service - name: timetable-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Timetable + - name: MYSQL_ROOT_PASSWORD + value: timetabledatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: timetable-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: timetable-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: timetable-service + spec: + selector: + matchLabels: io.kompose.service: timetable-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-timetable-service - name: timetable-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-timetable-service + name: timetable-service + resources: {} + volumeMounts: + - mountPath: /app + name: timetable-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target name: timetable-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target - name: timetable-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - name: train-db - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: train-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: train-db + spec: + selector: + matchLabels: io.kompose.service: train-db - spec: - containers: - - image: mongo - name: train-db - resources: {} - restartPolicy: Always - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-service - name: train-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + spec: + containers: + - image: mongo + name: train-db + resources: {} + restartPolicy: Always + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: train-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: train-service + spec: + selector: + matchLabels: io.kompose.service: train-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-train-service - name: train-service - resources: {} - volumeMounts: - - mountPath: /app + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-train-service + name: train-service + resources: {} + volumeMounts: + - mountPath: /app + name: train-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target name: train-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target - name: train-service-hostpath0 - status: {} -- apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: zookeeper-container - name: zookeeper-container - spec: - selector: - matchLabels: + status: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: zookeeper-container - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + name: zookeeper-container + spec: + selector: + matchLabels: io.kompose.service: zookeeper-container - spec: - containers: - - env: - - name: ZOOKEEPER_CLIENT_PORT - value: "2181" - image: confluentinc/cp-zookeeper - name: zookeeper-container - resources: {} - restartPolicy: Always - status: {} -kind: List -metadata: {} + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + spec: + containers: + - env: + - name: ZOOKEEPER_CLIENT_PORT + value: "2181" + image: confluentinc/cp-zookeeper + name: zookeeper-container + resources: {} + restartPolicy: Always + status: {} + kind: List + metadata: {} From 651fd480fd8eeb989f34a1be7bf59a498c9f5f04 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 21:59:32 +0100 Subject: [PATCH 27/42] Fix yaml indentation issue --- kubernetes-deployment.yaml | 1948 ++++++++++++++++++------------------ 1 file changed, 974 insertions(+), 974 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index aa6d1d7..51df817 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -1,150 +1,6 @@ apiVersion: v1 items: - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db - spec: - ports: - - port: 7687 - selector: - io.kompose.service: route-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - name: staff-db - spec: - ports: - - port: 27017 - selector: - io.kompose.service: staff-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - name: train-db - spec: - ports: - - port: 27017 - selector: - io.kompose.service: train-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - name: maintenance-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: maintenance-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - name: station-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: station-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - name: ticket-sale-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: ticket-sale-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - name: ticket-validation-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: ticket-validation-db - status: - loadBalancer: {} - - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - name: timetable-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: timetable-db - status: - loadBalancer: {} - - apiVersion: v1 +- apiVersion: v1 kind: Service metadata: annotations: @@ -153,18 +9,16 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: apigateway - name: apigateway + io.kompose.service: route-db + name: route-db spec: ports: - - name: "8080" - port: 8080 - targetPort: 8080 + - port: 7687 selector: - io.kompose.service: apigateway + io.kompose.service: route-db status: loadBalancer: {} - - apiVersion: v1 +- apiVersion: v1 kind: Service metadata: annotations: @@ -173,18 +27,16 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: zookeeper-container - name: zookeeper-container + io.kompose.service: staff-db + name: staff-db spec: ports: - - name: "2181" - port: 2181 - targetPort: 2181 + - port: 27017 selector: - io.kompose.service: zookeeper-container + io.kompose.service: staff-db status: loadBalancer: {} - - apiVersion: v1 +- apiVersion: v1 kind: Service metadata: annotations: @@ -193,18 +45,16 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: kafka-container - name: kafka-container + io.kompose.service: train-db + name: train-db spec: ports: - - name: "9092" - port: 9092 - targetPort: 9092 + - port: 27017 selector: - io.kompose.service: kafka-container + io.kompose.service: train-db status: loadBalancer: {} - - apiVersion: v1 +- apiVersion: v1 kind: Service metadata: annotations: @@ -213,19 +63,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: frontend - name: frontend + io.kompose.service: maintenance-db + name: maintenance-db spec: ports: - - name: "80" - port: 80 - targetPort: 80 + - port: 3306 selector: - io.kompose.service: frontend + io.kompose.service: maintenance-db status: loadBalancer: {} - - apiVersion: apps/v1 - kind: Deployment +- apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -233,42 +81,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: apigateway - name: apigateway + io.kompose.service: station-db + name: station-db spec: + ports: + - port: 3306 selector: - matchLabels: - io.kompose.service: apigateway - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: apigateway - spec: - containers: - - image: gilliswerrebrouck/railway-app-api-gateway-service - name: apigateway - ports: - - containerPort: 8080 - resources: {} - volumeMounts: - - mountPath: /app - name: apigateway-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target - name: apigateway-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment + io.kompose.service: station-db + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -276,32 +99,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: delay-request-db - name: delay-request-db + io.kompose.service: ticket-sale-db + name: ticket-sale-db spec: + ports: + - port: 3306 selector: - matchLabels: - io.kompose.service: delay-request-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-request-db - spec: - containers: - - image: redis - name: delay-request-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment + io.kompose.service: ticket-sale-db + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -309,40 +117,17 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: delay-service - name: delay-service + io.kompose.service: ticket-validation-db + name: ticket-validation-db spec: + ports: + - port: 3306 selector: - matchLabels: - io.kompose.service: delay-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: delay-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-delay-service - name: delay-service - resources: {} - volumeMounts: - - mountPath: /app - name: delay-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target - name: delay-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment + io.kompose.service: ticket-validation-db + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service metadata: annotations: kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out @@ -350,761 +135,976 @@ items: kompose.version: 1.20.0 (f3d54d784) creationTimestamp: null labels: - io.kompose.service: frontend - name: frontend + io.kompose.service: timetable-db + name: timetable-db spec: + ports: + - port: 3306 selector: - matchLabels: + io.kompose.service: timetable-db + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + ports: + - name: "8080" + port: 8080 + targetPort: 8080 + selector: + io.kompose.service: apigateway + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container + spec: + ports: + - name: "2181" + port: 2181 + targetPort: 2181 + selector: + io.kompose.service: zookeeper-container + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + ports: + - name: "9092" + port: 9092 + targetPort: 9092 + selector: + io.kompose.service: kafka-container + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + ports: + - name: "80" + port: 80 + targetPort: 80 + selector: + io.kompose.service: frontend + status: + loadBalancer: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + name: apigateway + spec: + selector: + matchLabels: + io.kompose.service: apigateway + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: apigateway + spec: + containers: + - image: gilliswerrebrouck/railway-app-api-gateway-service + name: apigateway + ports: + - containerPort: 8080 + resources: {} + volumeMounts: + - mountPath: /app + name: apigateway-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-api-gateway/target + name: apigateway-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + name: delay-request-db + spec: + selector: + matchLabels: + io.kompose.service: delay-request-db + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + spec: + containers: + - image: redis + name: delay-request-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + name: delay-service + spec: + selector: + matchLabels: + io.kompose.service: delay-service + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + spec: + containers: + - image: gilliswerrebrouck/railway-app-delay-service + name: delay-service + resources: {} + volumeMounts: + - mountPath: /app + name: delay-service-hostpath0 + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-delay/target + name: delay-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: frontend + name: frontend + spec: + selector: + matchLabels: + io.kompose.service: frontend + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: frontend - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: frontend - spec: - containers: - - image: gilliswerrebrouck/railway-app-frontend - name: frontend - ports: - - containerPort: 80 - resources: {} - volumeMounts: - - mountPath: /app - name: frontend-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-frontend + name: frontend + ports: + - containerPort: 80 + resources: {} + volumeMounts: + - mountPath: /app name: frontend-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-frontend/target + name: frontend-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: kafka-container + name: kafka-container + spec: + selector: + matchLabels: io.kompose.service: kafka-container - name: kafka-container - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: kafka-container - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: kafka-container - spec: - containers: - - env: - - name: KAFKA_ADVERTISED_LISTENERS - value: PLAINTEXT://kafka-container:9092 - - name: KAFKA_BROKER_ID - value: "1" - - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR - value: "1" - - name: KAFKA_ZOOKEEPER_CONNECT - value: zookeeper-container:2181 - image: confluentinc/cp-kafka - name: kafka-container - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - env: + - name: KAFKA_ADVERTISED_LISTENERS + value: PLAINTEXT://kafka-container:9092 + - name: KAFKA_BROKER_ID + value: "1" + - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR + value: "1" + - name: KAFKA_ZOOKEEPER_CONNECT + value: zookeeper-container:2181 + image: confluentinc/cp-kafka + name: kafka-container + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db + spec: + selector: + matchLabels: io.kompose.service: maintenance-db - name: maintenance-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: maintenance-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Maintenance - - name: MYSQL_ROOT_PASSWORD - value: maintenancedatabase - ports: - - containerPort: 3306 - image: mysql:5.7 - name: maintenance-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Maintenance + - name: MYSQL_ROOT_PASSWORD + value: maintenancedatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: maintenance-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + name: maintenance-service + spec: + selector: + matchLabels: io.kompose.service: maintenance-service - name: maintenance-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: maintenance-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-maintenance-service - name: maintenance-service - resources: {} - volumeMounts: - - mountPath: /app - name: maintenance-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-maintenance-service + name: maintenance-service + resources: {} + volumeMounts: + - mountPath: /app name: maintenance-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-maintenance/target + name: maintenance-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db + spec: + selector: + matchLabels: io.kompose.service: route-db - name: route-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: route-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - spec: - containers: - - env: - - name: NEO4J_AUTH - value: neo4j/route - image: neo4j:3.5.6 - name: route-db - ports: - - containerPort: 7687 - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - env: + - name: NEO4J_AUTH + value: neo4j/route + image: neo4j:3.5.6 + name: route-db + ports: + - containerPort: 7687 + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + name: route-service + spec: + selector: + matchLabels: io.kompose.service: route-service - name: route-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: route-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-route-management-service - name: route-service - resources: {} - volumeMounts: - - mountPath: /app - name: route-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-route-management-service + name: route-service + resources: {} + volumeMounts: + - mountPath: /app name: route-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-route-management/target + name: route-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + name: staff-db + spec: + selector: + matchLabels: io.kompose.service: staff-db - name: staff-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: staff-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - spec: - containers: - - image: mongo - name: staff-db - ports: - - containerPort: 27017 - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - image: mongo + name: staff-db + ports: + - containerPort: 27017 + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + name: staff-service + spec: + selector: + matchLabels: io.kompose.service: staff-service - name: staff-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: staff-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-staff-service - name: staff-service - resources: {} - volumeMounts: - - mountPath: /app - name: staff-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-staff-service + name: staff-service + resources: {} + volumeMounts: + - mountPath: /app name: staff-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-staff/target + name: staff-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + name: station-db + spec: + selector: + matchLabels: io.kompose.service: station-db - name: station-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: station-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Station - - name: MYSQL_ROOT_PASSWORD - value: stationdatabase - ports: - - containerPort: 3306 - image: mysql:5.7 - name: station-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Station + - name: MYSQL_ROOT_PASSWORD + value: stationdatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: station-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + name: station-service + spec: + selector: + matchLabels: io.kompose.service: station-service - name: station-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: station-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-station-service - name: station-service - resources: {} - volumeMounts: - - mountPath: /app - name: station-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-station-service + name: station-service + resources: {} + volumeMounts: + - mountPath: /app name: station-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-station/target + name: station-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + name: ticket-sale-db + spec: + selector: + matchLabels: io.kompose.service: ticket-sale-db - name: ticket-sale-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-sale-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketSale - - name: MYSQL_ROOT_PASSWORD - value: ticketsaledatabase - ports: - - containerPort: 3306 - image: mysql:5.7 - name: ticket-sale-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketSale + - name: MYSQL_ROOT_PASSWORD + value: ticketsaledatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: ticket-sale-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + name: ticket-sale-service + spec: + selector: + matchLabels: io.kompose.service: ticket-sale-service - name: ticket-sale-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-sale-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-sale-service - name: ticket-sale-service - resources: {} - volumeMounts: - - mountPath: /app - name: ticket-sale-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-sale-service + name: ticket-sale-service + resources: {} + volumeMounts: + - mountPath: /app name: ticket-sale-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-sale/target + name: ticket-sale-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + name: ticket-validation-db + spec: + selector: + matchLabels: io.kompose.service: ticket-validation-db - name: ticket-validation-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-validation-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: TicketValidation - - name: MYSQL_ROOT_PASSWORD - value: ticketvalidationdatabase - ports: - - containerPort: 3306 - image: mysql:5.7 - name: ticket-validation-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: TicketValidation + - name: MYSQL_ROOT_PASSWORD + value: ticketvalidationdatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: ticket-validation-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + name: ticket-validation-service + spec: + selector: + matchLabels: io.kompose.service: ticket-validation-service - name: ticket-validation-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: ticket-validation-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-ticket-validation-service - name: ticket-validation-service - resources: {} - volumeMounts: - - mountPath: /app - name: ticket-validation-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-ticket-validation-service + name: ticket-validation-service + resources: {} + volumeMounts: + - mountPath: /app name: ticket-validation-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-ticket-validation/target + name: ticket-validation-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + name: timetable-db + spec: + selector: + matchLabels: io.kompose.service: timetable-db - name: timetable-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: timetable-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - spec: - containers: - - args: - - --default-authentication-plugin=mysql_native_password - env: - - name: MYSQL_DATABASE - value: Timetable - - name: MYSQL_ROOT_PASSWORD - value: timetabledatabase - ports: - - containerPort: 3306 - image: mysql:5.7 - name: timetable-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: Timetable + - name: MYSQL_ROOT_PASSWORD + value: timetabledatabase + ports: + - containerPort: 3306 + image: mysql:5.7 + name: timetable-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + name: timetable-service + spec: + selector: + matchLabels: io.kompose.service: timetable-service - name: timetable-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: timetable-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-timetable-service - name: timetable-service - resources: {} - volumeMounts: - - mountPath: /app - name: timetable-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-timetable-service + name: timetable-service + resources: {} + volumeMounts: + - mountPath: /app name: timetable-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-timetable/target + name: timetable-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + name: train-db + spec: + selector: + matchLabels: io.kompose.service: train-db - name: train-db - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: train-db - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - spec: - containers: - - image: mongo - name: train-db - resources: {} - restartPolicy: Always - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + spec: + containers: + - image: mongo + name: train-db + resources: {} + restartPolicy: Always + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + name: train-service + spec: + selector: + matchLabels: io.kompose.service: train-service - name: train-service - spec: - selector: - matchLabels: + replicas: 1 + strategy: + type: Recreate + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: train-service - replicas: 1 - strategy: - type: Recreate - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-service - spec: - containers: - - image: gilliswerrebrouck/railway-app-train-service - name: train-service - resources: {} - volumeMounts: - - mountPath: /app - name: train-service-hostpath0 - restartPolicy: Always - volumes: - - hostPath: - path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target + spec: + containers: + - image: gilliswerrebrouck/railway-app-train-service + name: train-service + resources: {} + volumeMounts: + - mountPath: /app name: train-service-hostpath0 - status: {} - - apiVersion: apps/v1 - kind: Deployment - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: + restartPolicy: Always + volumes: + - hostPath: + path: /users/gillis/Railway-System-Architecture/users/gillis/Railway-System-Architecture/railway-app-train/target + name: train-service-hostpath0 + status: {} +- apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: zookeeper-container + name: zookeeper-container + spec: + selector: + matchLabels: io.kompose.service: zookeeper-container - name: zookeeper-container - spec: - selector: - matchLabels: + replicas: 1 + strategy: {} + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: io.kompose.service: zookeeper-container - replicas: 1 - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: zookeeper-container - spec: - containers: - - env: - - name: ZOOKEEPER_CLIENT_PORT - value: "2181" - image: confluentinc/cp-zookeeper - name: zookeeper-container - resources: {} - restartPolicy: Always - status: {} - kind: List - metadata: {} + spec: + containers: + - env: + - name: ZOOKEEPER_CLIENT_PORT + value: "2181" + image: confluentinc/cp-zookeeper + name: zookeeper-container + resources: {} + restartPolicy: Always + status: {} +kind: List +metadata: {} From d49c943816c32836d630b6133a79d38f62e64268 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 22:00:57 +0100 Subject: [PATCH 28/42] Fix yaml indentation issue --- kubernetes-deployment.yaml | 272 ++++++++++++++++++------------------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 51df817..c3ed600 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -1,149 +1,149 @@ apiVersion: v1 items: - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: route-db - name: route-db - spec: - ports: - - port: 7687 - selector: - io.kompose.service: route-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-db + name: route-db + spec: + ports: + - port: 7687 + selector: + io.kompose.service: route-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: staff-db - name: staff-db - spec: - ports: - - port: 27017 - selector: - io.kompose.service: staff-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-db + name: staff-db + spec: + ports: + - port: 27017 + selector: + io.kompose.service: staff-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: train-db - name: train-db - spec: - ports: - - port: 27017 - selector: - io.kompose.service: train-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-db + name: train-db + spec: + ports: + - port: 27017 + selector: + io.kompose.service: train-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: maintenance-db - name: maintenance-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: maintenance-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-db + name: maintenance-db + spec: + ports: + - port: 3306 + selector: + io.kompose.service: maintenance-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: station-db - name: station-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: station-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-db + name: station-db + spec: + ports: + - port: 3306 + selector: + io.kompose.service: station-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-sale-db - name: ticket-sale-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: ticket-sale-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-db + name: ticket-sale-db + spec: + ports: + - port: 3306 + selector: + io.kompose.service: ticket-sale-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: ticket-validation-db - name: ticket-validation-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: ticket-validation-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-db + name: ticket-validation-db + spec: + ports: + - port: 3306 + selector: + io.kompose.service: ticket-validation-db + status: + loadBalancer: {} - apiVersion: v1 - kind: Service - metadata: - annotations: - kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out - kubernetes-deployment.yaml - kompose.version: 1.20.0 (f3d54d784) - creationTimestamp: null - labels: - io.kompose.service: timetable-db - name: timetable-db - spec: - ports: - - port: 3306 - selector: - io.kompose.service: timetable-db - status: - loadBalancer: {} + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-db + name: timetable-db + spec: + ports: + - port: 3306 + selector: + io.kompose.service: timetable-db + status: + loadBalancer: {} - apiVersion: v1 kind: Service metadata: From 555986730091b7d4fbd90da983b2e5c5a28f782b Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 22:44:52 +0100 Subject: [PATCH 29/42] Add service for delay-request-db --- kubernetes-deployment.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index c3ed600..e7c45fa 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -90,6 +90,24 @@ items: io.kompose.service: station-db status: loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-request-db + name: delay-request-db + spec: + ports: + - port: 6379 + selector: + io.kompose.service: delay-request-db + status: + loadBalancer: {} - apiVersion: v1 kind: Service metadata: From 379a039140c89cdf2f71ae7062f876b49cd59688 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 22:53:37 +0100 Subject: [PATCH 30/42] Fix container ports --- kubernetes-deployment.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index e7c45fa..a56596c 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -316,6 +316,8 @@ items: - image: redis name: delay-request-db resources: {} + ports: + - containerPort: 6379 restartPolicy: Always status: {} - apiVersion: apps/v1 @@ -480,7 +482,7 @@ items: - name: MYSQL_ROOT_PASSWORD value: maintenancedatabase ports: - - containerPort: 3306 + - containerPort: 3306 image: mysql:5.7 name: maintenance-db resources: {} @@ -637,7 +639,7 @@ items: - image: mongo name: staff-db ports: - - containerPort: 27017 + - containerPort: 27017 resources: {} restartPolicy: Always status: {} @@ -718,7 +720,7 @@ items: - name: MYSQL_ROOT_PASSWORD value: stationdatabase ports: - - containerPort: 3306 + - containerPort: 3306 image: mysql:5.7 name: station-db resources: {} @@ -801,7 +803,7 @@ items: - name: MYSQL_ROOT_PASSWORD value: ticketsaledatabase ports: - - containerPort: 3306 + - containerPort: 3306 image: mysql:5.7 name: ticket-sale-db resources: {} @@ -884,7 +886,7 @@ items: - name: MYSQL_ROOT_PASSWORD value: ticketvalidationdatabase ports: - - containerPort: 3306 + - containerPort: 3306 image: mysql:5.7 name: ticket-validation-db resources: {} @@ -967,7 +969,7 @@ items: - name: MYSQL_ROOT_PASSWORD value: timetabledatabase ports: - - containerPort: 3306 + - containerPort: 3306 image: mysql:5.7 name: timetable-db resources: {} From fca73b21e99c76316f67b88c3eb17f8c0fbd23a7 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Fri, 17 Jan 2020 23:34:22 +0100 Subject: [PATCH 31/42] Add services for all micro services --- kubernetes-deployment.yaml | 162 +++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index a56596c..59cfeea 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -222,6 +222,168 @@ items: io.kompose.service: kafka-container status: loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: maintenance-service + name: maintenance-service + spec: + ports: + - port: 2005 + selector: + io.kompose.service: maintenance-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: route-service + name: route-service + spec: + ports: + - port: 2000 + selector: + io.kompose.service: route-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: staff-service + name: staff-service + spec: + ports: + - port: 2006 + selector: + io.kompose.service: staff-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: station-service + name: station-service + spec: + ports: + - port: 2002 + selector: + io.kompose.service: station-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-sale-service + name: ticket-sale-service + spec: + ports: + - port: 2007 + selector: + io.kompose.service: ticket-sale-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: ticket-validation-service + name: ticket-validation-service + spec: + ports: + - port: 2008 + selector: + io.kompose.service: ticket-validation-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: timetable-service + name: timetable-service + spec: + ports: + - port: 2001 + selector: + io.kompose.service: timetable-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: train-service + name: train-service + spec: + ports: + - port: 2003 + selector: + io.kompose.service: train-service + status: + loadBalancer: {} +- apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yaml --volumes hostPath --out + kubernetes-deployment.yaml + kompose.version: 1.20.0 (f3d54d784) + creationTimestamp: null + labels: + io.kompose.service: delay-service + name: delay-service + spec: + ports: + - port: 2004 + selector: + io.kompose.service: delay-service + status: + loadBalancer: {} - apiVersion: v1 kind: Service metadata: From 3fdb924b5d75aecfce8c0e169e9c521fe99bc153 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 00:20:34 +0100 Subject: [PATCH 32/42] Fix bug in station delay --- .../com/railway/station_service/domain/StationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index 52e6d4f..471db43 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -107,14 +107,15 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { List stations = new ArrayList<>(); StationOnRoute previous = startStation; + boolean partOfDelay = false; if(dr.getStartStationId() == null) { stations.add(startStation); + partOfDelay = true; } StationOnRoute current = null; Collection allRouteConnections = routeFetchedResponse.getRouteConnections(); - boolean partOfDelay = false; while(allRouteConnections.size() > 0) { RoutePart routePart = getNextRoutePart(allRouteConnections, UUID.fromString(previous.getStationId())); From 8cbc533b052492324664b43345727a7229168fcf Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 01:15:49 +0100 Subject: [PATCH 33/42] Fix bug in station delay --- .../railway/station_service/domain/StationService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index 471db43..661aa01 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -100,15 +100,16 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { if(dr != null) { //find first station of route that will be affected by delay //if no start station is present in delay request then all stations on the given route are notified of the delay - StationOnRoute startStation = null; - startStation = getStart(routeFetchedResponse.getRoute()); + StationOnRoute startStation = getStart(routeFetchedResponse.getRoute()); //get following stations on that route List stations = new ArrayList<>(); StationOnRoute previous = startStation; boolean partOfDelay = false; - if(dr.getStartStationId() == null) { + if(dr.getStartStationId() == null || + dr.getStartStationId().toString().isBlank() || + startStation.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { stations.add(startStation); partOfDelay = true; } @@ -116,7 +117,6 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { StationOnRoute current = null; Collection allRouteConnections = routeFetchedResponse.getRouteConnections(); - while(allRouteConnections.size() > 0) { RoutePart routePart = getNextRoutePart(allRouteConnections, UUID.fromString(previous.getStationId())); if(routePart == null) { From 98a3eadd7b4901a076f401b6b34778e6a64da867 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 01:39:43 +0100 Subject: [PATCH 34/42] Add logging --- .../railway/station_service/domain/StationService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index 661aa01..d062714 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -98,17 +98,16 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { delayRequestRepository.deleteById(routeFetchedResponse.getRequestId()); if(dr != null) { - //find first station of route that will be affected by delay - //if no start station is present in delay request then all stations on the given route are notified of the delay + // find first station of route that will be affected by delay + // if no start station is present in delay request then all stations on the given route are notified of the delay StationOnRoute startStation = getStart(routeFetchedResponse.getRoute()); - //get following stations on that route + // get following stations on that route List stations = new ArrayList<>(); StationOnRoute previous = startStation; - + logger.info("START STATION ID: "+ dr.getStartStationId().toString()); boolean partOfDelay = false; if(dr.getStartStationId() == null || - dr.getStartStationId().toString().isBlank() || startStation.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { stations.add(startStation); partOfDelay = true; From e11c0fd27bb5dfe3aa14b99f4b02261b11f59200 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 01:51:02 +0100 Subject: [PATCH 35/42] Update pull policy --- kubernetes-deployment.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 59cfeea..1a6f069 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -434,6 +434,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-api-gateway-service + imagePullPolicy: Always name: apigateway ports: - containerPort: 8080 @@ -512,6 +513,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-delay-service + imagePullPolicy: Always name: delay-service resources: {} volumeMounts: @@ -553,6 +555,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-frontend + imagePullPolicy: Always name: frontend ports: - containerPort: 80 @@ -680,6 +683,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-maintenance-service + imagePullPolicy: Always name: maintenance-service resources: {} volumeMounts: @@ -759,6 +763,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-route-management-service + imagePullPolicy: Always name: route-service resources: {} volumeMounts: @@ -835,6 +840,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-staff-service + imagePullPolicy: Always name: staff-service resources: {} volumeMounts: @@ -918,6 +924,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-station-service + imagePullPolicy: Always name: station-service resources: {} volumeMounts: @@ -1001,6 +1008,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-ticket-sale-service + imagePullPolicy: Always name: ticket-sale-service resources: {} volumeMounts: @@ -1084,6 +1092,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-ticket-validation-service + imagePullPolicy: Always name: ticket-validation-service resources: {} volumeMounts: @@ -1167,6 +1176,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-timetable-service + imagePullPolicy: Always name: timetable-service resources: {} volumeMounts: @@ -1241,6 +1251,7 @@ items: spec: containers: - image: gilliswerrebrouck/railway-app-train-service + imagePullPolicy: Always name: train-service resources: {} volumeMounts: From 1fffe806b9481130131bf37eab602a1d3a22a2b3 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 11:54:41 +0100 Subject: [PATCH 36/42] Add logging --- .../com/railway/station_service/domain/StationService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index d062714..d89871c 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -96,6 +96,8 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { // get the delay request in the key-value store and delete it DelayRequest dr = delayRequestRepository.findById(routeFetchedResponse.getRequestId()).orElse(null); delayRequestRepository.deleteById(routeFetchedResponse.getRequestId()); + + logger.debug("START STATION ID: "+ dr.getStartStationId().toString()); if(dr != null) { // find first station of route that will be affected by delay @@ -105,7 +107,7 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { // get following stations on that route List stations = new ArrayList<>(); StationOnRoute previous = startStation; - logger.info("START STATION ID: "+ dr.getStartStationId().toString()); + boolean partOfDelay = false; if(dr.getStartStationId() == null || startStation.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { @@ -140,6 +142,7 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { } previous=current; } + logger.debug("STATIONS COUNT: "+ stations.size()); getStationsFromDatabase(stations, dr); } } From 8cac1725a57be27ee19216739455ee9176a752da Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 12:47:21 +0100 Subject: [PATCH 37/42] Remove logging --- .../com/railway/station_service/domain/StationService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index d89871c..2d9ddff 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -96,8 +96,6 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { // get the delay request in the key-value store and delete it DelayRequest dr = delayRequestRepository.findById(routeFetchedResponse.getRequestId()).orElse(null); delayRequestRepository.deleteById(routeFetchedResponse.getRequestId()); - - logger.debug("START STATION ID: "+ dr.getStartStationId().toString()); if(dr != null) { // find first station of route that will be affected by delay @@ -142,7 +140,7 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { } previous=current; } - logger.debug("STATIONS COUNT: "+ stations.size()); + getStationsFromDatabase(stations, dr); } } From 186047a9ce528ee9531e4fa3fe94462a014892a6 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 13:27:18 +0100 Subject: [PATCH 38/42] Add extra checking --- .../java/com/railway/station_service/domain/StationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index 2d9ddff..8f5ada9 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -107,7 +107,7 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { StationOnRoute previous = startStation; boolean partOfDelay = false; - if(dr.getStartStationId() == null || + if(dr.getStartStationId() == null || dr.getStartStationId().compareTo(UUID.fromString(null)) == 0 || startStation.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { stations.add(startStation); partOfDelay = true; From 6a9a676ea8324a8fbcf693586757c92e50b27716 Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 14:01:17 +0100 Subject: [PATCH 39/42] Fix bug in station delay --- .../com/railway/station_service/domain/StationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java index 8f5ada9..e7fc773 100644 --- a/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java +++ b/railway-app-station/src/main/java/com/railway/station_service/domain/StationService.java @@ -107,8 +107,9 @@ public void routeFetched(RouteFetchedResponse routeFetchedResponse) { StationOnRoute previous = startStation; boolean partOfDelay = false; - if(dr.getStartStationId() == null || dr.getStartStationId().compareTo(UUID.fromString(null)) == 0 || + if(dr.getStartStationId() == null || startStation.getStationId().compareTo(dr.getStartStationId().toString()) == 0) { + dr.setStartStationId(UUID.fromString(startStation.getStationId())); stations.add(startStation); partOfDelay = true; } From aaf6332f7eb12bfc821e1a3a0f305a9856b758ee Mon Sep 17 00:00:00 2001 From: GillisWerrebrouck Date: Sat, 18 Jan 2020 14:38:50 +0100 Subject: [PATCH 40/42] Add chaos monkey immunity labels --- kubernetes-deployment.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/kubernetes-deployment.yaml b/kubernetes-deployment.yaml index 1a6f069..e810ffc 100644 --- a/kubernetes-deployment.yaml +++ b/kubernetes-deployment.yaml @@ -458,6 +458,7 @@ items: creationTimestamp: null labels: io.kompose.service: delay-request-db + chaos: immune name: delay-request-db spec: selector: @@ -474,6 +475,7 @@ items: creationTimestamp: null labels: io.kompose.service: delay-request-db + chaos: immune spec: containers: - image: redis @@ -535,6 +537,7 @@ items: creationTimestamp: null labels: io.kompose.service: frontend + chaos: immune name: frontend spec: selector: @@ -552,6 +555,7 @@ items: creationTimestamp: null labels: io.kompose.service: frontend + chaos: immune spec: containers: - image: gilliswerrebrouck/railway-app-frontend @@ -579,6 +583,7 @@ items: creationTimestamp: null labels: io.kompose.service: kafka-container + chaos: immune name: kafka-container spec: selector: @@ -595,6 +600,7 @@ items: creationTimestamp: null labels: io.kompose.service: kafka-container + chaos: immune spec: containers: - env: @@ -621,6 +627,7 @@ items: creationTimestamp: null labels: io.kompose.service: maintenance-db + chaos: immune name: maintenance-db spec: selector: @@ -637,6 +644,7 @@ items: creationTimestamp: null labels: io.kompose.service: maintenance-db + chaos: immune spec: containers: - args: @@ -705,6 +713,7 @@ items: creationTimestamp: null labels: io.kompose.service: route-db + chaos: immune name: route-db spec: selector: @@ -721,6 +730,7 @@ items: creationTimestamp: null labels: io.kompose.service: route-db + chaos: immune spec: containers: - env: @@ -785,6 +795,7 @@ items: creationTimestamp: null labels: io.kompose.service: staff-db + chaos: immune name: staff-db spec: selector: @@ -801,6 +812,7 @@ items: creationTimestamp: null labels: io.kompose.service: staff-db + chaos: immune spec: containers: - image: mongo @@ -862,6 +874,7 @@ items: creationTimestamp: null labels: io.kompose.service: station-db + chaos: immune name: station-db spec: selector: @@ -878,6 +891,7 @@ items: creationTimestamp: null labels: io.kompose.service: station-db + chaos: immune spec: containers: - args: @@ -946,6 +960,7 @@ items: creationTimestamp: null labels: io.kompose.service: ticket-sale-db + chaos: immune name: ticket-sale-db spec: selector: @@ -962,6 +977,7 @@ items: creationTimestamp: null labels: io.kompose.service: ticket-sale-db + chaos: immune spec: containers: - args: @@ -1030,6 +1046,7 @@ items: creationTimestamp: null labels: io.kompose.service: ticket-validation-db + chaos: immune name: ticket-validation-db spec: selector: @@ -1046,6 +1063,7 @@ items: creationTimestamp: null labels: io.kompose.service: ticket-validation-db + chaos: immune spec: containers: - args: @@ -1114,6 +1132,7 @@ items: creationTimestamp: null labels: io.kompose.service: timetable-db + chaos: immune name: timetable-db spec: selector: @@ -1130,6 +1149,7 @@ items: creationTimestamp: null labels: io.kompose.service: timetable-db + chaos: immune spec: containers: - args: @@ -1198,6 +1218,7 @@ items: creationTimestamp: null labels: io.kompose.service: train-db + chaos: immune name: train-db spec: selector: @@ -1214,6 +1235,7 @@ items: creationTimestamp: null labels: io.kompose.service: train-db + chaos: immune spec: containers: - image: mongo @@ -1273,6 +1295,7 @@ items: creationTimestamp: null labels: io.kompose.service: zookeeper-container + chaos: immune name: zookeeper-container spec: selector: @@ -1289,6 +1312,7 @@ items: creationTimestamp: null labels: io.kompose.service: zookeeper-container + chaos: immune spec: containers: - env: From 55d58a131436aa5166e17a325073e4f517f1f71a Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 18 Jan 2020 15:08:21 +0100 Subject: [PATCH 41/42] Add chaos monkey script --- chaos.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 chaos.sh diff --git a/chaos.sh b/chaos.sh new file mode 100644 index 0000000..3dc8722 --- /dev/null +++ b/chaos.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Randomly delete pods in a Kubernetes namespace. +# Pods with label 'chaos=immune' will be spared. +set -ex + +: ${DELAY:=30} +: ${NAMESPACE:=default} + +while true; do + kubectl \ + --namespace "${NAMESPACE}" \ + -o 'jsonpath={.items[*].metadata.name}' \ + -l 'chaos!=immune' \ + get pods | \ + tr " " "\n" | \ + shuf | \ + head -n 1 | + xargs -t --no-run-if-empty \ + kubectl --namespace "${NAMESPACE}" delete pod + sleep "${DELAY}" +done From 115fde28c78d210036be5d1ed03f964621ef6bcb Mon Sep 17 00:00:00 2001 From: Gillis Werrebrouck Date: Sat, 18 Jan 2020 15:19:52 +0100 Subject: [PATCH 42/42] Update readme --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 6d6324c..a54077f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ ## Run all the services +### Run Docker setup + +Execute the following command to build all microservices and start all docker containers. + ``` bash build.sh && docker-compose up --build ``` @@ -11,3 +15,38 @@ To initialise a basic railway network with stations, use the following REST call curl -X POST http://localhost:8080/station/init curl -X POST http://localhost:8080/network/init ``` + +### Run Kubernetes setup + +``` +kubectl create -f kubernetes-deployment.yaml +``` + +All services will start and all pods will be created. Execute the following command to check if all pods are running stable; + +``` +while true; do clear; kubectl get pods; sleep 3; done; +``` + +To access the frontend you should have portforwarding enabled for the frontend service, as well as for the route-db service and the apigateway service. The reason why the route-db service needs to be port forwarded is due to the fact that there is a canvas displaying all station nodes and route nodes on the frontend which uses a package that needs access to the Neo4j database. + +If portforwarding is not an option, then try ssh tunneling (for all three services mentioned above) by using the following command as a template. + +``` +ssh -L :: -i '' @ -oPort=22 +-oProxyCommand="ssh -i -oPort=22 @ -W %h:%p" +``` + +To initialise a basic railway network with stations, use the following REST calls (either both should be executed or none); + +``` +curl -X POST http://localhost:8080/station/init +curl -X POST http://localhost:8080/network/init +``` + +There is also a bash script `chaos.sh` in the root of this project that automatically kills services that aren't labelled as immune. This script has a default delay of 30 seconds. This can be changed by setting the environment variable DELAY to a certain value. Execute the following command to see all pods that are or aren't labelled immune. + +``` +kubectl --namespace default -l 'chaos=immune' get pods +kubectl --namespace default -l 'chaos!=immune' get pods +``` \ No newline at end of file
Staff IDRequest ID Schedule datetime