这是 presto 的工作 Helm 图表(即 k8s 资源的模板包):https ://github.com/helm/charts/tree/master/stable/presto 。
这是上图 k8s 中 presto 集群的基本设计:
- 单协调员。可通过 http://:8080 发现(由工作人员) - 这是您需要为协调器公开的 k8s 服务,以便所有工作人员都可以针对该协调器执行发现(实际上它是由协调器公开的发现服务)。
- 通过 k8s 部署的一些无状态工作者。您不需要公开任何端口或 k8s 服务,因为根本没有外部进程可以访问工作进程。
- 使用 k8s configMap 注入自定义的 presto 配置。presto 集群最重要的配置
discovery-server.enabled=true
在<presto-home>/etc/config.properties
您的 presto 协调器中,或者您的协调器根本无法发现。(又名,不能通过网络拥有外部工作进程)。
根据这个问题,您需要确保工作进程可以通过 DNS 名称访问 presto 协调器,例如http://my-presto-coordinator:8080
.
这是我stable/presto
通过运行从图表中得到的helm template .
(在标准输出中渲染所有模板)。您需要RELEASE-NAME
用小写字符串替换才能使用它:
---
# Source: charts/presto/templates/deployment-worker.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: RELEASE-NAME-presto-worker
labels:
app: presto
chart: presto-0.1
release: RELEASE-NAME
heritage: Tiller
component: worker
spec:
replicas: 2
selector:
matchLabels:
app: presto
release: RELEASE-NAME
component: worker
template:
metadata:
labels:
app: presto
release: RELEASE-NAME
component: worker
spec:
volumes:
- name: config-volume
configMap:
name: RELEASE-NAME-presto-worker
containers:
- name: presto-worker
image: "bivas/presto:0.196"
imagePullPolicy: IfNotPresent
command: ["/bin/bash"]
args:
- /etc/presto/docker-presto.sh
volumeMounts:
- mountPath: /etc/presto
name: config-volume
livenessProbe:
exec:
command:
- /bin/bash
- /etc/presto/health_check.sh
initialDelaySeconds: 10
periodSeconds: 25
readinessProbe:
exec:
command:
- /bin/bash
- /etc/presto/health_check.sh
initialDelaySeconds: 5
periodSeconds: 10
resources:
{}