feat: add consul-cni and nomad-autoscaler
This commit is contained in:
parent
81e2c783c9
commit
263fb689a8
@ -17,8 +17,7 @@ COPY nfpm.yaml /app/nfpm.yaml
|
|||||||
COPY scripts /app/scripts
|
COPY scripts /app/scripts
|
||||||
|
|
||||||
# Download the required files
|
# Download the required files
|
||||||
RUN dnf install -y unzip && \
|
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 && \
|
||||||
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
|
tar xf cni-plugins-linux-amd64.tgz
|
||||||
|
|
||||||
# Default command to build RPMs
|
# Default command to build RPMs
|
||||||
|
|||||||
1
rpms/consul-cni/1.7.1/release
Normal file
1
rpms/consul-cni/1.7.1/release
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
25
rpms/consul-cni/Dockerfile
Normal file
25
rpms/consul-cni/Dockerfile
Normal 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
34
rpms/consul-cni/nfpm.yaml
Normal 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
|
||||||
2
rpms/consul-cni/scripts/preinstall.sh
Executable file
2
rpms/consul-cni/scripts/preinstall.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
mkdir -p /opt/cni/bin
|
||||||
1
rpms/nomad-autoscaler/0.4.6/release
Normal file
1
rpms/nomad-autoscaler/0.4.6/release
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
||||||
24
rpms/nomad-autoscaler/Dockerfile
Normal file
24
rpms/nomad-autoscaler/Dockerfile
Normal 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
|
||||||
35
rpms/nomad-autoscaler/nfpm.yaml
Normal file
35
rpms/nomad-autoscaler/nfpm.yaml
Normal 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
|
||||||
Loading…
Reference in New Issue
Block a user