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