-
Notifications
You must be signed in to change notification settings - Fork 123
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
Adding multipath-tools extension #505
Open
aaroncirillo-cision
wants to merge
1
commit into
siderolabs:main
Choose a base branch
from
aaroncirillo-cision:feature/multipath-tools
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.
+1,275
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Multipath-tools | ||
This extension adds multipath-tools to Talos. Mutipath is an essential feature in many enterprise environments because it enables high availability and fault tolerance of storage subsystems. Typically these storage subsystems are connected through a Fiber Channel network, but other methods like iSCSI exist as well. This extension will start the multpath daemon as a Talos service and use a default config file packaged with this extension. | ||
|
||
### Customization | ||
The default configuration file is located in src/rootfs/etc/multipath.conf, you may wish to update this to suit the needs of your particular storage subsystem. In particular the load balancing algorithm in there right now is round-robin. This is due to Talos not yet having additional kernel modules available for more advanced load balancing algorithms. In the future this may change and you may want to customize this part of the configuration. | ||
|
||
### Limitations | ||
The multipath bindings file in this extension is currently ephemeral. If the Talos node reboots the bindings file will be recreated on startup. This could be troublesome in some envrionments. Future versions of this extension may address this limitation. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: v1alpha1 | ||
metadata: | ||
name: multipath-tools | ||
version: "$VERSION" | ||
author: Cision | ||
description: | | ||
This system extension provides multipath-tools for storage redundancy and reliability. | ||
compatibility: | ||
talos: | ||
version: ">= v1.0.0" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: multipath-tools | ||
container: | ||
security: | ||
rootfsPropagation: shared | ||
maskedPaths: [] | ||
readonlyPaths: [] | ||
writeableSysfs: true | ||
entrypoint: /usr/local/bin/start_multipath | ||
args: [] | ||
mounts: | ||
- source: /usr/local | ||
destination: /usr/local | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /lib/modules | ||
destination: /usr/local/lib/modules | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /proc | ||
destination: /usr/local/proc | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /sys | ||
destination: /usr/local/sys | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /dev | ||
destination: /usr/local/dev | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /run | ||
destination: /usr/local/run | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
- source: /tmp | ||
destination: /usr/local/etc/multipath | ||
type: bind | ||
options: | ||
- bind | ||
- rw | ||
depends: | ||
- network: | ||
- addresses | ||
- service: udevd | ||
- path: /dev/mapper/control | ||
restart: always |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: multipath-tools | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- env: | ||
GOPATH: /go | ||
cachePaths: | ||
- /.cache/go-build | ||
- /go/pkg | ||
prepare: | ||
- | | ||
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml | ||
build: | ||
- | | ||
export PATH=${PATH}:${TOOLCHAIN}/go/bin | ||
|
||
cd /pkg/src/go | ||
CGO_ENABLED=0 go build -o ./start_multipath . | ||
install: | ||
- | | ||
mkdir -p /rootfs/usr/local | ||
cp -ar /pkg/src/rootfs/* /rootfs/usr/local | ||
cp -ar /pkg/src/go/start_multipath /rootfs/usr/local/bin | ||
mkdir -p /rootfs/usr/local/etc/containers | ||
mkdir -p /rootfs/usr/local/lib/containers/multipath-tools | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs | ||
- from: /pkg/manifest.yaml | ||
to: / | ||
- from: /pkg/multipath-tools.yaml | ||
to: /rootfs/usr/local/etc/containers/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/cision/multipath-tools | ||
|
||
go 1.21 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/exec" | ||
"syscall" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Starting multipath daemon...") | ||
|
||
//setup a chroot environment for the extension | ||
newRoot := "/usr/local" | ||
if err := syscall.Chroot(newRoot); err != nil { | ||
fmt.Println("Error:", err) | ||
os.Exit(1) | ||
} | ||
|
||
//start the multipath daemon in the chroot environment | ||
cmd := exec.Command("/usr/sbin/multipathd", "-d") | ||
cmd.Stdin = os.Stdin | ||
cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
if err := cmd.Run(); err != nil { | ||
fmt.Println("Command execution failed:", err) | ||
} | ||
} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think we need this, with
mountPropogation
shared should work as a normal extension service