Skip to content

Commit

Permalink
Dispatch verification rules to tratteria agents on trats resource cre…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
kchiranjewee63 committed Jun 26, 2024
1 parent 601c151 commit ae7c541
Show file tree
Hide file tree
Showing 25 changed files with 461 additions and 725 deletions.
1 change: 0 additions & 1 deletion kubernetes/crd/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
kubectl create namespace test-application

kubectl apply -f trat-crd.yaml
kubectl apply -f example-trat.yaml
10 changes: 4 additions & 6 deletions kubernetes/crd/example-trat.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apiVersion: tratteria.io/v1alpha1
kind: TraT
metadata:
name: trade
name: order-trade-trat
namespace: test-application
spec:
endpoint: "order/trade/{#stock-id}?action={#action}"
method: "POST"
azd-mapping:
purp: trade
azdMapping:
quantity:
required: true
value: "${body.quantity}"
Expand All @@ -17,7 +18,4 @@ spec:
required: true
value: "${stock-id}"
services:
- order
- catalog
- stocks
- payment
- name: order
38 changes: 35 additions & 3 deletions kubernetes/crd/trat-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,50 @@ spec:
type: string
method:
type: string
azd-mapping:
purp:
type: string
azdMapping:
type: object
x-kubernetes-preserve-unknown-fields: true
services:
type: array
items:
type: string
type: object
properties:
name:
type: string
endpoint:
type: string
azdMapping:
type: object
x-kubernetes-preserve-unknown-fields: true
required: ["endpoint", "method", "services"]
status:
type: object
properties:
applied:
status:
type: string
default: "PENDING"
verificationApplied:
type: boolean
generationApplied:
type: boolean
lastErrorMessage:
type: string
nullable: true
retries:
type: integer
default: 0
additionalPrinterColumns:
- name: "Status"
type: "string"
jsonPath: ".status.status"
- name: "Age"
type: "date"
jsonPath: ".metadata.creationTimestamp"
description: "Time since creation"
- name: "Retries"
type: "integer"
jsonPath: ".status.retries"
subresources:
status: {}
5 changes: 0 additions & 5 deletions kubernetes/tconfigd/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ kubectl create namespace tratteria

kubectl create configmap config --from-file=config.yaml=config.yaml -n tratteria

cd ../../rules
chmod +x deploy-rules.sh
./deploy-rules.sh example-rules
cd ../kubernetes/tconfigd

kubectl apply -f service-account.yaml
kubectl apply -f role.yaml
kubectl apply -f rolebinding.yaml
Expand Down
9 changes: 0 additions & 9 deletions kubernetes/tconfigd/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ spec:
- containerPort: 443
protocol: TCP
volumeMounts:
- name: trats-rules-volume
mountPath: "/etc/tconfigd/rules"
readOnly: true
- name: tconfigd-config-volume
mountPath: "/etc/tconfigd/config"
readOnly: true
Expand All @@ -43,12 +40,6 @@ spec:
readOnly: true
restartPolicy: Always
volumes:
- name: trats-rules-volume
configMap:
name: trats-rules-config
items:
- key: "trats-rules.ndjson"
path: "trats-rules.ndjson"
- name: tconfigd-config-volume
configMap:
name: config
Expand Down
27 changes: 0 additions & 27 deletions rules/deploy-rules.sh

This file was deleted.

43 changes: 0 additions & 43 deletions rules/example-rules/order/verification-rules.ndjson

This file was deleted.

73 changes: 0 additions & 73 deletions rules/example-rules/stocks/verification-rules.ndjson

This file was deleted.

115 changes: 0 additions & 115 deletions rules/example-rules/trats.ndjson

This file was deleted.

Loading

0 comments on commit ae7c541

Please sign in to comment.