| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF 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. |
| # |
| |
| |
| apiVersion: v1 |
| kind: ConfigMap |
| metadata: |
| name: broker-config |
| data: |
| # Tune for available memory. Increase the heap up to 24G to have |
| # better GC behavior at high throughput |
| PULSAR_MEM: "\" -Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g\"" |
| zookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper |
| globalZookeeperServers: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper |
| clusterName: us-central |
| --- |
| ## |
| ## Broker deployment definition |
| ## |
| apiVersion: apps/v1beta1 |
| kind: Deployment |
| metadata: |
| name: broker |
| spec: |
| replicas: 3 |
| template: |
| metadata: |
| labels: |
| app: pulsar |
| component: broker |
| annotations: |
| prometheus.io/scrape: "true" |
| prometheus.io/port: "8080" |
| spec: |
| containers: |
| - name: broker |
| image: apachepulsar/pulsar:latest |
| command: ["sh", "-c"] |
| args: |
| - > |
| bin/apply-config-from-env.py conf/broker.conf && |
| bin/apply-config-from-env.py conf/pulsar_env.sh && |
| bin/pulsar broker |
| ports: |
| - containerPort: 8080 |
| # hostPort: 8080 |
| - containerPort: 6650 |
| # hostPort: 6650 |
| envFrom: |
| - configMapRef: |
| name: broker-config |
| env: |
| - name: advertisedAddress |
| valueFrom: |
| fieldRef: |
| fieldPath: status.podIP |
| --- |
| |
| ## |
| ## Define the Bookie headless service |
| ## In practice, in this case, it is only useful to have a view of |
| ## all the broker pods that are present |
| ## |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: broker |
| labels: |
| app: pulsar |
| component: broker |
| spec: |
| ports: |
| - port: 8080 |
| name: http |
| - port: 6650 |
| name: pulsar |
| clusterIP: None |
| selector: |
| app: pulsar |
| component: broker |
| |
| --- |
| |
| ### |
| |
| apiVersion: v1 |
| kind: Pod |
| metadata: |
| name: pulsar-admin |
| spec: |
| containers: |
| - name: pulsar-admin |
| image: apachepulsar/pulsar:latest |
| command: ["sh", "-c"] |
| args: |
| - > |
| bin/apply-config-from-env.py conf/client.conf && |
| sleep 10000000000 |
| envFrom: |
| - configMapRef: |
| name: broker-config |
| env: |
| - name: webServiceUrl |
| value: http://broker:8080/ |
| - name: brokerServiceUrl |
| value: pulsar://broker:6650/ |