The sambacc is an young project that aims to consolidate and coordinate configuration of Samba, and related components, when running in a container. The configuation of one or many instances can be provided to the tool by way of a JSON file which then handles the low level details of actually configuring smbd and other elements in the container environment.
Samba is a powerful and unique tool for implementing the SMB protocol and a software stack to support it on unix-like systems. However, it's potentially challenging to set up and manage many instances of Samba by-hand, especially when running under a container orchestration system.
The idea behind sambacc is mainly to automate all of the low level steps of setting up smbd, users, groups, and other supporting components. The tool is also designed to consume one "site-wide" configuration file that can be maintained across many container instances. sambacc is written in Python as samba provides Python bindings for some of the aspects of samba we need to control.
The sambacc library and samba-container cli command are used by the samba-container project as part of the server container images.
When installed a samba-container
command will be available.
Without any additional arguments samba-container
prints the synthesizsed
samba (smb.conf) configuration based on the environment variables:
SAMBACC_CONFIG
- configuration file(s)SAMBA_CONTAINER_ID
- Identity of this instance
Additionally, there are subcommands:
samba-container import
- Import smb.conf-style settings into registrysamba-container import-users
- Import users into /etc files and smb passdbsamba-container init
- Initialize the container environment for use by samba servicessamba-container run <service>
- Initialize and run a named samba service
For complete usage, run:
samba-container --help
- Abstracts away some of the nitty-gritty details about what Samba expects in it's environment
- Imports specific smb.conf settings from "site wide" JSON configuration.
- Imports users and groups
- Starts smbd with container friendly settings
- Starts winbindd with container friendly settings
- Primitive and insecure support for joining AD
A lot. Important features that are missing include:
- The ability to manage more secure domain joins
- Better coordination around dependent actions, like being joined
- Better integration (as opposed to unit) testing
- (Possibly) CTDB integration for scale out use cases
Currently the only method of install is from source control.
- Clone the repo:
git clone https://github.com/samba-in-kubernetes/sambacc
cd sambacc
- Install locally:
python setup.py install --user
The typical setup.py commands should work.
To run the entire unit test suite locally install tox
and run tox
in
the repo root.
Because of the library and tooling that interacts with samba has some system level dependencies, not all test can be run locally.
In addition to running the unit tests locally, I've created a container image for testing and building sambacc. It lives at ./tests/container. This is canonical way to run the test suite and is what is used by the CI tests. When run this way certain system packages can be installed, etc. to support running a wider range of test cases.
GPLv3 as per the COPYING file.
This is the same license as used by Samba.
Patches, issues, comments, and questions are welcome.
Resources: