2023-02-02 12:01:07 +00:00
|
|
|
---
|
2023-02-02 10:12:49 +00:00
|
|
|
apiVersion: apps/v1
|
2023-02-02 12:01:07 +00:00
|
|
|
kind: Deployment # Kubernetes resource kind we are creating
|
2023-02-02 10:12:49 +00:00
|
|
|
metadata:
|
2023-02-02 12:01:07 +00:00
|
|
|
name: cicd-java-spring-boot-deployment
|
|
|
|
namespace: prototype-loafle-net
|
2023-02-02 10:12:49 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2023-02-02 12:01:07 +00:00
|
|
|
app: cicd-java-spring-boot-app
|
|
|
|
replicas: 1 # Number of replicas that will be created for this deployment
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: cicd-java-spring-boot-app
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: cicd-java-spring-boot-app
|
|
|
|
image: __REGISTRY_URL__/__IMAGE_NAME__:__IMAGE_TAG__ # Image that will be used to containers in the cluster
|
|
|
|
imagePullPolicy: Always
|
|
|
|
ports:
|
|
|
|
- containerPort: 8080
|
|
|
|
env:
|
|
|
|
- name: DEPLOY_DATE
|
|
|
|
value: '__DEPLOY_DATE__'
|
2023-02-02 10:12:49 +00:00
|
|
|
|
|
|
|
---
|
2023-02-02 12:01:07 +00:00
|
|
|
apiVersion: v1 # Kubernetes API version
|
|
|
|
kind: Service # Kubernetes resource kind we are creating
|
|
|
|
metadata: # Metadata of the resource kind we are creating
|
|
|
|
name: cicd-java-spring-boot-service
|
|
|
|
namespace: prototype-loafle-net
|
2023-02-02 10:12:49 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
2023-02-02 12:01:07 +00:00
|
|
|
app: cicd-java-spring-boot-app
|
2023-02-02 10:12:49 +00:00
|
|
|
ports:
|
2023-02-02 12:01:07 +00:00
|
|
|
- protocol: "TCP"
|
|
|
|
port: 8080 # The port that the service is running on in the cluster
|
|
|
|
targetPort: 8080 # The port exposed by the service
|
|
|
|
|