Skip to content
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

add adapter sink #51

Merged
merged 3 commits into from
Dec 3, 2020
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
27 changes: 27 additions & 0 deletions adapter/sink/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

FROM golang:1.13 as notification-adapter

COPY cmd/main.go /
COPY cmd/types.go /
WORKDIR /
ENV GOPROXY=https://goproxy.io
RUN CGO_ENABLED=0 GO111MODULE=on go build -i -ldflags '-w -s' -o notification-adapter main.go types.go

FROM alpine:3.9

COPY --from=notification-adapter /notification-adapter /usr/local/bin/
wanjunlei marked this conversation as resolved.
Show resolved Hide resolved

RUN adduser -D -g kubesphere -u 1002 kubesphere && \
chown -R kubesphere:kubesphere /usr/local/bin/notification-adapter && \
apk add libcap && \
setcap 'CAP_NET_BIND_SERVICE=+ep' /usr/local/bin/notification-adapter

USER kubesphere
CMD ["sh"]
24 changes: 24 additions & 0 deletions adapter/sink/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2018 The KubeSphere Authors. All rights reserved.
# Use of this source code is governed by a Apache license
# that can be found in the LICENSE file.

IMG ?= kubespheredev/notification-adapter:v0.1.0
AMD64 ?= -amd64

all: docker-build

# Build kube-audit-operator binary
notification-adapter:
go build -o notification-adapter cmd/main.go

# Build the docker image
docker-build:
docker buildx build --platform linux/amd64,linux/arm64 --push -f Dockerfile -t ${IMG} .

# Build the docker image for arm64
docker-build-amd64:
docker build -f Dockerfile -t ${IMG}${AMD64} .

# Push the docker image
push-amd64:
docker push ${IMG}${AMD64}
3 changes: 3 additions & 0 deletions adapter/sink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# notification-adapter

Notification-adapter receive notifications from notifcation manager and export with the socket.
Copy link
Member

Choose a reason for hiding this comment

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

=> and then send it to a TCP endpoint.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can add more instructions here on how to use it together with the Notification Manager?

Loading