Skip to content

Commit 8f01198

Browse files
authored
Merge pull request #279 from mindwm/feat/mindwm-function-xrd
Feat/mindwm function xrd
2 parents 90a96d0 + f0af20c commit 8f01198

File tree

12 files changed

+588
-113
lines changed

12 files changed

+588
-113
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dns_search_domain:
4444

4545
.ONESHELL: docker_insecure_registry
4646
docker_insecure_registry:
47-
INSECURE_REGISTRY="zot-int.zot.svc.cluster.local:5000"
47+
INSECURE_REGISTRY="$(MINDWM_HOST_REGISTRY)"
4848
DOCKER_CONFIG="/etc/docker/daemon.json"
4949

5050
if [[ ! -f "$$DOCKER_CONFIG" ]]; then
@@ -244,7 +244,7 @@ service_dashboard:
244244
export INGRESS_HOST=$$(kubectl -n "$$INGRESS_NS" get service "$$INGRESS_NAME" -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
245245
export INGRESS_PORT=$$(kubectl -n "$$INGRESS_NS" get service "$$INGRESS_NAME" -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
246246
cat<<EOF
247-
echo $$INGRESS_HOST argocd.$(DOMAIN) grafana.$(DOMAIN) vm.$(DOMAIN) nats.$(DOMAIN) neo4j.$(CONTEXT_NAME).$(DOMAIN) tempo.$(DOMAIN) | sudo tee -a /etc/hosts
247+
echo $$INGRESS_HOST argocd.$(DOMAIN) grafana.$(DOMAIN) vm.$(DOMAIN) nats.$(DOMAIN) neo4j.$(CONTEXT_NAME).$(DOMAIN) tempo.$(DOMAIN) $(MINDWM_HOST_REGISTRY) | sudo tee -a /etc/hosts
248248
http://argocd.$(DOMAIN):$$INGRESS_PORT
249249
http://grafana.$(DOMAIN):$$INGRESS_PORT
250250
http://loki.$(DOMAIN):$$INGRESS_PORT
@@ -260,7 +260,7 @@ edit_hosts:
260260
export INGRESS_NS=istio-system
261261
export INGRESS_HOST=$$(kubectl -n "$$INGRESS_NS" get service "$$INGRESS_NAME" -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
262262
sudo sed -i -e '/$(DOMAIN)/d' /etc/hosts
263-
echo $$INGRESS_HOST argocd.$(DOMAIN) grafana.$(DOMAIN) vm.$(DOMAIN) nats.$(DOMAIN) neo4j.$(CONTEXT_NAME).$(DOMAIN) tempo.$(DOMAIN) loki.$(DOMAIN) neo4j.cyan.$(DOMAIN) | sudo tee -a /etc/hosts
263+
echo $$INGRESS_HOST argocd.$(DOMAIN) grafana.$(DOMAIN) vm.$(DOMAIN) nats.$(DOMAIN) neo4j.$(CONTEXT_NAME).$(DOMAIN) tempo.$(DOMAIN) loki.$(DOMAIN) neo4j.cyan.$(DOMAIN) $(MINDWM_HOST_REGISTRY) | sudo tee -a /etc/hosts
264264

265265
.PHONY: mindwm_test
266266
mindwm_test:

config_schema.k

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ userPrefix = "user"
55
contextPrefix = "context"
66
hostPrefix = "host"
77

8+
minwdm_host_registry = "zot-int.zot.svc.cluster.local:5000"
9+
810
schema ResourceNameStr:
911
data: str
1012
check:
@@ -24,11 +26,11 @@ crossplaneResourceName = lambda entity: any, resourceName : ResourceNameStr -> s
2426

2527
crossplane_user2context_trigger_name = lambda user : MindwmUser, ctx: MindwmContext -> str {
2628
"user-" + getData(user.name) + "-to-context-" + getData(ctx.name)
27-
}
29+
}
2830

2931
crossplane_context2user_trigger_name = lambda user : MindwmUser, ctx: MindwmContext -> str {
3032
"context-" + getData(ctx.name) + "-to-user-" + getData(user.name)
31-
}
33+
}
3234

3335
domain: DomainStr { data = "mindwm.local" }
3436

@@ -45,7 +47,7 @@ schema MindwmHost:
4547
# from user_broker to host broker trigger
4648
trigger_back: Trigger {
4749
name.data = "user-broker-to-" + getData(name) + "-broker-trigger"
48-
}
50+
}
4951

