-
Notifications
You must be signed in to change notification settings - Fork 171
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
Support Pod Injection to deploy Layotto as a sidecar in Kubernetes. #910
Comments
Hi @Xunzhuo, |
/kind ospp |
/milestone v0.6.0 |
/assign Assign myself too, to keep an eye on it. |
@zhenjunMa 我们可以把这个课题加到开源之夏里面去 #894 |
hi layotto member Maybe we need an new issue for this discussion an new project like layotto-cloud-native for this. |
@JasonChen86899 Thanks! |
Thanks @JasonChen86899, welcome to comment your ideas and proposals. |
@Xunzhuo Hi, I am interested in this issue and would like to have it as my OSPP 2023 program. Can you suggest where I should start? |
@y-ykcir Can you send an application from OSPP website? |
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
cc @xiaoxiang10086, you can use this issue to track the status of the task. |
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
@Xunzhuo Hi, if the solution design has already been completed, please share it first so that we can also refer to it. |
|
This project mainly implements two modules:
I will introduce the current specific design ideas of the two modules in turn. Command line tool(1) layoctl kube-inject use case layoctl kube-inject -f kube-resources.yaml \
--injectConfigFile inj-template.tmpl \
--layottoConfigFile layotto.json \
--valuesFile values.json \
--output kube-resources-injected.yaml The
(2) Implementation ideas of command line tools
(3) Command line file
templates:
sidecar: |-
spec:
containers:
- name: layoutto-proxy
image: docker.io/layotto/layotto:{{.Values.global.tag}}
global:
tag: latest
Take the example configuration file: https://github.com/mosn/layotto/blob/HEAD/configs/config.json (4) Questions According to Layotto Configuration File Introduction, Layotto starts Need to read a configuration file in json format. This configuration file should already be included in the image file, so is it necessary to provide the configuration parameter Official image of Layotto found: https://hub.docker.com/r/layotto/layotto/tags MutatingWebhook Component(1) Background summary Mutation Webhook is a kind of Webhook in Kubernetes, which is used to intercept and modify the mutation operation of Kubernetes objects. When the Kubernetes API Server receives a user request for an object, Mutation Webhook can intercept the request and modify the request, and then send the modified request to the Kubernetes API Server, thereby realizing dynamic modification of the Kubernetes object. (2) Injection conditions The Mutating Webhook component should only inject the Layotto Sidecar on pods that are in a namespace with the label (3) Implementation ideas
|
@xiaoxiang10086 Great job! Hope this can land successfully : ) Ping me or @zhenjunMa if you have some questions. Draft PRs are welcomed. |
Hi @xiaoxiang10086 @Xunzhuo a good design for injection but I have a question. In Mosn doc, it is supported by istio, maybe we can also use the same way. The job in this design do the same thing like istio inject function such as istioctl and k8s webhooks. |
@JasonChen86899 Very useful information,Mosn and Layotto is one container. |
@xiaoxiang10086 |
Daprdapr当前支持两种配置文件注入: LayottoLayotto当前并不支持动态注入的能力,最终的形态肯定是上述的形态,Layotto适配Dapr的Operator,然后可以做组建的动态加载: 但目前无法支持,因此需要在启动的时候就注入应用的配置文件,可以injector来实现文件目录的映射: 这样可能会存在一个问题,在Layotto启动完成时,如果Mount操作未完成,Layotto是无法启动完成的,可以包装个start.sh脚本,循环监听特定目录下的文件,只有mount成功后,再启动Layotto:
|
This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue or help wanted) or other activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue or help wanted. Thank you for your contributions. |
What would you like to be added:
Support pod injection to deploy Layotto as a sidecar in Kubernetes.
Why is this needed:
Deploying Layotto as a sidecar is a common scenario in Kubernetes.
We need to provide such things in Layotto:
Command Line Tool
A command lint tool which supports manually inject like
istioctl kube-inject
:MutatingWebhook
An optional component to dynamically inject Layotto when target pod is creating.
Auto inject into pods conditions:
mosn-injection: enabled
sidecar.mosn.io/inject: false
The text was updated successfully, but these errors were encountered: