From 98ac7e3a109472497e131cad6b504d4ddc87e2e5 Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Thu, 21 Jun 2018 14:02:20 -0700 Subject: [PATCH] add kubernetes manifets and skaffold.yaml Signed-off-by: Ahmet Alp Balkan --- kubernetes-manifests/checkoutservice.yaml | 33 +++++++++++++++++++ kubernetes-manifests/emailservice.yaml | 27 +++++++++++++++ .../productcatalogservice.yaml | 27 +++++++++++++++ .../recommendationservice.yaml | 30 +++++++++++++++++ kubernetes-manifests/shippingservice.yaml | 27 +++++++++++++++ skaffold.yaml | 18 ++++++++++ 6 files changed, 162 insertions(+) create mode 100644 kubernetes-manifests/checkoutservice.yaml create mode 100644 kubernetes-manifests/emailservice.yaml create mode 100644 kubernetes-manifests/productcatalogservice.yaml create mode 100644 kubernetes-manifests/recommendationservice.yaml create mode 100644 kubernetes-manifests/shippingservice.yaml create mode 100644 skaffold.yaml diff --git a/kubernetes-manifests/checkoutservice.yaml b/kubernetes-manifests/checkoutservice.yaml new file mode 100644 index 0000000..2a3b45d --- /dev/null +++ b/kubernetes-manifests/checkoutservice.yaml @@ -0,0 +1,33 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: checkoutservice +spec: + replicas: 1 + template: + metadata: + labels: + app: checkoutservice + spec: + containers: + - name: server + image: checkoutservice + ports: + - containerPort: 5000 + env: + - name: PRODUCT_CATALOG_SERVICE_ADDR + value: "productcatalogservice:3550" + - name: SHIPPING_SERVICE_ADDR + value: "shippingservice:50051" +--- +apiVersion: v1 +kind: Service +metadata: + name: checkoutservice +spec: + type: ClusterIP + selector: + app: checkoutservice + ports: + - port: 5000 + targetPort: 5000 diff --git a/kubernetes-manifests/emailservice.yaml b/kubernetes-manifests/emailservice.yaml new file mode 100644 index 0000000..6dbbbc9 --- /dev/null +++ b/kubernetes-manifests/emailservice.yaml @@ -0,0 +1,27 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: emailservice +spec: + template: + metadata: + labels: + app: emailservice + spec: + containers: + - name: server + image: emailservice + ports: + - containerPort: 5000 +--- +apiVersion: v1 +kind: Service +metadata: + name: emailservice +spec: + type: ClusterIP + selector: + app: emailservice + ports: + - port: 5000 + targetPort: 5000 diff --git a/kubernetes-manifests/productcatalogservice.yaml b/kubernetes-manifests/productcatalogservice.yaml new file mode 100644 index 0000000..c72fe65 --- /dev/null +++ b/kubernetes-manifests/productcatalogservice.yaml @@ -0,0 +1,27 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: productcatalogservice +spec: + template: + metadata: + labels: + app: productcatalogservice + spec: + containers: + - name: server + image: productcatalogservice + ports: + - containerPort: 3550 +--- +apiVersion: v1 +kind: Service +metadata: + name: productcatalogservice +spec: + type: ClusterIP + selector: + app: productcatalogservice + ports: + - port: 3550 + targetPort: 3550 diff --git a/kubernetes-manifests/recommendationservice.yaml b/kubernetes-manifests/recommendationservice.yaml new file mode 100644 index 0000000..807bf19 --- /dev/null +++ b/kubernetes-manifests/recommendationservice.yaml @@ -0,0 +1,30 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: recommendationservice +spec: + template: + metadata: + labels: + app: recommendationservice + spec: + containers: + - name: server + image: recommendationservice + ports: + - containerPort: 8080 + env: + - name: PRODUCT_CATALOG_SERVICE_ADDR + value: "productcatalogservice:3550" +--- +apiVersion: v1 +kind: Service +metadata: + name: recommendationservice +spec: + type: ClusterIP + selector: + app: recommendationservice + ports: + - port: 8080 + targetPort: 8080 diff --git a/kubernetes-manifests/shippingservice.yaml b/kubernetes-manifests/shippingservice.yaml new file mode 100644 index 0000000..c96ed95 --- /dev/null +++ b/kubernetes-manifests/shippingservice.yaml @@ -0,0 +1,27 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: shippingservice +spec: + template: + metadata: + labels: + app: shippingservice + spec: + containers: + - name: server + image: shippingservice + ports: + - containerPort: 50051 +--- +apiVersion: v1 +kind: Service +metadata: + name: shippingservice +spec: + type: ClusterIP + selector: + app: shippingservice + ports: + - port: 50051 + targetPort: 50051 diff --git a/skaffold.yaml b/skaffold.yaml new file mode 100644 index 0000000..6c8f024 --- /dev/null +++ b/skaffold.yaml @@ -0,0 +1,18 @@ +apiVersion: skaffold/v1alpha2 +kind: Config +build: + artifacts: + - imageName: emailservice + workspace: src/emailservice + - imageName: productcatalogservice + workspace: src/productcatalogservice + - imageName: recommendationservice + workspace: src/recommendationservice + - imageName: shippingservice + workspace: src/shippingservice + - imageName: checkoutservice + workspace: src/checkoutservice +deploy: + kubectl: + manifests: + - ./kubernetes-manifests/**.yaml