From 00e5d1456ccc6f55a9e22465397bbbf6ffbe5ff6 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 07:47:00 +0700 Subject: [PATCH 1/9] insert add --- index.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 000000000..fe3144730 --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +fdfd From cfaef92da8af42a80fb5df4248ed7714d11f0f7d Mon Sep 17 00:00:00 2001 From: irvan febriansyah Date: Tue, 24 Oct 2023 09:32:00 +0700 Subject: [PATCH 2/9] Delete index.js --- index.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index fe3144730..000000000 --- a/index.js +++ /dev/null @@ -1 +0,0 @@ -fdfd From 2e50cb8c7df3dcdcca064c3eb424f44af56bef97 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 09:34:13 +0700 Subject: [PATCH 3/9] tes --- index.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 000000000..ccfd034bd --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +dsdsds From 6d90d18a3cb29f08a6ee082276ddb7dd50a83517 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 09:52:24 +0700 Subject: [PATCH 4/9] add kubernetes --- order-service-deployment.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 order-service-deployment.yaml diff --git a/order-service-deployment.yaml b/order-service-deployment.yaml new file mode 100644 index 000000000..d64037e51 --- /dev/null +++ b/order-service-deployment.yaml @@ -0,0 +1,27 @@ + apiVersion: apps/v1 # Specifies the API version being used (apps/v1 in this case). + kind: Deployment # Defines the Kubernetes resource type as a Deployment. + metadata: + name: order-service-deploy # Name of the Deployment resource + spec: + replicas: 1 # Specifies the desired number of replicas for the Deployment + selector: + matchLabels: + app: order-service # Selects Pods based on the app label with the value order-service + template: + metadata: + labels: + app: order-service # Labels the Pods created by this template with the app label and value order-service + spec: + containers: + - name: order-service # Name of the container within the Pod + image: ghcr.io/lareza-farhan-wanaghi/order-service:latest # Docker image used for the container + ports: + - containerPort: 3000 # Port on which the container listens for incoming traffic + env: + - name: AMQP_PASSWORD # Environmental variable name for the RabbitMQ password + valueFrom: + secretKeyRef: + name: my-rabbitmq # Name of the Secret containing the RabbitMQ password + key: rabbitmq-password # Key within the Secret to retrieve the RabbitMQ password + - name: AMQP_URL # Environmental variable name for the RabbitMQ URL + value: "amqp://user:$(AMQP_PASSWORD)@my-rabbitmq:5672" # Value for the RabbitMQ URL, including the username, password, and host From d802a80ee9d0b6ab0630cecfae63dd3801a7e2b2 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 09:53:49 +0700 Subject: [PATCH 5/9] replace svc --- README.md | 2 -- index.js | 1 - order-service-deployment.yaml | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 README.md delete mode 100644 index.js diff --git a/README.md b/README.md deleted file mode 100644 index 96ca8c917..000000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# a433-microservices -Repository ini digunakan untuk kebutuhan kelas Belajar Membangun Arsitektur Microservices diff --git a/index.js b/index.js deleted file mode 100644 index ccfd034bd..000000000 --- a/index.js +++ /dev/null @@ -1 +0,0 @@ -dsdsds diff --git a/order-service-deployment.yaml b/order-service-deployment.yaml index d64037e51..364d6bbb5 100644 --- a/order-service-deployment.yaml +++ b/order-service-deployment.yaml @@ -14,7 +14,7 @@ spec: containers: - name: order-service # Name of the container within the Pod - image: ghcr.io/lareza-farhan-wanaghi/order-service:latest # Docker image used for the container + image: ghcr.io/irvanfebri/order-service:latest # Docker image used for the container ports: - containerPort: 3000 # Port on which the container listens for incoming traffic env: From 3f5233de2ba59f87e0214473f3d4bcae0f11a894 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 09:56:37 +0700 Subject: [PATCH 6/9] add order service --- order-service/order-service-deployment.yaml | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 order-service/order-service-deployment.yaml diff --git a/order-service/order-service-deployment.yaml b/order-service/order-service-deployment.yaml new file mode 100644 index 000000000..364d6bbb5 --- /dev/null +++ b/order-service/order-service-deployment.yaml @@ -0,0 +1,27 @@ + apiVersion: apps/v1 # Specifies the API version being used (apps/v1 in this case). + kind: Deployment # Defines the Kubernetes resource type as a Deployment. + metadata: + name: order-service-deploy # Name of the Deployment resource + spec: + replicas: 1 # Specifies the desired number of replicas for the Deployment + selector: + matchLabels: + app: order-service # Selects Pods based on the app label with the value order-service + template: + metadata: + labels: + app: order-service # Labels the Pods created by this template with the app label and value order-service + spec: + containers: + - name: order-service # Name of the container within the Pod + image: ghcr.io/irvanfebri/order-service:latest # Docker image used for the container + ports: + - containerPort: 3000 # Port on which the container listens for incoming traffic + env: + - name: AMQP_PASSWORD # Environmental variable name for the RabbitMQ password + valueFrom: + secretKeyRef: + name: my-rabbitmq # Name of the Secret containing the RabbitMQ password + key: rabbitmq-password # Key within the Secret to retrieve the RabbitMQ password + - name: AMQP_URL # Environmental variable name for the RabbitMQ URL + value: "amqp://user:$(AMQP_PASSWORD)@my-rabbitmq:5672" # Value for the RabbitMQ URL, including the username, password, and host From 877227efa5f544092ab5e96e73ea67bdd5f5f202 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 09:58:41 +0700 Subject: [PATCH 7/9] delete order v1.1 --- order-service-deployment.yaml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 order-service-deployment.yaml diff --git a/order-service-deployment.yaml b/order-service-deployment.yaml deleted file mode 100644 index 364d6bbb5..000000000 --- a/order-service-deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ - apiVersion: apps/v1 # Specifies the API version being used (apps/v1 in this case). - kind: Deployment # Defines the Kubernetes resource type as a Deployment. - metadata: - name: order-service-deploy # Name of the Deployment resource - spec: - replicas: 1 # Specifies the desired number of replicas for the Deployment - selector: - matchLabels: - app: order-service # Selects Pods based on the app label with the value order-service - template: - metadata: - labels: - app: order-service # Labels the Pods created by this template with the app label and value order-service - spec: - containers: - - name: order-service # Name of the container within the Pod - image: ghcr.io/irvanfebri/order-service:latest # Docker image used for the container - ports: - - containerPort: 3000 # Port on which the container listens for incoming traffic - env: - - name: AMQP_PASSWORD # Environmental variable name for the RabbitMQ password - valueFrom: - secretKeyRef: - name: my-rabbitmq # Name of the Secret containing the RabbitMQ password - key: rabbitmq-password # Key within the Secret to retrieve the RabbitMQ password - - name: AMQP_URL # Environmental variable name for the RabbitMQ URL - value: "amqp://user:$(AMQP_PASSWORD)@my-rabbitmq:5672" # Value for the RabbitMQ URL, including the username, password, and host From 03e486f40360aa8d39a10723ad94cfab31b97fe1 Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 10:19:21 +0700 Subject: [PATCH 8/9] order-service --- .../shipping-service-deployment.yaml | 27 +++++++++++++++++++ .../shipping-service-service.yaml | 9 +++++++ 2 files changed, 36 insertions(+) create mode 100644 shipping-service/shipping-service-deployment.yaml create mode 100644 shipping-service/shipping-service-service.yaml diff --git a/shipping-service/shipping-service-deployment.yaml b/shipping-service/shipping-service-deployment.yaml new file mode 100644 index 000000000..429a637ed --- /dev/null +++ b/shipping-service/shipping-service-deployment.yaml @@ -0,0 +1,27 @@ + apiVersion: apps/v1 # Specifies the API version being used (apps/v1 in this case). + kind: Deployment # Defines that this YAML describes a Kubernetes Deployment. + metadata: + name: shipping-service-deploy # Deployment name for the shipping service + spec: + replicas: 1 # Desired number of replicas for the shipping service + selector: + matchLabels: + app: shipping-service # Selector label for the shipping service app + template: + metadata: + labels: + app: shipping-service # Label for the shipping service app + spec: + containers: + - name: shipping-service # Container name for the shipping service + image: ghcr.io/irvanfebri/shipping-service:latest # Container image for the shipping service + ports: + - containerPort: 3001 # Port on which the shipping service container listens + env: + - name: AMQP_PASSWORD # Environment variable for AMQP password + valueFrom: + secretKeyRef: + name: my-rabbitmq # Secret name for RabbitMQ credentials + key: rabbitmq-password # Secret key for RabbitMQ password + - name: AMQP_URL # Environment variable for AMQP URL + value: "amqp://user:$(AMQP_PASSWORD)@my-rabbitmq:5672" # Value for the AMQP URL diff --git a/shipping-service/shipping-service-service.yaml b/shipping-service/shipping-service-service.yaml new file mode 100644 index 000000000..d05c25bd6 --- /dev/null +++ b/shipping-service/shipping-service-service.yaml @@ -0,0 +1,9 @@ + apiVersion: v1 # Specifies the API version being used (v1 in this case). + kind: Service # Defines that this YAML describes a Kubernetes Service. + metadata: + name: shipping-service-svc # Specifies the name of the Service. + spec: + selector: + app: shipping-service # Defines the selector to identify the pods targeted by this service. + ports: + - port: 3001 # Specifies the port number (3001 in this case). From b4e135a9fea8cf0e81bf5e1f9622aaa06374a5ff Mon Sep 17 00:00:00 2001 From: irvanfebri Date: Tue, 24 Oct 2023 10:21:57 +0700 Subject: [PATCH 9/9] add kubernetes order-service --- order-service/order-service-gateway.yaml | 14 ++++++++++++++ order-service/order-service-service.yaml | 9 +++++++++ .../order-service-virtualservice.yaml | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 order-service/order-service-gateway.yaml create mode 100644 order-service/order-service-service.yaml create mode 100644 order-service/order-service-virtualservice.yaml diff --git a/order-service/order-service-gateway.yaml b/order-service/order-service-gateway.yaml new file mode 100644 index 000000000..883a40ea0 --- /dev/null +++ b/order-service/order-service-gateway.yaml @@ -0,0 +1,14 @@ + apiVersion: networking.istio.io/v1alpha3 # Specifies the API version being used (networking.istio.io/v1alpha3 in this case). + kind: Gateway # Defines the Kubernetes resource type as a Gateway. + metadata: + name: order-service-gw # Name of the Istio Gateway for the order service. + spec: + selector: + istio: ingressgateway # Selector for the ingress gateway. + servers: + - port: + number: 80 # Port number for HTTP traffic. + name: http # Name of the HTTP protocol. + protocol: HTTP # Protocol used for this port (HTTP). + hosts: + - "*" # Accepting requests from all hosts. diff --git a/order-service/order-service-service.yaml b/order-service/order-service-service.yaml new file mode 100644 index 000000000..aeac6724c --- /dev/null +++ b/order-service/order-service-service.yaml @@ -0,0 +1,9 @@ + apiVersion: v1 # Specifies the API version being used (v1 in this case). + kind: Service # Defines the Kubernetes resource type as a Service. + metadata: + name: order-service-svc # Name assigned to this Service resource. + spec: + selector: + app: order-service # Selects pods labeled with 'app: order-service'. + ports: + - port: 3000 # Exposes the Service on port 3000 using TCP protocol. diff --git a/order-service/order-service-virtualservice.yaml b/order-service/order-service-virtualservice.yaml new file mode 100644 index 000000000..253a3d0ff --- /dev/null +++ b/order-service/order-service-virtualservice.yaml @@ -0,0 +1,18 @@ + apiVersion: networking.istio.io/v1alpha3 # Specifies the API version being used (networking.istio.io/v1alpha3 in this case). + kind: VirtualService # Defines that this YAML describes a VirtualService Service. + metadata: + name: order-service-vs # Name of the VirtualService + spec: + hosts: + - "*" # Match all hosts + gateways: + - order-service-gw # Use the order-service-gw gateway + http: + - match: + - uri: + exact: "/order" # Match exact URI "/order" + route: + - destination: + host: order-service-svc # Send traffic to order-service-svc + port: + number: 3000 # Use port 3000