Skip to content

Commit

Permalink
feat(backend): WIP axonserver cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
BartlomiejRasztabiga committed Nov 6, 2023
1 parent 1b7f711 commit 681b059
Show file tree
Hide file tree
Showing 54 changed files with 780 additions and 71 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,5 @@ application-mailjet.properties
gmaps-api-key-secret.yaml
mailjet-api-key-secret.yaml
stripe-api-key-secret.yaml

axoniq.license
4 changes: 2 additions & 2 deletions delivery/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ val axonVersion = "4.9.0"
val kotestVersion = "5.8.0"

dependencies {
implementation("me.rasztabiga.thesis:shared:0.18.15")
implementation("me.rasztabiga.thesis:shared:0.19.0")

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-webflux")
Expand All @@ -54,7 +54,7 @@ dependencies {
implementation("com.google.maps:google-maps-services:2.2.0")
implementation("io.axoniq.console:console-framework-client-spring-boot-starter:1.1.0")

testImplementation(testFixtures("me.rasztabiga.thesis:shared:0.18.15"))
testImplementation(testFixtures("me.rasztabiga.thesis:shared:0.19.0"))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.axonframework:axon-test")
Expand Down
4 changes: 2 additions & 2 deletions e2e/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ val axonVersion = "4.9.0"
val kotestVersion = "5.8.0"

dependencies {
implementation("me.rasztabiga.thesis:shared:0.18.15")
implementation("me.rasztabiga.thesis:shared:0.19.0")

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-webflux")
Expand All @@ -54,7 +54,7 @@ dependencies {

testImplementation("io.rest-assured:rest-assured:5.3.2")
testImplementation("io.rest-assured:kotlin-extensions:5.3.2")
testImplementation(testFixtures("me.rasztabiga.thesis:shared:0.18.15"))
testImplementation(testFixtures("me.rasztabiga.thesis:shared:0.19.0"))
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.axonframework:axon-test")
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/delivery-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
secretKeyRef:
name: gmaps-api-key
key: key
image: ghcr.io/bartlomiejrasztabiga/thesis/delivery:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/delivery:0.19.0
name: delivery-service
ports:
- containerPort: 8104
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
value: "3gSK8og83MMTCUlNrzGNfnzpBNyLlpTS"
- name: AUTH_CLIENT_SECRET
value: "fxntskIoYgCCXgxT-DYzTZraK4OwX-mwAcv8C4kZdszLDedqdtuwgTK8xB840C2G"
image: ghcr.io/bartlomiejrasztabiga/thesis/frontend:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/frontend:0.19.0
name: frontend
ports:
- containerPort: 8080
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/order-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
value: axonserver
- name: AXONIQ_CONSOLE_CREDENTIALS
value: "68447ea9-1:4ac1289d784047ac88cc1e1ab39bdefc"
image: ghcr.io/bartlomiejrasztabiga/thesis/order:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/order:0.19.0
name: order-service
ports:
- containerPort: 8102
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/payment-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
secretKeyRef:
name: stripe-api-key
key: frontend-domain
image: ghcr.io/bartlomiejrasztabiga/thesis/payment:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/payment:0.19.0
name: payment-service
ports:
- containerPort: 8103
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/query-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
secretKeyRef:
name: gmaps-api-key
key: key
image: ghcr.io/bartlomiejrasztabiga/thesis/query:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/query:0.19.0
name: query-service
ports:
- containerPort: 8105
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/restaurant-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
secretKeyRef:
name: gmaps-api-key
key: key
image: ghcr.io/bartlomiejrasztabiga/thesis/restaurant:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/restaurant:0.19.0
name: restaurant-service
ports:
- containerPort: 8101
Expand Down
2 changes: 1 addition & 1 deletion k8s/main/saga-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
value: "68447ea9-1:4ac1289d784047ac88cc1e1ab39bdefc"
- name: SPRING_DATA_MONGODB_URI
value: "mongodb://root:password@saga-db:27017/saga?authSource=admin"
image: ghcr.io/bartlomiejrasztabiga/thesis/saga:0.18.15
image: ghcr.io/bartlomiejrasztabiga/thesis/saga:0.19.0
name: saga-service
ports:
- containerPort: 8106
Expand Down
10 changes: 10 additions & 0 deletions k8s/performance/axonserver-config-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: axonserver-config
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
10 changes: 10 additions & 0 deletions k8s/performance/axonserver-data-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: axonserver-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
10 changes: 10 additions & 0 deletions k8s/performance/axonserver-events-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: axonserver-events
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
6 changes: 6 additions & 0 deletions k8s/performance/axonserver-license-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Secret
metadata:
name: axonserver-license
data:
axoniq.license: I0F4b25JUSBMaWNlbnNlIEZpbGUgZ2VuZXJhdGVkIG9uIDIwMjMtMTEtMDYKI01vbiBOb3YgMDYgMDk6MDI6NDAgVVRDIDIwMjMKbGljZW5zZV9rZXlfaWQ9YzBmNzU4NTEtODg5MS00NDdjLThmMzAtNDFjYWM3ZGY1NzllCnNpZ25hdHVyZT1xbjM1d1hIRHZ1VHlydXZYNlJtSUwrYkI0V3VESlZDWXFGeEprQzR5NURyMk5ZVW52TkRueVJoTHV4UTRBV3lzSVZjSFI3Ulh6RXpFTjNwaU42TFdyUHdsN0ZmQ2pUNzVvcFBEd25tRlNPZHhtME1vUzB6UjU5K2xOSi9CMFVVT2o0eWlUK096K2gyVGtNdXVEc2RoN29VZTE4dXNkSURpcE5OR1VvZURDdUN3Yys2b3hQeFRIc1JyNW5KZko0UzFrNDN0d3gxclY0QThvTURYbktjQ2N2ZU4ycXVmUlhucDZuRU5JN3FucmdzbE1MeHlEUEZtTDRDTjExM0U4QnZxekw3cER5RTFuR1RTWHJWRERVbkgxTHNTTk5XQVZiWHBxTXBZaUlzMDRNVVJEdDdjTlBtellqeDRaU3hKV3JXYnAyWFphQWhNQ0dVMDVKNENRWUFiVWxjVytmWFhSdlMvcXp1Zk4zMklLa0xQQXA5SCtnTldOOE95SDVZT1FkVDZDVlVwQnh1RmNCWStZbDNIQ1l0ZEc3MnBHZG44TFpKeTZpSFp5VnRCblNzTnJBYW0yQ21kNDJua3JESXErWVZQN1JPQ3BQOXJrR01HdjA5NmJIdWQrb0pNRFpubnh2S3Zyb1YyRVI0dlBpbHB3bmFJcUxtSjVESi9EVUhvUlFkTXBWOHdQdDNFQW9yWHdHZUNLb3ArVnduWG5jci9XdVN6UnhCRWszV1JDeTNTeDFwSW1qUDc0MldrMnFxWmRkMGRDY3Q5YVJueDFjTWFaSUJYMkIyTGtDTkpvSUdSdVdSSXN0QitZcWMwMDNrR2dkdDkwWk1rZkFVc1BPa1ZXRUVPSEZEVEorc0pZdGhmU0QxMXIxMXhpYWFXMFZWVnRvUzg4Sy9KNlpXRlJISVw9CnJlZmVyZW5jZT1UcmlhbCBMaWNlbnNlIGZvciBBeG9uIFNlcnZlciBFbnRlcnByaXNlIEVkaXRpb24KY29udGV4dHM9MTAwCmV4cGlyeV9kYXRlPTIwMjMtMTItMDYKY29udGFjdD1jb250YWN0QHJhc3p0YWJpZ2EubWUKZWRpdGlvbj1FbnRlcnByaXNlCmlzc3VlX2RhdGU9MjAyMy0xMS0wNgpncmFjZV9kYXRlPTIwMjMtMTItMDYKcHJvZHVjdD1BeG9uU2VydmVyCmxpY2Vuc2VlPUJhcnRcdTAxNDJvbWllaiBSYXN6dGFiaWdhCmNsdXN0ZXJOb2Rlcz0zCg==
17 changes: 17 additions & 0 deletions k8s/performance/axonserver-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: axonserver
spec:
ports:
- name: "8024"
port: 8024
targetPort: 8024
- name: "8124"
port: 8124
targetPort: 8124
- name: "8224"
port: 8224
targetPort: 8224
selector:
app: axonserver
84 changes: 84 additions & 0 deletions k8s/performance/axonserver-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: axonserver
spec:
replicas: 2
selector:
matchLabels:
app: axonserver
serviceName: axonserver
template:
metadata:
labels:
app: axonserver
spec:
containers:
- image: axoniq/axonserver:2023.2.0-jdk-17-dev
name: axonserver
env:
- name: AXONIQ_AXONSERVER_DEVMODE_ENABLED
value: "true"
- name: AXONIQ_LICENSE
value: "/axonserver/license/axoniq.license"
ports:
- containerPort: 8024
- containerPort: 8124
- containerPort: 8224
volumeMounts:
- mountPath: /data
name: axonserver-data
- mountPath: /eventdata
name: axonserver-events
- mountPath: /config
name: axonserver-config
readOnly: true
- mountPath: /axonserver/license
name: axonserver-license
readOnly: true
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8024
initialDelaySeconds: 60
periodSeconds: 60
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8024
initialDelaySeconds: 60
periodSeconds: 60
resources:
requests:
memory: "500Mi"
cpu: "250m"
restartPolicy: Always
volumes:
- name: axonserver-data
persistentVolumeClaim:
claimName: axonserver-data
- name: axonserver-events
persistentVolumeClaim:
claimName: axonserver-events
- name: axonserver-config
persistentVolumeClaim:
claimName: axonserver-config
readOnly: true
- name: axonserver-license
secret:
secretName: axonserver-license
volumeClaimTemplates:
- metadata:
name: axonserver-events
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
- metadata:
name: axonserver-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
43 changes: 43 additions & 0 deletions k8s/performance/delivery-service-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: delivery-service
spec:
replicas: 2
selector:
matchLabels:
app: delivery-service
template:
metadata:
labels:
app: delivery-service
spec:
containers:
- env:
- name: AXON_AXONSERVER_SERVERS
value: axonserver
- name: AXONIQ_CONSOLE_CREDENTIALS
value: "68447ea9-1:4ac1289d784047ac88cc1e1ab39bdefc"
- name: SPRING_PROFILES_ACTIVE
value: nosecurity
image: ghcr.io/bartlomiejrasztabiga/thesis/delivery:0.19.0
name: delivery-service
ports:
- containerPort: 8104
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8104
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: 8104
initialDelaySeconds: 30
periodSeconds: 10
resources:
requests:
memory: "250Mi"
cpu: "125m"
restartPolicy: Always
11 changes: 11 additions & 0 deletions k8s/performance/delivery-service-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: delivery-service
spec:
ports:
- name: "8104"
port: 8104
targetPort: 8104
selector:
app: delivery-service
47 changes: 47 additions & 0 deletions k8s/performance/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 0
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- env:
- name: API_GATEWAY_URL
value: https://thesis.rasztabiga.me
- name: SESSION_SECRET
value: "0a471d50870e4085be3e64fdc627dc87"
- name: AUTH_CALLBACK_URL
value: "https://thesis.rasztabiga.me/auth/auth0/callback"
- name: AUTH_CLIENT_ID
value: "3gSK8og83MMTCUlNrzGNfnzpBNyLlpTS"
- name: AUTH_CLIENT_SECRET
value: "fxntskIoYgCCXgxT-DYzTZraK4OwX-mwAcv8C4kZdszLDedqdtuwgTK8xB840C2G"
image: ghcr.io/bartlomiejrasztabiga/thesis/frontend:0.19.0
name: frontend
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
resources:
requests:
memory: "250Mi"
cpu: "125m"
restartPolicy: Always
11 changes: 11 additions & 0 deletions k8s/performance/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: frontend
spec:
ports:
- name: "8080"
port: 8080
targetPort: 8080
selector:
app: frontend
Loading

0 comments on commit 681b059

Please sign in to comment.