Skip to content
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

feat: support pod injection to deploy layotto as a sidecar in Kubernetes #993

Merged
merged 8 commits into from
Oct 23, 2023
Merged

feat: support pod injection to deploy layotto as a sidecar in Kubernetes #993

merged 8 commits into from
Oct 23, 2023

Conversation

xiaoxiang10086
Copy link
Contributor

What this PR does:
支持 Layotto 以 sidecar 形态注入到 Kubernetes Pod 中

Which issue(s) this PR fixes:

Fixes #910

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@layotto-cla
Copy link

layotto-cla bot commented Sep 26, 2023

Hi @xiaoxiang10086, welcome to mosn community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

@github-actions
Copy link

Hi @xiaoxiang10086. Thanks for your PR! 🎉
If the PR is ready, use the /cc command to assign reviewer to review.

Details

The full list of commands accepted by this bot can be found here.

The pull request process is described here.

@layotto-cla layotto-cla bot added cla:yes and removed cla:no labels Sep 26, 2023
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on it, but plz add a user-guide docs to thie feature along with this PR, thanks.

@xiaoxiang10086
Copy link
Contributor Author

xiaoxiang10086 commented Sep 28, 2023

thanks for working on it, but plz add a user-guide docs to thie feature along with this PR, thanks.

For specific user documentation, please refer to README.md.

In this document I demonstrate how to use Helm to deploy the Layotto sidecar injector and deploy a Layotto application to interact with Layotto on kubernetes

@Xunzhuo
Copy link
Member

Xunzhuo commented Sep 28, 2023

/area installation
/priority high

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Attention: 71 lines in your changes are missing coverage. Please review.

Files Coverage Δ
pkg/injector/service/injector.go 85.00% <85.00%> (ø)
pkg/injector/service/pod_patcher.go 77.77% <77.77%> (ø)
pkg/common/strings.go 40.00% <0.00%> (-60.00%) ⬇️
pkg/injector/service/config.go 21.05% <21.05%> (ø)
pkg/injector/service/handle.go 44.87% <44.87%> (ø)

📢 Thoughts on this report? Let us know!.

Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some points:

  • Use Docker Hub OCI to manage layotto injector helm charts and update related demos/docs.
  • Add Sleep in demo to prevent shutting down container.
  • Add layotto dockerfile under docker/layotto_injector
  • Add build and push steps in layotto-ci workflows to build and push latest layotto-injector image.
  • Add package and push steps in layotto-ci workflows to push latest layotto-injector helm chart in oci docker hub.
  • Add release workflows for layotto-injector to release image and helm charts.
  • Update demo/guide docs and migrate all demo,injector images/helm charts to layotto, will ask community to provide dockerhub pwd.

.github/workflows/layotto-release.yml Outdated Show resolved Hide resolved
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ kgpo -w
NAME                                      READY   STATUS              RESTARTS   AGE
layotto-state-sdk-demo-6d8b87b7cd-qd6s7   0/2     ContainerCreating   0          4s
redis-master-0                            1/1     Running             0          6m42s
redis-replicas-0                          1/1     Running             0          6m42s
redis-replicas-1                          1/1     Running             0          5m42s
redis-replicas-2                          1/1     Running             0          5m17s
layotto-state-sdk-demo-6d8b87b7cd-qd6s7   1/2     Error               0          4s
layotto-state-sdk-demo-6d8b87b7cd-qd6s7   2/2     Running             1 (4s ago)   7s

Maybe we should set layotto as an init container.

@Xunzhuo
Copy link
Member

Xunzhuo commented Oct 23, 2023

/lgtm

@Xunzhuo
Copy link
Member

Xunzhuo commented Oct 23, 2023

I think we need some e2e tests for this feature, but this could be a follow-up.

@github-actions
Copy link

[LGTMNOTIFIER] This PR is LGTM

This pull-request has been lgtm by: @Xunzhuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here.

Details

Needs reviewers from an reviewer in each of these files:

Reviewers can indicate their approval by writing /lgtm in a comment
Reviewers can cancel approval by writing /lgtm cancel in a comment

@github-actions github-actions bot added the lgtm label Oct 23, 2023
@Xunzhuo
Copy link
Member

Xunzhuo commented Oct 23, 2023

/hold
/approve

Will merge after CI passed.

@github-actions
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: @Xunzhuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here.

Details

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Xunzhuo
Copy link
Member

Xunzhuo commented Oct 23, 2023

/hold cancel

@Xunzhuo Xunzhuo merged commit 7a28efe into mosn:main Oct 23, 2023
32 checks passed
@xiaoxiang10086 xiaoxiang10086 changed the title feat: support pod injection to deploy Layotto as a sidecar in Kubernetes feat: support pod injection to deploy layotto as a sidecar in Kubernetes Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Pod Injection to deploy Layotto as a sidecar in Kubernetes.
2 participants