-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds in a toggleable feature to send logs via configurable Kafka Producer
- Loading branch information
Sara Kalupa
committed
Jan 2, 2024
1 parent
8349e47
commit 5d0a0dc
Showing
9 changed files
with
342 additions
and
11 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 |
---|---|---|
@@ -1,33 +1,35 @@ | ||
# Strelka Frontend | ||
# The frontend for a cluster in which clients can connect directly via Envoy. | ||
# For more information, please see: https://target.github.io/strelka/#/?id=strelka-frontend | ||
FROM golang:1.17.6 AS build | ||
FROM golang:1.17.6-alpine AS build | ||
LABEL maintainer="Target Brands, Inc. [email protected]" | ||
|
||
RUN apk add openssl-dev bash build-base pkgconfig librdkafka librdkafka-dev | ||
|
||
# Copy source files and set the working directory | ||
COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ | ||
WORKDIR /go/src/github.com/target/strelka/src/go/ | ||
COPY go.* /go/src/github.com/target/strelka/ | ||
|
||
# Statically compile and output to tmp | ||
RUN go mod download && \ | ||
CGO_ENABLED=0 go build -o /tmp/strelka-frontend cmd/strelka-frontend/main.go | ||
CGO_ENABLED=1 go build -tags musl -o /tmp/strelka-frontend cmd/strelka-frontend/main.go | ||
|
||
# Initialize runtime container | ||
FROM alpine | ||
LABEL maintainer="Target Brands, Inc. [email protected]" | ||
|
||
RUN apk add librdkafka | ||
|
||
# Copy binary | ||
COPY --from=build /tmp/strelka-frontend /usr/local/bin/strelka-frontend | ||
COPY --from=build /usr/local/lib/ /usr/local/lib/ | ||
|
||
# Create logging directory | ||
RUN mkdir /var/log/strelka/ && \ | ||
chgrp -R 0 /var/log/strelka/ && \ | ||
chmod -R g=u /var/log/strelka/ | ||
|
||
# Initialize with non-root user | ||
USER 1001 | ||
|
||
# Set container entrypoint. This could be set/overridden elsewhere in deployment (e.g. k8s, docker-compose, etc.) | ||
# Currently overwritten in ./build/docker-compose.yml | ||
ENTRYPOINT ["strelka-frontend"] | ||
ENTRYPOINT ["strelka-frontend", "-locallog=true", "-kafkalog=false"] |
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
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.