5052
schema MindwmUser:
5153
name: ResourceNameStr
@@ -55,30 +57,30 @@ schema MindwmUser:
5557
schema MindwmContext:
5658
name: ResourceNameStr
5759
namespace: ResourceNameStr = { data = "${contextPrefix}-${getData(name)}" }
58-
broker: Broker {
60+
broker: Broker {
5961
name.data = "context-broker"
6062
virtual_service = {
6163
name.data = "broker-virtual-service"
62-
}
63-
}
64+
}
65+
}
6466
kafka: Kafka {}
6567
neo4j: Neo4j {}
6668
vector: Vector {}
67-
cdc_topic: KafkaTopic {
69+
cdc_topic: KafkaTopic {
6870
name.data = "context-" + getData(name) + "-cdc"
69-
}
70-
gateway: IstioGateway {
71-
name.data = "gateway"
71+
}
72+
gateway: IstioGateway {
73+
name.data = "gateway"
7274
hosts = [
7375
"neo4j." + getData(name) + "." + getData(domain)
74-
]
75-
}
76+
]
77+
}
7678
neo4j_virtual_service: IstioVirtualService {
7779
name.data = "neo4j-virtual-service"
78-
}
80+
}
7981
node_red_virtual_service: IstioVirtualService {
8082
name.data = "node-red-virtual-service"
81-
}
83+
}
8284
kafkaSource: KafkaSource = {
8385
name.data = getData(cdc_topic.name) + "-kafkasource"
8486
topicName = cdc_topic.name
@@ -111,7 +113,7 @@ schema Broker:
111113
{ data = "${getData(brokerName)}-config" }
112114
})(name)
113115
deadLetter: DeadLetter { name.data = "dead-letter" }
114-
virtual_service?: IstioVirtualService
116+
virtual_service?: IstioVirtualService
115117

116118
schema DeadLetter:
117119
name: ResourceNameStr
@@ -152,13 +154,13 @@ schema Crossplane:
152154
domain: DomainStr { data = "mindwm.io" }
153155

154156
schema IstioGateway:
155-
name: ResourceNameStr
157+
name: ResourceNameStr
156158
hosts: [str]
157159

158160
schema IstioVirtualService:
159161
name: ResourceNameStr
160162

161163
schema KnativeFunction:
162-
name: ResourceNameStr
164+
name: ResourceNameStr
163165
image: str
164166
#ctx = MindwmContext { name.data = "pink" }

main.k

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ mindwm_app = ArgoCdOrder.make({
407407
"argocd.argoproj.io/sync-options" = "SkipDryRunOnMissingResource=true"
408408
}
409409
})
410-
for resource in XrdKclFunction.makeContextXR() + XrdKclFunction.makeUserXR() + XrdKclFunction.makeHostXR()
410+
for resource in XrdKclFunction.makeContextXR() + XrdKclFunction.makeUserXR() + XrdKclFunction.makeHostXR() + XrdKclFunction.makeFunctionXR()
411411
]
412412
[
413413
k8core.Service {

manifests/tekton-pipelines.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24513,7 +24513,7 @@ data:
2451324513
#
2451424514
# See more in the Affinity Assistant documentation
2451524515
# https://github.com/tektoncd/pipeline/blob/main/docs/affinityassistants.md
24516-
coschedule: "workspaces"
24516+
coschedule: "disabled"
2451724517
# Setting this flag to "true" will prevent Tekton scanning attached
2451824518
# service accounts and injecting any credentials it finds into your
2451924519
# Steps.

0 commit comments

Comments
 (0)