-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy layotto pod in k8s. #722
Comments
apiVersion: v1
kind: ConfigMap
metadata:
name: layotto-runtime-config
data:
config.json: |
{
"servers": [
{
"default_log_path": "stdout",
"default_log_level": "DEBUG",
"routers": [
{
"router_config_name": "actuator_dont_need_router"
}
],
"listeners": [
{
"name": "grpc",
"address": "0.0.0.0:34904",
"bind_port": true,
"filter_chains": [
{
"filters": [
{
"type": "grpc",
"config": {
"server_name": "runtime",
"grpc_config": {
"hellos": {
"quick_start_demo": {
"type": "helloworld",
"hello": "greeting"
}
},
"state": {
"state_demo": {
"type": "in-memory",
"metadata": {
}
}
},
"lock": {
"lock_demo": {
"type": "in-memory",
"metadata": {
}
}
},
"pub_subs": {
"pub_subs_demo": {
"type": "in-memory",
"metadata": {
"consumerID": "1"
}
}
},
"sequencer": {
"sequencer_demo": {
"type": "in-memory",
"metadata": {}
}
},
"secret_store": {
"secret_demo": {
"type": "local.env",
"metadata": {
}
}
},
"bindings": {
"bindings_demo": {
"type": "http",
"metadata": {
"url": "https://mosn.io/layotto"
}
}
},
"custom_component": {
"helloworld": {
"demo": {
"type": "in-memory",
"metadata": {}
}
}
},
"app": {
"app_id": "app1",
"grpc_callback_port": 9999
}
}
}
}
]
}
]
},
{
"name": "actuator",
"address": "127.0.0.1:34999",
"bind_port": true,
"filter_chains": [
{
"filters": [
{
"type": "proxy",
"config": {
"downstream_protocol": "Http1",
"upstream_protocol": "Http1",
"router_config_name": "actuator_dont_need_router"
}
}
]
}
],
"stream_filters": [
{
"type": "actuator_filter"
}
]
}
]
}
],
"tracing": {
"enable": true,
"driver": "SOFATracer",
"config": {
"generator": "mosntracing",
"exporter": [
"stdout"
]
}
},
"metrics": {
"sinks": [
{
"type": "prometheus",
"config": {
"port": 34903
}
}
]
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: layotto-runtime-deployment
labels:
app: layotto-runtime-deployment
spec:
selector:
matchLabels:
app: layotto-runtime
replicas: 1
template:
metadata:
labels:
app: layotto-runtime
spec:
containers:
- name: layotto-runtime
image: layotto/layotto:latest
command: ["/runtime/layotto", "start"]
args: ["-c", "/runtime/configs/config.json"]
ports:
- containerPort: 34904
volumeMounts:
- name: runtime-config
mountPath: /runtime/configs
readOnly: false
volumes:
- name: runtime-config
configMap:
name: layotto-runtime-config
items:
- key: config.json
path: config.json |
使用以上yaml我已经成功部署到k8s中。 configmap配置copy from:https://github.com/mosn/layotto/blob/main/configs/config.json |
我觉得可以拆成3个yaml,提交到仓库中:
这样用户可以直接部署到k8s中,类似:
如果想自行修改配置,也可以自己提供一个configmap,再使用上面的deployment.yaml |
lgtm. It makes local development much easier ! @Xunzhuo Could u help review this proposal? |
如何理解“独立节点模式”? |
因为上面的deployment中只有一个layotto的容器 所以使layotto不是作为sidecar部署 部署一个pod,pod中只有一个layotto容器,我称它为"独立节点模式" |
@kevinten10 OK. So the benefits of the "standalone mode" is still to make the local development easier, right? |
Yes, I will submit a PR~ |
@seeflood I plan to put the deployment yaml in this directory, please help to see if it is ok:
|
@kevinten10 LGTM |
What would you like to be added:
添加在k8s中快速部署一个layotto节点的方式。
就像k8s官方提供的示例,仅用一行kubectl即可完成部署:
https://kubernetes.io/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/
Why is this needed:
此部署并非layotto作为sidecar的部署方式,而是layotto作为一个单独pod的部署方式。
使用场景主要为:
The text was updated successfully, but these errors were encountered: