Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/ci_build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Build kubernetes-metrics image
- name: Prepare container build
id: prep
run: |
VERSION=`cat VERSION`
TAGS=splunk/k8s-metrics:recent

echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Build multi-arch kubernetes-metrics image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./docker/Dockerfile
platforms: linux/amd64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Ref 1]

push: false
load: true
tags: ${{ steps.prep.outputs.tags }}
build-args: VERSION=${{ steps.prep.outputs.version }}

- name: Check kubernetes-metrics image
run: |
sed -i 's/VERSION=$VERSION -t splunk\/k8s-metrics:$TAG .\/docker/VERSION=$VERSION -t k8s-metrics:$TAG .\/docker/' docker/build.sh
sudo docker/build.sh $GITHUB_RUN_ID
docker image ls

- name: Setup Minikube
Expand Down
6 changes: 4 additions & 2 deletions ci_scripts/deploy_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ cd /opt
git clone https://github.com/splunk/splunk-connect-for-kubernetes.git
cd splunk-connect-for-kubernetes

minikube image load splunk/k8s-metrics:recent

echo "Deploying k8s-connect with latest changes"
helm install ci-sck --set global.splunk.hec.token=$CI_SPLUNK_HEC_TOKEN \
--set global.splunk.hec.host=$CI_SPLUNK_HOST \
--set kubelet.serviceMonitor.https=true \
--set splunk-kubernetes-metrics.image.repository=k8s-metrics \
--set splunk-kubernetes-metrics.image.tag=recent \
--set splunk-kubernetes-metrics.image.pullPolicy=IfNotPresent \
-f ci_scripts/sck_values.yml helm-chart/splunk-connect-for-kubernetes
#wait for deployment to finish
until kubectl get pod | grep Running | [[ $(wc -l) == 4 ]]; do
sleep 1;
done
done
18 changes: 15 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
FROM ruby:2.7.4-buster as builder

ADD ./ /app/
WORKDIR /app
RUN gem install bundler
RUN bundle update --bundler
RUN bundle install

RUN bundle exec rake build -t -v

FROM registry.access.redhat.com/ubi8/ruby-27

ARG VERSION
Expand All @@ -15,10 +25,12 @@ ENV FLUENT_USER fluent

USER root

COPY *.gem /tmp/
COPY licenses /licenses
COPY --from=builder /app/pkg/fluent-plugin-*.gem /tmp/

RUN mkdir /licenses
COPY --from=builder /app/LICENSE /licenses/LICENSE

COPY Gemfile* ./
COPY --from=builder /app/docker/Gemfile* ./
RUN yum update -y \
&& yum remove -y nodejs npm \
&& gem install bundler \
Expand Down