Skip to content

Multi-arch images #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 3, 2021
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
33 changes: 30 additions & 3 deletions .github/workflows/ci_build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,37 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Build kube-objects image
- name: Prepare container build
id: prep
run: |
VERSION=`cat VERSION`
TAGS=splunk/kube-objects: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
push: false
load: true
tags: ${{ steps.prep.outputs.tags }}
build-args: VERSION=${{ steps.prep.outputs.version }}

- name: Check kube-objects image
run: |
sed -i 's/VERSION=$VERSION -t splunk\/kube-objects:$TAG .\/docker/VERSION=$VERSION -t kube-objects:$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,16 +14,18 @@ cd /opt
git clone https://github.com/splunk/splunk-connect-for-kubernetes.git
cd splunk-connect-for-kubernetes

sed -i 's/name: splunk\/kube-objects/repository: kube-objects/' ci_scripts/sck_values.yml
cat ci_scripts/sck_values.yml

minikube image load splunk/kube-objects: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-objects.image.pullPolicy=IfNotPresent \
--set splunk-kubernetes-objects.image.tag=recent \
-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,12 +25,14 @@ 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

RUN dnf install -y jq

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