feat: add consul-cni and nomad-autoscaler
All checks were successful
Build / build-9 (pull_request) Successful in 1m0s
Build / build-8 (pull_request) Successful in 1m28s

This commit is contained in:
Ben Vincent 2025-06-13 23:11:37 +10:00
parent 81e2c783c9
commit 263fb689a8
8 changed files with 123 additions and 2 deletions

View File

@ -17,8 +17,7 @@ COPY nfpm.yaml /app/nfpm.yaml
COPY scripts /app/scripts
# Download the required files
RUN dnf install -y unzip && \
wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \
RUN wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \
tar xf cni-plugins-linux-amd64.tgz
# Default command to build RPMs

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,25 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest
# Create output directory for RPMs
RUN mkdir -p /app/dist
# Set working directory
WORKDIR /app
ARG PACKAGE_RELEASE
ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
COPY nfpm.yaml /app/nfpm.yaml
COPY scripts /app/scripts
# Download the required files
RUN dnf install -y unzip && \
wget -O /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip && \
unzip consul-cni.zip
# Default command to build RPMs
CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm

34
rpms/consul-cni/nfpm.yaml Normal file
View File

@ -0,0 +1,34 @@
# nfpm.yaml
name: consul-cni
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
section: default
priority: extra
description: "Plugin for Consul on Kubernetes to allow configuring traffic redirection rules without escalated container privileges."
maintainer: Hashicorp
homepage: https://hashicorp.com
license: Mozilla Public License, version 2.0
disable_globbing: false
replaces:
- consul-cni
# Files to include in the package
contents:
- src: /app/consul-cni
dst: /opt/cni/bin/consul-cni
file_info:
mode: 0755
owner: root
group: root
# Scripts to run during installation/removal (optional)
scripts:
preinstall: ./scripts/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
mkdir -p /opt/cni/bin

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,24 @@
# Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest
# Create output directory for RPMs
RUN mkdir -p /app/dist
# Set working directory
WORKDIR /app
ARG PACKAGE_RELEASE
ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
# Copy nfpm.yaml from the context into the container
COPY nfpm.yaml /app/nfpm.yaml
# Download the required files
RUN dnf install -y unzip && \
wget -O /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip && \
unzip nomad-autoscaler.zip
# Default command to build RPMs
CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm

View File

@ -0,0 +1,35 @@
# nfpm.yaml
name: nomad-autoscaler
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: amd64
platform: linux
section: default
priority: extra
description: "The Nomad Autoscaler is an autoscaling daemon for Nomad, architectured around plug-ins to allow for easy extensibility in terms of supported metrics sources, scaling targets and scaling algorithms."
maintainer: Hashicorp
homepage: https://github.com/hashicorp/nomad-autoscaler
license: Mozilla Public License, version 2.0
disable_globbing: false
replaces:
- nomad-autoscaler
# Files to include in the package
contents:
- src: /app/nomad-autoscaler
dst: /usr/bin/nomad-autoscaler
file_info:
mode: 0755
owner: root
group: root
# Scripts to run during installation/removal (optional)
# scripts:
# preinstall: ./scripts/preinstall.sh
# postinstall: ./scripts/postinstall.sh
# preremove: ./scripts/preremove.sh
# postremove: ./scripts/postremove.sh