-
Notifications
You must be signed in to change notification settings - Fork 6
K8s-less mode and helpers #1164
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
Open
Fredi-raspall
wants to merge
10
commits into
main
Choose a base branch
from
pr/fredi/k8s-less
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds a small crate with a procedural macro to derive trait "Sample". The trait is meant to allow building sample json/yaml files for the main gateay CRD. Trait "Sample" is introduced later, outside of this crate. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Add a vanilla implementation of the Sample trait for the primitive / basic types that the generated rust types for the CRDs depend on. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Modify build.rs to derive trait Sample for the autogenerated types to represent CRDs, recursively. By automatically deriving Sample, we make sure that samples will be aligned when the CRD definitions change. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
The function will be used to create sample json and yaml files to be used as templates for manual testing. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Adds crate k8s-sample-crds which, at build time, uses the utils in k8s-intf to generate json/yaml "samples" (templates) that are up-to-date with the CRD definitions in k8s-intf. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Adds a new crate to support kubeless mode (k8s-less), where dataplane learns its configuration by monitoring changes in files inside a directory (using inotify) that contain the gateway spec in yaml or json. This mode of operation may be used only for testing or development. Therefore, we implement it outside of the k8s-intf crate. Files that change in (or get added to) the watched directory get read and their contents (yaml or json) deserialized into a crd spec. From that spec, a GatewayAgent object (representing the main CRD) is built and passed to a user-provided callback. This crate attempts to mimic k8s-intf and deals only with: - the watching of files in a directory using inotify - the deserialization of those files into the GatewayAgent type. It does not attempt to populate/build any of the configuration types in crate dataplane-config. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Adds --config-dir cmd line option to specify the directory in k8s- less mode and augments the ConfigServerSection to include it. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
Add a k8s-less client that watches the config directory and uses the config client to request the config processor to apply a new config. Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
af51bc2 to
7f3ab83
Compare
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to make it easy to create k8s-like configurations and run dataplane without k8s infrastructure. This is convenient for early testing when developing new features.
This PR contains 4 parts:
k8s-sample-derivethat allows deriving a trait called Sample.k8s-sample-crdswhich creates sample files automatically.--config-dirDIRECTORY, where DIRECTORY is the directory to drop the configs to.