Skip to content

Commit

Permalink
code refactored and port/host changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abidknashtech committed Nov 28, 2023
1 parent 2b73249 commit 9392261
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 18 deletions.
12 changes: 9 additions & 3 deletions car-ui/src/app/shared/services/car-details.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ import { CarBrand, CarDetails } from "../module/cars-details.model";
providedIn: "root",
})
export class CarDetailsService {
private brandsUrlGCP = "http://35.193.88.251/v1/data/brands";
private const ADMIN_GCP_HOST = `localhost`;

//GCP host
private brandsUrlGCP = "http://${this.ADMIN_GCP_HOST}/v1/data/brands";
private carModelsUrlGCP = "http://${this.ADMIN_GCP_HOST}/v1/data/cars/";
private addBulkDataGCP: string = "http://${this.ADMIN_GCP_HOST}/v1/data";

//azure host
private brandsUrlAzure = "http://40.88.227.104/v1/data/brands";
private carModelsUrlAzure = "http://40.88.227.104/v1/data/cars/";
private carModelsUrlGCP = "http://35.193.88.251/v1/data/cars/";
private addBulkDataGCP: string = "http://35.193.88.251/v1/data";
private addBulkDataAzure: string = "http://40.88.227.104/v1/data";

//private brandsUrlGCPSSE = "http://35.193.88.251/v1/data/brands-sse";
//private eventSource!: EventSource;
//carBrands: CarBrand[] = [];
Expand Down
10 changes: 6 additions & 4 deletions car-ui/src/app/shared/services/cart.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export class CartService {

private cartItemCountSubject: BehaviorSubject<number>;
cartItemCount$: Observable<number>;
private getCartItemUrl : string = "http://localhost:9094/cart/get";
private placeOrderUrl = "http://localhost:9090/orders";
private removeFromCartUrl :string = "http://localhost:9094/cart/remove";
private addToCartUrl : string = "http://localhost:9094/cart/add";
private const CART_HOST = `localhost`;
private const ORDER_HOST = 'localhost';
private getCartItemUrl : string = "http://${this.CART_HOST}:9094/cart/get";
private removeFromCartUrl :string = "http://${this.CART_HOST}:9094/cart/remove";
private addToCartUrl : string = "http://${this.CART_HOST}:9094/cart/add";
private placeOrderUrl :string = "http://${this.ORDER_HOST}:9090/orders";

constructor(private httpClient: HttpClient) {
const initialCount = parseInt(localStorage.getItem('cartCount') || '0', 10);
Expand Down
1 change: 0 additions & 1 deletion deployment/gcpresources/terraform/elastic-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
namespace: elasticsearchdemo
spec:
version: 7.6.0
nodeSets:
Expand Down
3 changes: 3 additions & 0 deletions deployment/gcpresources/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ resource "google_container_cluster" "car-demo-gke" {
services_ipv4_cidr_block = ""
}
enable_autopilot = true
deletion_protection = false
}

#GKE Cluster for axon-server
Expand All @@ -162,6 +163,7 @@ resource "google_container_cluster" "axon-server-gke" {
services_ipv4_cidr_block = ""
}
enable_autopilot = true
deletion_protection = false
}

resource "null_resource" "external-secret-car-demo-gke" {
Expand All @@ -187,6 +189,7 @@ resource "google_container_cluster" "elasticsearch-server-gke" {
services_ipv4_cidr_block = ""
}
enable_autopilot = true
deletion_protection = false
}
resource "null_resource" "elasticsearch-server-gke" {
provisioner "local-exec" {
Expand Down
4 changes: 2 additions & 2 deletions inventory-service/gcp-deploy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ metadata:
name: inventory-configmap
data:
# Configuration values can be set as key-value properties
MYSQL_HOST: 35.196.34.197
AXON_HOST: 34.139.86.49:8124
MYSQL_HOST: 34.148.168.181
AXON_HOST: 35.231.81.51:8124
SERVICE_NAME: InventoryService
GCP_PROJECT_ID: datamesh-2
PRODUCT_SUBSCRIPTION: inventory_subscription
4 changes: 2 additions & 2 deletions order-service/gcp-deploy-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@ metadata:
name: orderservice-configmap
data:
# Configuration values can be set as key-value properties
MYSQL_HOST: 34.23.67.210
AXON_HOST: 34.138.203.107:8124
MYSQL_HOST: 34.148.168.181
AXON_HOST: 35.231.81.51:8124
SERVICE_NAME: OrderService
4 changes: 2 additions & 2 deletions payment-service/gcp-deploy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ metadata:
name: payment-configmap
data:
# Configuration values can be set as key-value properties
MYSQL_HOST: 34.23.67.210
AXON_HOST: 34.138.203.107:8124
MYSQL_HOST: 34.148.168.181
AXON_HOST: 35.231.81.51:8124
SERVICE_NAME: PaymentService
6 changes: 5 additions & 1 deletion projects-changes-deploy.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@

admin-service
inventory-service
order-service
payment-service
shipment-service
5 changes: 2 additions & 3 deletions shipment-service/gcp-deploy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ spec:
remoteRef:
key: car-demo-secret
version: latest

---

kind: ConfigMap
Expand All @@ -117,8 +116,8 @@ metadata:
name: shipment-configmap
data:
# Configuration values can be set as key-value properties
MYSQL_HOST: 34.23.67.210
AXON_HOST: 34.138.203.107:8124
MYSQL_HOST: 34.148.168.181
AXON_HOST: 35.231.81.51:8124
GCP_PROJECT_ID: datamesh-2
PUB_SUB_TOPIC_ID: shipment-notification
SERVICE_NAME: ShipmentService

0 comments on commit 9392261

Please sign in to comment.