Skip to content

Commit

Permalink
working on microservices java
Browse files Browse the repository at this point in the history
  • Loading branch information
hagen-p committed Dec 12, 2023
1 parent 5741d27 commit 044ad8b
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 142 deletions.
117 changes: 117 additions & 0 deletions workshop/petclinic/first.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: config-server
app.kubernetes.io/part-of: spring-petclinic
name: spring-petclinic-config-server
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: config-server
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/spring-petclinic-default: "true"
io.kompose.service: config-server
app.kubernetes.io/part-of: spring-petclinic
spec:
containers:
- image: springcommunity/spring-petclinic-config-server
name: config-server
ports:
- containerPort: 8888
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: config-server
app.kubernetes.io/part-of: spring-petclinic
name: config-server
spec:
ports:
- name: "8888"
port: 8888
targetPort: 8888
selector:
io.kompose.service: config-server
status:
loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
name: spring-petclinic-discovery-server
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: discovery-server
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/spring-petclinic-default: "true"
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
spec:
containers:
- command:
- ./dockerize
- -wait=tcp://config-server:8888
- -timeout=60s
- --
- java
- org.springframework.boot.loader.JarLauncher
image: springcommunity/spring-petclinic-discovery-server
name: discovery-server
ports:
- containerPort: 8761
resources:
requests:
cpu: 500m
memory: 750Mi
limits:
#cpu: "1"
memory: 800Mi
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
name: discovery-server
spec:
ports:
- name: "8761"
port: 8761
targetPort: 8761
selector:
io.kompose.service: discovery-server
status:
loadBalancer: {}
---
198 changes: 56 additions & 142 deletions workshop/petclinic/spring-petclinic.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,3 @@

apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: admin-server
app.kubernetes.io/part-of: spring-petclinic
name: admin-server
spec:
ports:
- name: "9090"
port: 9090
targetPort: 9090
selector:
io.kompose.service: admin-server
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: api-gateway
app.kubernetes.io/part-of: spring-petclinic
name: api-gateway
spec:
ports:
- name: "8080"
port: 81
targetPort: 8080
selector:
io.kompose.service: api-gateway
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: config-server
app.kubernetes.io/part-of: spring-petclinic
name: config-server
spec:
ports:
- name: "8888"
port: 8888
targetPort: 8888
selector:
io.kompose.service: config-server
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
Expand All @@ -73,24 +19,6 @@ status:
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
name: discovery-server
spec:
ports:
- name: "8761"
port: 8761
targetPort: 8761
selector:
io.kompose.service: discovery-server
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
Expand Down Expand Up @@ -160,11 +88,33 @@ spec:
ports:
- containerPort: 9090
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
memory: "536870912"
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: admin-server
app.kubernetes.io/part-of: spring-petclinic
name: admin-server
spec:
ports:
- name: "9090"
port: 9090
targetPort: 9090
selector:
io.kompose.service: admin-server
status:
loadBalancer: {}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down Expand Up @@ -215,44 +165,34 @@ spec:
ports:
- containerPort: 8080
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
memory: "536870912"
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}
---
apiVersion: apps/v1
kind: Deployment
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: config-server
io.kompose.service: api-gateway
app.kubernetes.io/part-of: spring-petclinic
name: spring-petclinic-config-server
name: api-gateway
spec:
replicas: 1
ports:
- name: "8080"
port: 81
targetPort: 8080
selector:
matchLabels:
io.kompose.service: config-server
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/spring-petclinic-default: "true"
io.kompose.service: config-server
app.kubernetes.io/part-of: spring-petclinic
spec:
containers:
- image: springcommunity/spring-petclinic-config-server
name: config-server
ports:
- containerPort: 8888
resources:
limits:
memory: "536870912"
restartPolicy: Always
status: {}
io.kompose.service: api-gateway
status:
loadBalancer: {}
---

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -288,50 +228,16 @@ spec:
ports:
- containerPort: 8081
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
memory: "536870912"
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
name: spring-petclinic-discovery-server
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: discovery-server
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/spring-petclinic-default: "true"
io.kompose.service: discovery-server
app.kubernetes.io/part-of: spring-petclinic
spec:
containers:
- command:
- ./dockerize
- -wait=tcp://config-server:8888
- -timeout=60s
- --
- java
- org.springframework.boot.loader.JarLauncher
image: springcommunity/spring-petclinic-discovery-server
name: discovery-server
ports:
- containerPort: 8761
resources:
limits:
memory: "536870912"
restartPolicy: Always
status: {}

---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -368,8 +274,12 @@ spec:
ports:
- containerPort: 8083
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
memory: "536870912"
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}
---
Expand Down Expand Up @@ -408,7 +318,11 @@ spec:
ports:
- containerPort: 8082
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
memory: "536870912"
# cpu: "1"
memory: 512Mi
restartPolicy: Always
status: {}

0 comments on commit 044ad8b

Please sign in to comment.