From 87625824b1d2afbf852eb5e1981fcfe662778651 Mon Sep 17 00:00:00 2001 From: Bujji369 <119100444+Bujji369@users.noreply.github.com> Date: Thu, 29 Dec 2022 19:12:47 +0530 Subject: [PATCH] Update and rename deploymentservice.yaml to k8s-spring-boot-deployment.yaml --- deploymentservice.yaml | 36 --------------------------------- k8s-spring-boot-deployment.yaml | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 36 deletions(-) delete mode 100644 deploymentservice.yaml create mode 100644 k8s-spring-boot-deployment.yaml diff --git a/deploymentservice.yaml b/deploymentservice.yaml deleted file mode 100644 index b9dfd9d9..00000000 --- a/deploymentservice.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment # Kubernetes resource kind we are creating -metadata: - name: spring-boot-k8s-deployment -spec: - selector: - matchLabels: - app: spring-boot-k8s - replicas: 2 # Number of replicas that will be created for this deployment - template: - metadata: - labels: - app: spring-boot-k8s - spec: - containers: - - name: spring-boot-k8s - image: javatechie/devops-integration # Image that will be used to containers in the cluster - imagePullPolicy: IfNotPresent - ports: - - containerPort: 8080 # The port that the container is running on in the cluster - - ---- - -apiVersion: v1 # Kubernetes API version -kind: Service # Kubernetes resource kind we are creating -metadata: # Metadata of the resource kind we are creating - name: springboot-k8ssvc -spec: - selector: - app: spring-boot-k8s - ports: - - protocol: "TCP" - port: 8080 # The port that the service is running on in the cluster - targetPort: 8080 # The port exposed by the service - type: NodePort # type of the service. \ No newline at end of file diff --git a/k8s-spring-boot-deployment.yaml b/k8s-spring-boot-deployment.yaml new file mode 100644 index 00000000..9c25de78 --- /dev/null +++ b/k8s-spring-boot-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sriram-springboot +spec: + replicas: 2 + selector: + matchLabels: + app: sriram-springboot + template: + metadata: + labels: + app: sriram-springboot + spec: + containers: + - name: springboot + image: srirammani/sriram369:mani-ram + ports: + - containerPort: 8080 + env: + - name: PORT + value: "8080" +--- +apiVersion: v1 +kind: Service +metadata: + name: sriram-springboot +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 8080 + selector: + app: sriram-springboot