-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visualize NAP logs in mock collector grafana (#939)
- Loading branch information
Showing
14 changed files
with
321 additions
and
28 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
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,84 @@ | ||
ARG BASE_IMAGE | ||
FROM --platform=linux/amd64 ${BASE_IMAGE} as install-nginx | ||
LABEL maintainer="NGINX Docker Maintainers <[email protected]>" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG ENTRY_POINT | ||
ARG PACKAGE_NAME | ||
ARG PACKAGES_REPO | ||
|
||
WORKDIR /agent | ||
COPY ./build /agent/build | ||
COPY $ENTRY_POINT /agent/entrypoint.sh | ||
|
||
ENV PLUS_VERSION=R32 | ||
|
||
RUN --mount=type=secret,id=nginx-crt,dst=nginx-repo.crt \ | ||
--mount=type=secret,id=nginx-key,dst=nginx-repo.key \ | ||
set -x \ | ||
# Create nginx user/group first, to be consistent throughout Docker variants | ||
&& groupadd --system --gid 101 nginx \ | ||
&& useradd --system --gid nginx --no-create-home --home-dir /nonexistent --uid 101 nginx \ | ||
&& apt-get update --allow-releaseinfo-change \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y \ | ||
ca-certificates \ | ||
gnupg1 \ | ||
lsb-release \ | ||
apt-transport-https \ | ||
git \ | ||
wget \ | ||
make \ | ||
gnupg2 \ | ||
ubuntu-keyring \ | ||
&& wget -qO - https://cs.nginx.com/static/keys/app-protect-security-updates.key | gpg --dearmor | tee /usr/share/keyrings/app-protect-security-updates.gpg >/dev/null \ | ||
&& wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null \ | ||
&& \ | ||
NGINX_GPGKEY=573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62; \ | ||
found=''; \ | ||
for server in \ | ||
hkp://keyserver.ubuntu.com:80 \ | ||
pgp.mit.edu \ | ||
; do \ | ||
echo "Fetching GPG key $NGINX_GPGKEY from $server"; \ | ||
apt-key adv --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$NGINX_GPGKEY" && found=yes && break; \ | ||
done; \ | ||
test -z "$found" && echo >&2 "error: failed to fetch GPG key $NGINX_GPGKEY" && exit 1; \ | ||
apt-get remove --purge --auto-remove -y gnupg1 && rm -rf /var/lib/apt/lists/* \ | ||
# Install the latest release of NGINX Plus and/or NGINX Plus modules | ||
# Uncomment individual modules if necessary | ||
# Use versioned packages over defaults to specify a release | ||
&& nginxPackages=" \ | ||
app-protect \ | ||
" \ | ||
&& echo "Acquire::https::pkgs.nginx.com::Verify-Peer \"true\";" > /etc/apt/apt.conf.d/90nginx \ | ||
&& echo "Acquire::https::pkgs.nginx.com::Verify-Host \"true\";" >> /etc/apt/apt.conf.d/90nginx \ | ||
&& echo "Acquire::https::pkgs.nginx.com::SslCert \"/etc/ssl/nginx/nginx-repo.crt\";" >> /etc/apt/apt.conf.d/90nginx \ | ||
&& echo "Acquire::https::pkgs.nginx.com::SslKey \"/etc/ssl/nginx/nginx-repo.key\";" >> /etc/apt/apt.conf.d/90nginx \ | ||
&& printf "deb https://pkgs.nginx.com/plus/${PLUS_VERSION}/ubuntu/ `lsb_release -cs` nginx-plus\n" > /etc/apt/sources.list.d/nginx-plus.list \ | ||
&& printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] https://pkgs.nginx.com/app-protect/${PLUS_VERSION}/ubuntu `lsb_release -cs` nginx-plus\n" | tee /etc/apt/sources.list.d/nginx-app-protect.list \ | ||
&& printf "deb [signed-by=/usr/share/keyrings/app-protect-security-updates.gpg] https://pkgs.nginx.com/app-protect-security-updates/ubuntu `lsb_release -cs` nginx-plus\n" | tee -a /etc/apt/sources.list.d/nginx-app-protect.list \ | ||
&& mkdir -p /etc/ssl/nginx \ | ||
&& cat nginx-repo.crt > /etc/ssl/nginx/nginx-repo.crt \ | ||
&& cat nginx-repo.key > /etc/ssl/nginx/nginx-repo.key \ | ||
&& apt-get update \ | ||
&& apt-get install --no-install-recommends --no-install-suggests -y \ | ||
$nginxPackages \ | ||
curl \ | ||
gettext-base \ | ||
jq \ | ||
&& apt-get remove --purge -y lsb-release \ | ||
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx-plus.list /etc/apt/sources.list.d/nginx-app-protect.list \ | ||
&& rm -rf /etc/apt/apt.conf.d/90nginx /etc/ssl/nginx | ||
|
||
EXPOSE 80 | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
RUN chmod +x /agent/entrypoint.sh | ||
RUN apt install -y /agent/build/${PACKAGE_NAME}.deb | ||
|
||
STOPSIGNAL SIGTERM | ||
|
||
EXPOSE 80 443 | ||
|
||
ENTRYPOINT ["/agent/entrypoint.sh"] |
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
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 @@ | ||
apiVersion: 1 | ||
|
||
apps: | ||
- type: grafana-lokiexplore-app | ||
org_id: 1 |
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,36 @@ | ||
auth_enabled: false | ||
|
||
limits_config: | ||
allow_structured_metadata: true | ||
volume_enabled: true | ||
|
||
server: | ||
http_listen_port: 3100 | ||
|
||
common: | ||
ring: | ||
instance_addr: 0.0.0.0 | ||
kvstore: | ||
store: inmemory | ||
replication_factor: 1 | ||
path_prefix: /tmp/loki | ||
|
||
schema_config: | ||
configs: | ||
- from: 2020-05-15 | ||
store: tsdb | ||
object_store: filesystem | ||
schema: v13 | ||
index: | ||
prefix: index_ | ||
period: 24h | ||
|
||
storage_config: | ||
tsdb_shipper: | ||
active_index_directory: /tmp/loki/index | ||
cache_location: /tmp/loki/index_cache | ||
filesystem: | ||
directory: /tmp/loki/chunks | ||
|
||
pattern_ingester: | ||
enabled: true |
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,6 +1,6 @@ | ||
FROM golang:bookworm | ||
|
||
WORKDIR /mock-management-plane-collector | ||
COPY ./build/mock-management-plane-collector ./ | ||
WORKDIR /mock-management-otel-collector | ||
COPY ./build/mock-management-otel-collector ./ | ||
|
||
CMD ["/mock-management-plane-collector/collector"] | ||
CMD ["/mock-management-otel-collector/collector"] |
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.