Hello everyone, I have created this docker-compose...
# general
j
Hello everyone, I have created this docker-compose file and I want to know if this is the proper configuration or what is wrong. I can't connect through the secure port 6651, I want to follow the best practices using TLS/mTLS and georeplication
Copy code
version: '3'
networks:
  pulsar:
    name: pulsar
volumes:
  data:

services:
  zookeeper:
    image: apachepulsar/pulsar-all:3.0.0
    container_name: zookeeper
    hostname: zookeeper
    restart: on-failure
    # command: bin/pulsar zookeeper
    command: >
      bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \
            bin/generate-zookeeper-config.sh conf/zookeeper.conf && \
            bin/pulsar zookeeper"
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 4096M
        reservations:
          cpus: '1'
          memory: 2048M
    networks:
      - pulsar
    ports:
      - "2181:2181"
    volumes:
      - /opt/pulsar/conf/:/conf
      - data:/pulsar/data
      - /opt/pulsar/server/certs/zookeeper/:/pulsar/certs/zookeeper/
    environment:
      - metadataStoreUrl=zk:zookeeper:2181
      - tlsProvider=OpenSSL
      - tlsEnabled=true
    healthcheck:
      test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"]
      interval: 60s
      timeout: 360s
      retries: 5
    
  pulsar-init:
    image: apachepulsar/pulsar-all:3.0.0
    container_name: pulsar-init
    hostname: pulsar-init
    command: bin/pulsar initialize-cluster-metadata \
               --cluster pulsar1 \
               --zookeeper zookeeper:2181 \
               --configuration-store zookeeper:2181 \
               --web-service-url <http://broker:8080> \
               --broker-service-url <pulsar://broker:6650>
               --web-service-url-tls <https://broker:8081> \
               --broker-service-url-tls <pulsar+ssl://broker:6651>
    deploy:
      resources:
        limits:
          cpus: '4'
          memory: 8192M
        reservations:
          cpus: '2'
          memory: 4096M
    ports:
      - "6651:6651"
      - "8081:8081"
    networks:
      - pulsar
    volumes:
      - /opt/pulsar/conf/:/conf
      - data:/pulsar/data
    depends_on:
      zookeeper:
        condition: service_healthy

  bookie:
    image: apachepulsar/pulsar-all:3.0.0
    container_name: bookie
    hostname: bookie
    restart: on-failure
    # command: bin/pulsar bookie
    command: >
      bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf && bin/pulsar bookie"
    deploy:
      resources:
        limits:
          cpus: '4'
          memory: 8192M
        reservations:
          cpus: '2'
          memory: 4096M
    networks:
      - pulsar
    ports:
      - "3181:3181"
    volumes:
      - /opt/pulsar/conf/:/conf
      - data:/pulsar/data
      - /opt/pulsar/server/certs/bookkeeper/:/pulsar/certs/bookkeeper/
      - /opt/pulsar/certs/:/pulsar/certs/bookkeeper/
    environment:
      - clusterName=pulsar1
      - zkServers=zookeeper:2181
      - metadataServiceUri=metadata-store:zk:zookeeper:2181
      - advertisedAddress=bookie
      - tlsProvider=OpenSSL
    depends_on:
      zookeeper:
        condition: service_healthy
      pulsar-init:
        condition: service_completed_successfully

  broker:
    image: apachepulsar/pulsar-all:3.0.0
    container_name: broker
    hostname: broker
    restart: on-failure
    # command: bin/pulsar broker
    command: bash -c "bin/apply-config-from-env.py conf/broker.conf && bin/pulsar broker"
    deploy:
      resources:
        limits:
          cpus: '8'
          memory: 8192M
        reservations:
          cpus: '4'
          memory: 4096M
    networks:
      - pulsar
    ports:
      - "6651:6651"
      - "8081:8081"
    volumes:
      - /opt/pulsar/conf/:/conf
      - data:/pulsar/data
      - /opt/pulsar/server/certs/broker/:/pulsar/certs/broker/
      - /opt/pulsar/server/certs/client/:/pulsar/certs/client/
      - /opt/pulsar/certs/:/pulsar/certs/
    environment:
      - superUserRoles=admin
      - allowedClusters=pulsar1
      - tlsProvider=OpenSSL
      - metadataStoreUrl=zk:zookeeper:2181
      - zookeeperServers=zookeeper:2181
      - clusterName=pulsar1
      - managedLedgerDefaultEnsembleSize=1
      - managedLedgerDefaultWriteQuorum=1
      - managedLedgerDefaultAckQuorum=1
      - advertisedAddress=broker
      - advertisedListeners=external:<pulsar+ssl://broker:6651>,internal:<pulsar://broker:6650>
    depends_on:
      zookeeper:
        condition: service_healthy
      bookie:
        condition: service_started