-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build out sidecar infrastructure (#125)
* save work * more setup * pass valkey version * Fix build variables * embed versions * scan new dockerfiles * set package versions * set workdir instead of 'cd' * fix gosec, and image tag * make the linter happy * try adding trivy in scan * fix dockerfile arg * minor fix * test * set tags * test * Scan only valkey * missing : * force it * no metadata neeeded now * clean-up image builder * sidecar to be a cobra binary * fix misspelling and error check * fix valkey building * just need to test * eliminate need for bitnami image * appease the linter gods
- Loading branch information
Showing
23 changed files
with
824 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ on: | |
- main | ||
pull_request: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
||
permissions: | ||
contents: read | ||
security-events: write | ||
|
@@ -20,7 +23,13 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
dockerfile: Dockerfile.valkey | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile.controller | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile.sidecar | ||
gosec: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -68,3 +77,27 @@ jobs: | |
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true | ||
trivy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build the Valkey image | ||
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 | ||
id: docker_build_valkey | ||
with: | ||
file: Dockerfile.valkey | ||
context: . | ||
push: false | ||
tags: ${{ env.REGISTRY }}/hyperspike/valkey:${{ github.SHA }} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
image-ref: ${{ env.REGISTRY }}/hyperspike/valkey:${{ github.SHA }} | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: always() | ||
with: | ||
sarif_file: trivy-results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ go.work | |
.ingress.yaml | ||
blank.yaml | ||
cilium/ | ||
manager | ||
/manager | ||
/sidecar | ||
valkey-operator/ | ||
valkey-operator-*-chart.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ linters: | |
- unconvert | ||
- unparam | ||
- unused | ||
linters-settings: | ||
lll: | ||
line-length: 256 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
COPY manager /manager | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/manager"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
|
||
COPY sidecar /sidecar | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/sidecar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM alpine:3.21.1 AS builder | ||
|
||
ARG VALKEY_VERSION=8.0.1 | ||
|
||
WORKDIR /home/valkey | ||
|
||
RUN apk add --no-cache --virtual .build-deps \ | ||
git=2.47.1-r0 \ | ||
coreutils=9.5-r2 \ | ||
linux-headers=6.6-r1 \ | ||
musl-dev=1.2.5-r8 \ | ||
openssl-dev=3.3.2-r4 \ | ||
gcc=14.2.0-r4 \ | ||
curl=8.11.1-r0 \ | ||
make=4.4.1-r2 \ | ||
&& curl -L https://github.com/valkey-io/valkey/archive/refs/tags/${VALKEY_VERSION}.tar.gz -o valkey.tar.gz \ | ||
&& tar -xzf valkey.tar.gz --strip-components=1 \ | ||
&& make PREFIX=/usr BUILD_TLS=yes \ | ||
&& make install BUILD_TLS=yes PREFIX=/home/valkey/build | ||
|
||
FROM alpine:3.21.1 AS valkey | ||
|
||
RUN apk add --no-cache \ | ||
openssl=3.3.2-r4 \ | ||
ca-certificates=20241121-r1 \ | ||
&& addgroup -S valkey -g 1009 \ | ||
&& adduser -S -G valkey valkey -u 1009 \ | ||
&& mkdir /etc/valkey \ | ||
&& chown valkey:valkey /etc/valkey \ | ||
&& mkdir /var/lib/valkey \ | ||
&& chown valkey:valkey /var/lib/valkey | ||
|
||
COPY --from=builder /home/valkey/build/ /usr/ | ||
|
||
USER valkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.