5 Commits

Author SHA1 Message Date
benvin 3edff726f2 Merge pull request 'Build an OpenBao RPM alongside the Vault one' (#3) from benvin/openbao-rpm into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #3
2026-07-06 23:21:49 +10:00
unkinben ac38203b8e Build an OpenBao RPM alongside the Vault one
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
The plugin runs under both Vault and OpenBao, but nfpm only produced a
single RPM that installs into /opt/vault-plugins. OpenBao hosts expect
their plugins under /opt/openbao-plugins, so a second package is needed.

- Parameterize nfpm.yaml with PACKAGE_NAME, PACKAGE_PLUGIN_DIR, and
  PACKAGE_PREINSTALL so one config renders per target server
- Replace the static preinstall.sh with preinstall.sh.tmpl that
  mkdir -p's the flavour's plugin directory
- Build two RPMs in build-rpm.sh via a build_flavor helper:
  vault-plugin-secrets-litellm -> /opt/vault-plugins and
  openbao-plugin-secrets-litellm -> /opt/openbao-plugins
2026-07-06 23:14:43 +10:00
benvin a55bc77f38 Merge pull request 'Set kubernetes backend options on all woodpecker steps' (#2) from benvin/woodpecker-backend-options into main
Reviewed-on: #2
2026-07-03 13:28:12 +10:00
unkinben 0e8acca9c6 Set kubernetes backend options on all woodpecker steps
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Give every CI step explicit resource requests/limits and the default service
account (matching the pre-commit step), so the k8s woodpecker backend schedules
them with bounded resources.

- build/test/lint/package steps: 512Mi/1cpu requests, 2Gi/2cpu limits
- upload step: lighter 128Mi/100m requests, 512Mi/500m limits
2026-07-03 13:13:48 +10:00
benvin 0edc93f6db Merge pull request 'Add LiteLLM dynamic secrets engine implementation' (#1) from benvin/initial-implementation into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #1
2026-07-03 13:04:56 +10:00
7 changed files with 90 additions and 13 deletions
+10
View File
@@ -6,3 +6,13 @@ steps:
image: golang:1.25
commands:
- make build
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
+30
View File
@@ -6,12 +6,32 @@ steps:
image: git.unkin.net/unkin/almalinux9-gobuilder:20260606
commands:
- make build VERSION=${CI_COMMIT_TAG}
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
- name: package
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands:
- ./scripts/build-rpm.sh ${CI_COMMIT_TAG}
depends_on: [build]
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
- name: upload
image: git.unkin.net/unkin/almalinux9-base:20260606
@@ -36,3 +56,13 @@ steps:
--data-binary @"$$rpm"
done
depends_on: [package]
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
cpu: 500m
+20
View File
@@ -6,8 +6,28 @@ steps:
image: golang:1.25
commands:
- make lint
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
- name: test
image: golang:1.25
commands:
- make test
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
+8 -6
View File
@@ -1,6 +1,8 @@
---
# nfpm config for building the vault-plugin-secrets-litellm RPM.
# Rendered through envsubst (see scripts/build-rpm.sh) then fed to `nfpm pkg`.
# Built once per target server (Vault, OpenBao); PACKAGE_NAME and
# PACKAGE_PLUGIN_DIR vary per flavour.
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
@@ -18,19 +20,19 @@ license: ${PACKAGE_LICENSE}
disable_globbing: false
replaces:
- vault-plugin-secrets-litellm
- ${PACKAGE_NAME}
provides:
- vault-plugin-secrets-litellm
- ${PACKAGE_NAME}
# Install the plugin binary into the Vault/OpenBao plugin directory. Point the
# server's plugin_directory at /opt/vault-plugins to pick it up.
# Install the plugin binary into the server's plugin directory. Point the
# server's plugin_directory at PACKAGE_PLUGIN_DIR to pick it up.
contents:
- src: dist/vault-plugin-secrets-litellm
dst: /opt/vault-plugins/vault-plugin-secrets-litellm
dst: ${PACKAGE_PLUGIN_DIR}/vault-plugin-secrets-litellm
file_info:
mode: 0755
owner: root
group: root
scripts:
preinstall: packaging/scripts/preinstall.sh
preinstall: ${PACKAGE_PREINSTALL}
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
mkdir -p /opt/vault-plugins
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
# Rendered per flavour via envsubst (see scripts/build-rpm.sh).
mkdir -p ${PACKAGE_PLUGIN_DIR}
+18 -4
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
#
# Package the (already built) plugin binary into an RPM with nfpm.
# Package the (already built) plugin binary into RPMs with nfpm.
# Builds one RPM per target server: Vault (/opt/vault-plugins) and
# OpenBao (/opt/openbao-plugins). Both wrap the same binary.
# Usage: scripts/build-rpm.sh [version] (version defaults to $CI_COMMIT_TAG)
#
set -euo pipefail
@@ -18,7 +20,7 @@ if [ ! -f "${DIST}/${BINARY}" ]; then
exit 1
fi
export PACKAGE_NAME="${BINARY}"
# Fields shared across every flavour.
export PACKAGE_VERSION="${VERSION}"
export PACKAGE_RELEASE="1"
export PACKAGE_ARCH="amd64"
@@ -28,8 +30,20 @@ export PACKAGE_MAINTAINER="Ben Vincent <ben@unkin.net>"
export PACKAGE_HOMEPAGE="https://git.unkin.net/unkin/vault-plugin-secrets-litellm"
export PACKAGE_LICENSE="MIT"
envsubst < packaging/nfpm.yaml > "${DIST}/nfpm.yaml"
nfpm pkg --config "${DIST}/nfpm.yaml" --target "${DIST}" --packager rpm
# build_flavor <package-name> <plugin-dir>
build_flavor() {
export PACKAGE_NAME="$1"
export PACKAGE_PLUGIN_DIR="$2"
export PACKAGE_PREINSTALL="${DIST}/preinstall-${PACKAGE_NAME}.sh"
envsubst '${PACKAGE_PLUGIN_DIR}' \
< packaging/scripts/preinstall.sh.tmpl > "${PACKAGE_PREINSTALL}"
envsubst < packaging/nfpm.yaml > "${DIST}/nfpm-${PACKAGE_NAME}.yaml"
nfpm pkg --config "${DIST}/nfpm-${PACKAGE_NAME}.yaml" --target "${DIST}" --packager rpm
}
build_flavor "vault-plugin-secrets-litellm" "/opt/vault-plugins"
build_flavor "openbao-plugin-secrets-litellm" "/opt/openbao-plugins"
echo "Built:"
ls -1 "${DIST}"/*.rpm