Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Adds first version of krustlet based agent implementation #18

Merged
merged 22 commits into from
Dec 2, 2020

Conversation

soenkeliebau
Copy link
Member

@soenkeliebau soenkeliebau commented Nov 26, 2020

This is the first code drop for the agent version that has been based on the Krustlet code.

Implemented functionality is:

  • register node with apiserver and keep the node alive
  • watch for pods
  • upon pod assigned:
    • download package
    • install package
    • backoff on missing config map
    • create config from config maps
    • start process
    • wait for process to not die during startup
    • watch process for the runtime

…mitations of the config parsing that Krustlet does.

Krustlet does not allow building a config from scratch by just specifying a few values, so we override some values by setting environment variables from our config - BUT: it is not currently possible to specify command line parameters when starting the agent, as the Krustlet will also try to parse these and doesn't know about them, so the only possible way to pass arguments is currently via exporting a config file in the CONFIG_FILE env variable and specifying all arguments in there.
An example has been added in config/agent_config
…mitations of the config parsing that Krustlet does.

Krustlet does not allow building a config from scratch by just specifying a few values, so we override some values by setting environment variables from our config - BUT: it is not currently possible to specify command line parameters when starting the agent, as the Krustlet will also try to parse these and doesn't know about them, so the only possible way to pass arguments is currently via exporting a config file in the CONFIG_FILE env variable and specifying all arguments in there.
An example has been added in config/agent_config
Copy link
Member

@lfrancke lfrancke left a comment

Choose a reason for hiding this comment

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

Not done yet with the review.
Will continue tomorrow.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/provider/states/download_package_backoff.rs Outdated Show resolved Hide resolved
src/provider/states/download_package.rs Outdated Show resolved Hide resolved
src/provider/states/download_package.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/repository/stackablerepository.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/states/install_package.rs Outdated Show resolved Hide resolved
src/provider/states/stopped.rs Show resolved Hide resolved
src/provider/states/stopping.rs Show resolved Hide resolved
src/provider/states/waiting_config.rs Outdated Show resolved Hide resolved
src/provider/states/waiting_config.rs Outdated Show resolved Hide resolved
src/provider/states.rs Outdated Show resolved Hide resolved
@lfrancke lfrancke linked an issue Nov 27, 2020 that may be closed by this pull request
config/agent_config Outdated Show resolved Hide resolved
src/provider/repository/package.rs Show resolved Hide resolved
src/provider/states/creating_config.rs Outdated Show resolved Hide resolved
src/provider/states/creating_config.rs Outdated Show resolved Hide resolved
src/provider/states/creating_config.rs Outdated Show resolved Hide resolved
src/provider/repository/stackablerepository.rs Outdated Show resolved Hide resolved
src/provider/states/creating_config.rs Show resolved Hide resolved
src/provider/repository/mod.rs Show resolved Hide resolved
src/provider/error.rs Outdated Show resolved Hide resolved
src/provider/mod.rs Outdated Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
Copy link
Member

@lfrancke lfrancke left a comment

Choose a reason for hiding this comment

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

Almost there 👍
There are also still a few things open/unresolved from past reviews.

src/provider/states/failed.rs Outdated Show resolved Hide resolved
src/provider/mod.rs Outdated Show resolved Hide resolved
src/provider/repository/mod.rs Show resolved Hide resolved
src/provider/states/create_service.rs Outdated Show resolved Hide resolved
src/provider/states/downloading.rs Outdated Show resolved Hide resolved
src/provider/states/starting.rs Outdated Show resolved Hide resolved
src/provider/states/stopped.rs Outdated Show resolved Hide resolved
src/provider/states/stopping.rs Outdated Show resolved Hide resolved
Copy link
Member

@lfrancke lfrancke left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@soenkeliebau soenkeliebau merged commit 2e6e52f into stackabletech:main Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants