custom-plugin

command
v1.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build image and plugin

Use musl-libc build image and plugin

Because the default vc-scheduler base image is alpine, which only has musl-libc, so we should use musl-gcc to build the plugin.

Please run this command at the root path of the project.

docker build -t volcanosh/vc-scheduler:custom-plugins -f example/custom-plugin/Dockerfile .

And then replace the image and set --plugins-dir=plugins parameter in vc-scheduler deployment yaml file.

Build the image and plugin locally:

Please run this command at the root path of the project.

# install musl
wget http://musl.libc.org/releases/musl-latest.tar.gz
mkdir musl-latest && tar -xf musl-latest.tar.gz -C musl-latest --strip-components=1 && cd musl-latest
./configure
make && sudo make install

# build plugin .so file
CC=/usr/local/musl/bin/musl-gcc CGO_ENABLED=1 go build -buildmode=plugin -ldflags '-linkmode=external' \
    -o example/custom-plugin/magic.so example/custom-plugin/magic.go

# build vc scheduler binary
SUPPORT_PLUGINS=yes make vc-scheduler
cat << EOF > Dockerfile
FROM alpine:latest
COPY _output/bin/vc-scheduler /vc-scheduler
COPY example/custom-plugin/magic.so /plugins/magic.so
ENTRYPOINT ["/vc-scheduler"]
EOF

# build vc scheduler image
docker build -t volcanosh/vc-scheduler:custom-plugins .

And then replace the image and set --plugins-dir=plugins parameter in vc-scheduler deployment yaml file.

Use gnu-libc build plugin

If you want to use ubuntu as base image, you can use gnu-libc to build the plugin. Since most Linux OS have gnu-libc, you can just build the plugin in local.

# default CC is gcc
CGO_ENABLED=1 go build -buildmode=plugin magic.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL