Skip to content

Commit

Permalink
Use filesystem catalog instead of inline for async/openapi+grpc examp…
Browse files Browse the repository at this point in the history
…les (#123)
  • Loading branch information
bmaidics authored Apr 25, 2024
1 parent aee1671 commit e08c14e
Show file tree
Hide file tree
Showing 22 changed files with 541 additions and 500 deletions.
2 changes: 2 additions & 0 deletions grpc.echo/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extraEnv:
- name: KEYSTORE_PASSWORD
value: generated
- name: ZILLA_INCUBATOR_ENABLED
value: "true"

livenessProbePort: 7153
readinessProbePort: 7153
Expand Down
17 changes: 14 additions & 3 deletions grpc.echo/zilla.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: example
catalogs:
host_filesystem:
type: filesystem
options:
subjects:
echo:
path: proto/echo.proto
vaults:
my_servers:
type: filesystem
Expand Down Expand Up @@ -47,13 +54,17 @@ bindings:
north_grpc_server:
type: grpc
kind: server
options:
services:
- proto/echo.proto
catalog:
host_filesystem:
- subject: echo
routes:
- when:
- method: example.EchoService/*
exit: north_echo_server
north_echo_server:
type: echo
kind: server
telemetry:
exporters:
stdout_exporter:
type: stdout
2 changes: 2 additions & 0 deletions grpc.kafka.echo/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extraEnv:
- name: KEYSTORE_PASSWORD
value: generated
- name: ZILLA_INCUBATOR_ENABLED
value: "true"

livenessProbePort: 7153
readinessProbePort: 7153
Expand Down
17 changes: 14 additions & 3 deletions grpc.kafka.echo/zilla.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: example
catalogs:
host_filesystem:
type: filesystem
options:
subjects:
echo:
path: proto/echo.proto
vaults:
my_servers:
type: filesystem
Expand Down Expand Up @@ -47,9 +54,9 @@ bindings:
north_grpc_server:
type: grpc
kind: server
options:
services:
- proto/echo.proto
catalog:
host_filesystem:
- subject: echo
routes:
- when:
- method: example.EchoService/*
Expand Down Expand Up @@ -90,3 +97,7 @@ bindings:
routes:
- when:
- cidr: 0.0.0.0/0
telemetry:
exporters:
stdout_exporter:
type: stdout
2 changes: 2 additions & 0 deletions grpc.kafka.fanout/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extraEnv:
- name: KEYSTORE_PASSWORD
value: generated
- name: ZILLA_INCUBATOR_ENABLED
value: "true"

livenessProbePort: 7153
readinessProbePort: 7153
Expand Down
17 changes: 14 additions & 3 deletions grpc.kafka.fanout/zilla.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: example
catalogs:
host_filesystem:
type: filesystem
options:
subjects:
fanout:
path: proto/fanout.proto
vaults:
my_servers:
type: filesystem
Expand Down Expand Up @@ -44,9 +51,9 @@ bindings:
north_grpc_server:
type: grpc
kind: server
options:
services:
- proto/fanout.proto
catalog:
host_filesystem:
- subject: fanout
routes:
- when:
- method: example.FanoutService/*
Expand Down Expand Up @@ -82,3 +89,7 @@ bindings:
routes:
- when:
- cidr: 0.0.0.0/0
telemetry:
exporters:
stdout_exporter:
type: stdout
2 changes: 2 additions & 0 deletions grpc.kafka.proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extraEnv:
- name: KEYSTORE_PASSWORD
value: generated
- name: ZILLA_INCUBATOR_ENABLED
value: "true"

livenessProbePort: 7153
readinessProbePort: 7153
Expand Down
17 changes: 14 additions & 3 deletions grpc.kafka.proxy/zilla.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
name: example
catalogs:
host_filesystem:
type: filesystem
options:
subjects:
echo:
path: proto/echo.proto
vaults:
my_servers:
type: filesystem
Expand Down Expand Up @@ -45,9 +52,9 @@ bindings:
north_grpc_server:
type: grpc
kind: server
options:
services:
- proto/echo.proto
catalog:
host_filesystem:
- subject: echo
routes:
- when:
- method: example.EchoService/*
Expand Down Expand Up @@ -120,3 +127,7 @@ bindings:
options:
host: grpc-echo
port: 8080
telemetry:
exporters:
stdout_exporter:
type: stdout
2 changes: 2 additions & 0 deletions grpc.proxy/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
extraEnv:
- name: KEYSTORE_PASSWORD
value: generated
- name: ZILLA_INCUBATOR_ENABLED
value: "true"

livenessProbePort: 7153
readinessProbePort: 7153
Expand Down
17 changes: 14 additions & 3 deletions grpc.proxy/zilla.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
name: example
catalogs:
host_filesystem:
type: filesystem
options:
subjects:
echo:
path: proto/echo.proto
vaults:
my_servers:
type: filesystem
Expand Down Expand Up @@ -45,9 +52,9 @@ bindings:
north_grpc_server:
type: grpc
kind: server
options:
services:
- proto/echo.proto
catalog:
host_filesystem:
- subject: echo
routes:
- when:
- method: example.EchoService/*
Expand All @@ -69,3 +76,7 @@ bindings:
options:
host: grpc-echo
port: 8080
telemetry:
exporters:
stdout_exporter:
type: stdout
2 changes: 2 additions & 0 deletions mqtt.kafka.asyncapi.proxy/docker/compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
ZILLA_INCUBATOR_ENABLED: "true"
volumes:
- ../../zilla.yaml:/etc/zilla/zilla.yaml
- ../../specs/mqtt-asyncapi.yaml:/etc/zilla/specs/mqtt-asyncapi.yaml
- ../../specs/kafka-asyncapi.yaml:/etc/zilla/specs/kafka-asyncapi.yaml
command: start -v -e

networks:
Expand Down
4 changes: 3 additions & 1 deletion mqtt.kafka.asyncapi.proxy/k8s/helm/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ echo "Installing $ZILLA_CHART to $NAMESPACE with Kafka at $KAFKA_HOST:$KAFKA_POR
helm upgrade --install zilla $ZILLA_CHART --namespace $NAMESPACE --create-namespace --wait \
--values values.yaml \
--set extraEnv[1].value="\"$KAFKA_HOST\"",extraEnv[2].value="\"$KAFKA_PORT\"" \
--set-file zilla\\.yaml=../../zilla.yaml
--set-file zilla\\.yaml=../../zilla.yaml \
--set-file configMaps.specs.data.mqtt-asyncapi\\.yaml=../../specs/mqtt-asyncapi.yaml \
--set-file configMaps.specs.data.kafka-asyncapi\\.yaml=../../specs/kafka-asyncapi.yaml

# Create the mqtt topics in Kafka
kubectl run kafka-init-pod --image=bitnami/kafka:3.2 --namespace $NAMESPACE --rm --restart=Never -i -t -- /bin/sh -c "
Expand Down
66 changes: 66 additions & 0 deletions mqtt.kafka.asyncapi.proxy/specs/kafka-asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#
# Copyright 2021-2023 Aklivity Inc.
#
# Aklivity licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#

asyncapi: 3.0.0
info:
title: Zilla Kafka Proxy
version: 1.0.0
license:
name: Aklivity Community License
servers:
plain:
host: host.docker.internal:9092
protocol: kafka

operations:
onStreetlightData:
action: receive
channel:
$ref: '#/channels/streetlightData'
toStreetlightData:
action: send
channel:
$ref: '#/channels/streetlightData'

channels:
streetlightData:
description: This channel contains a message for streetlights.
address: streetlights
messages:
streetlightData:
$ref: '#/components/messages/streetlightData'
mqttSessions:
description: This channel contains MQTT sessions.
address: mqtt-sessions
mqttMessages:
description: This channel contains MQTT messages.
address: mqtt-messages
mqttRetained:
description: This channel contains MQTT retained messages.
address: mqtt-retained

components:
messages:
streetlightData:
payload:
type: object
properties:
streetlightId:
type: integer
description: This property describes the id of the streetlight
message:
type: string
description: This property describes message of the streetlight
Loading

0 comments on commit e08c14e

Please sign in to comment.