From b77e8d95df91f1fa718a2ec05b4ad8122db5226f Mon Sep 17 00:00:00 2001 From: Himanshu Kumar <97390553+agarwalhimanshugaya@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:44:03 +0000 Subject: [PATCH] add kubernetes file --- deployment-app.yml | 22 ++++++++++++++++++++++ service-app.yml | 14 ++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 deployment-app.yml create mode 100644 service-app.yml diff --git a/deployment-app.yml b/deployment-app.yml new file mode 100644 index 000000000..c435acaa3 --- /dev/null +++ b/deployment-app.yml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + # Unique key of the Deployment instance + name: my-node-app +spec: + # 2 Pods should exist at all times. + replicas: 2 + selector: + matchLabels: + app: node-app + template: + metadata: + labels: + # Apply this label to pods and default + # the Deployment label selector to this value + app: node-app + spec: + containers: + - name: node-app + # Run this image + image: #put your image name which you push in dockerhub diff --git a/service-app.yml b/service-app.yml new file mode 100644 index 000000000..85ab09058 --- /dev/null +++ b/service-app.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: service-my-node-app +spec: + ports: + - name: http + port: 8080 + targetPort: 3000 + selector: + # Loadbalance traffic across Pods matching + # this label selector + app: node-app + type: LoadBalancer