Skip to content

Commit

Permalink
[Issue 6507][deployment]fix k8s config and env py (apache#6508)
Browse files Browse the repository at this point in the history
* fix k8s config and env py

* fix BOOKIE_MEN parmater for k8s
  • Loading branch information
liangyuanpeng authored Mar 19, 2020
1 parent 5ae525a commit 83efd44
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kind: ConfigMap
metadata:
name: bookie-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
BOOKIE_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
PULSAR_PREFIX_zkServers: zookeeper
Expand Down
8 changes: 6 additions & 2 deletions deployment/kubernetes/generic/original/bookie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kind: ConfigMap
metadata:
name: bookie-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
BOOKIE_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
PULSAR_PREFIX_dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
PULSAR_PREFIX_dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
PULSAR_PREFIX_zkServers: zookeeper
Expand All @@ -34,14 +34,18 @@ data:
## cannot be moved across different nodes.
## For this reason, we run BK as a daemon set, one for each node in the
## cluster, unless restricted by label selectors
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: bookie
labels:
app: pulsar
component: bookkeeper
spec:
selector:
matchLabels:
app: pulsar
component: bookkeeper
template:
metadata:
labels:
Expand Down
6 changes: 5 additions & 1 deletion deployment/kubernetes/generic/original/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ data:
##
## Broker deployment definition
##
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: broker
spec:
selector:
matchLabels:
app: pulsar
component: broker
replicas: 3
template:
metadata:
Expand Down
18 changes: 15 additions & 3 deletions deployment/kubernetes/generic/original/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,15 @@ data:
---

apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
selector:
matchLabels:
app: pulsar
component: prometheus
replicas: 1
template:
metadata:
Expand Down Expand Up @@ -157,11 +161,15 @@ spec:
---
## GRAFANA

apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
spec:
selector:
matchLabels:
app: pulsar
component: grafana
replicas: 1
template:
metadata:
Expand Down Expand Up @@ -201,11 +209,15 @@ spec:
---
## Include detailed Pulsar dashboard

apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: pulsar-dashboard
spec:
selector:
matchLabels:
app: pulsar
component: dashboard
replicas: 1
template:
metadata:
Expand Down
6 changes: 5 additions & 1 deletion deployment/kubernetes/generic/original/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ data:
##
## Proxy deployment definition
##
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: proxy
spec:
selector:
matchLabels:
app: pulsar
component: proxy
replicas: 2
template:
metadata:
Expand Down
6 changes: 5 additions & 1 deletion deployment/kubernetes/generic/original/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ spec:
---

## Define a StatefulSet for ZK servers
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: zk
labels:
app: pulsar
component: zookeeper
spec:
selector:
matchLabels:
app: pulsar
component: zookeeper
serviceName: zookeeper
replicas: 3
template:
Expand Down
2 changes: 2 additions & 0 deletions docker/pulsar/scripts/apply-config-from-env.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
# Update values from Env
for k in sorted(os.environ.keys()):
v = os.environ[k]
if k.startswith(PF_ENV_PREFIX):
k = k[len(PF_ENV_PREFIX):]
if k in keys:
print('[%s] Applying config %s = %s' % (conf_filename, k, v))
idx = keys[k]
Expand Down

0 comments on commit 83efd44

Please sign in to comment.