forked from ticket-monster-msa/monolith
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d274512
commit 0c570d1
Showing
20 changed files
with
699 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: mysql-orders | ||
spec: | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: ticketmonster | ||
component: orders | ||
spec: | ||
containers: | ||
- image: mysql:5.6 | ||
name: mysql | ||
env: | ||
# Use secret in real usage | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: admin | ||
- name: MYSQL_DATABASE | ||
value: orders | ||
- name: MYSQL_USER | ||
value: ticket | ||
- name: MYSQL_PASSWORD | ||
value: monster | ||
ports: | ||
- containerPort: 3306 | ||
name: mysql | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql-orders | ||
spec: | ||
ports: | ||
- port: 3306 | ||
selector: | ||
app: ticketmonster | ||
component: orders |
70 changes: 70 additions & 0 deletions
70
deployment/kubernetes/core/orders/orders-service-deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
fabric8.io/git-commit: d274512765d69ebdd100ca68c1180a7a2bc59753 | ||
fabric8.io/iconUrl: img/icons/spring-boot.svg | ||
fabric8.io/git-branch: migrate-workshop | ||
fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=orders-service&var-version=1.0.0-SNAPSHOT | ||
labels: | ||
app: orders-service | ||
provider: fabric8 | ||
version: 1.0.0-SNAPSHOT | ||
group: org.ticketmonster.orders | ||
name: orders-service | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: orders-service | ||
provider: fabric8 | ||
group: org.ticketmonster.orders | ||
template: | ||
metadata: | ||
annotations: | ||
fabric8.io/git-commit: d274512765d69ebdd100ca68c1180a7a2bc59753 | ||
fabric8.io/iconUrl: img/icons/spring-boot.svg | ||
fabric8.io/git-branch: migrate-workshop | ||
fabric8.io/metrics-path: dashboard/file/kubernetes-pods.json/?var-project=orders-service&var-version=1.0.0-SNAPSHOT | ||
labels: | ||
app: orders-service | ||
provider: fabric8 | ||
version: 1.0.0-SNAPSHOT | ||
group: org.ticketmonster.orders | ||
spec: | ||
containers: | ||
- env: | ||
- name: SPRING_PROFILES_ACTIVE | ||
value: kube | ||
- name: KUBERNETES_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
image: ceposta/orders-service:latest | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 180 | ||
name: spring-boot | ||
ports: | ||
- containerPort: 8080 | ||
name: http | ||
protocol: TCP | ||
- containerPort: 9779 | ||
name: prometheus | ||
protocol: TCP | ||
- containerPort: 8778 | ||
name: jolokia | ||
protocol: TCP | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
securityContext: | ||
privileged: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
fabric8.io/git-commit: d274512765d69ebdd100ca68c1180a7a2bc59753 | ||
fabric8.io/iconUrl: img/icons/spring-boot.svg | ||
fabric8.io/git-branch: migrate-workshop | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "9779" | ||
labels: | ||
expose: "true" | ||
app: orders-service | ||
provider: fabric8 | ||
version: 1.0.0-SNAPSHOT | ||
group: org.ticketmonster.orders | ||
name: orders-service | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: orders-service | ||
provider: fabric8 | ||
group: org.ticketmonster.orders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,16 @@ Or run with spring boot: | |
mvn -Pmysql spring-boot:run -Dspring.profiles.active=mysql | ||
``` | ||
|
||
To build and run with teiid: | ||
|
||
Or to build for kubernetes (and skip Integration tests) | ||
|
||
``` | ||
mvn -Pmysql,teiid spring-boot:run -Dspring.profiles.active=teiid | ||
mvn clean install -Pmysql,kubernetes | ||
``` | ||
|
||
|
||
A curl command you can use to test everything: | ||
|
||
``` | ||
curl -X POST -H "Content-Type: application/json" -d "{\"ticketRequests\":[{\"ticketPrice\":4,\"quantity\":3}],\"email\":\"[email protected]\",\"performance\":1}" http://localhost:8080/rest/bookings | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.