So i’m very new to the fly.io ecosystem even that I already know to to deploy my elixir/phoenix apps effectly. For now i’ll give a workshop on developing async web APIs with phoenix and a message queue and I chose redpanda as it is easy to set up locally and have less work that trying to build a zookeeper server.
However I don’t even know how to start from deploying the redpanda on fly.io… All examples I find is from a docker-compose.yml or manual setup on a VPS server, which isn’t the case for fly.io.
Here’s a docker-compose that I use to set up redpanda, and redpanda console:
version: '3.7'
services:
redpanda:
image: docker.redpanda.com/vectorized/redpanda:v23.1.2
command:
- redpanda start
- --smp 1
- --overprovisioned
- --node-id 0
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092
- --pandaproxy-addr 0.0.0.0:8082
- --advertise-pandaproxy-addr localhost:8082
ports:
- 8081:8081
- 8082:8082
- 9092:9092
- 9644:9644
- 29092:29092
console:
image: docker.redpanda.com/vectorized/console:latest
entrypoint: /bin/sh
command: -c "echo \"$$CONSOLE_CONFIG_FILE\" > /tmp/config.yml; /app/console"
environment:
CONFIG_FILEPATH: /tmp/config.yml
CONSOLE_CONFIG_FILE: |
kafka:
brokers: ["redpanda:29092"]
schemaRegistry:
enabled: true
urls: ["http://redpanda:8081"]
redpanda:
adminApi:
enabled: true
urls: ["http://redpanda:9644"]
connect:
enabled: true
clusters:
- name: local-connect-cluster
url: http://connect:8083
ports:
- 8080:8080
depends_on:
- redpanda
connect:
image: docker.cloudsmith.io/redpanda/connectors/connectors:624ff9e
hostname: connect
container_name: connect
depends_on:
- redpanda
ports:
- "8083:8083"
environment:
KAFKA_CONNECT_CONFIGURATION: |
offset.storage.topic=docker-connect-offsets
value.converter=org.apache.kafka.connect.json.JsonConverter
config.storage.topic=docker-connect-configs
key.converter=org.apache.kafka.connect.json.JsonConverter
group.id=compose-connect-group
status.storage.topic=docker-connect-status
config.storage.replication.factor=1
offset.storage.replication.factor=1
status.storage.replication.factor=1
KAFKA_CONNECT_METRICS_ENABLED: "false"
KAFKA_CONNECT_BOOTSTRAP_SERVERS: redpanda:29092
KAFKA_GC_LOG_ENABLED: "false"
KAFKA_HEAP_OPTS: -Xms128M
How can I generate a fly.toml
from this docker-compose? I would need to split it into 3 different applications? Also, How I could reach the redpanda brokers then on external application on fly.io? Also notice that docker-compose uses the development mode of redpanda, so it would need to start on production mode inside fly.io.
Sorry if it a begginners question, but I really don’t know how to start from.