Skip to content

Commit

Permalink
Merge pull request #3 from ARUP-G/sonar-1
Browse files Browse the repository at this point in the history
 K8 deployment, service file and Docker file added
  • Loading branch information
ARUP-G authored May 3, 2024
2 parents 08a7414 + 11863db commit 7c51e89
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM adoptopenjdk/openjdk11

EXPOSE 8080

ENV APP_HOME /usr/src/app

COPY target/*.jar $APP_HOME/app.jar

WORKDIR $APP_HOME

CMD ["java", "-jar", "app.jar"]
36 changes: 36 additions & 0 deletions deployment-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment # Kubernetes resource kind we are creating
metadata:
name: boardgame-deployment
spec:
selector:
matchLabels:
app: boardgame
replicas: 2 # Number of replicas that will be created for this deployment
template:
metadata:
labels:
app: boardgame
spec:
containers:
- name: boardgame
image: adijaiswal/boardgame:latest # Image that will be used to containers in the cluster
imagePullPolicy: Always
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: boardgame-ssvc
spec:
selector:
app: boardgame
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: LoadBalancer # type of the service.

0 comments on commit 7c51e89

Please sign in to comment.