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 or modify Dockerfile and k8s YAML for label-bot and rule-handler #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions docker/label-bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine/git:v2.32.0
RUN git clone https://github.com/TECH4DX/label-bot.git /label-bot

FROM golang:alpine
WORKDIR /app
#COPY ./event-retriever/ ./
COPY --from=0 /label-bot ./
RUN go mod download
RUN go build -o label_bot src/server.go


FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY --from=1 /app ./
CMD ["./label_bot"]
41 changes: 41 additions & 0 deletions k8s-res/label-bot/label-bot.dep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: label-bot
spec:
selector:
matchLabels:
app: label-bot
replicas: 1 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: label-bot
spec:
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: workingnode
# operator: In
# values: ["true"]
containers:
- name: label-bot
image: quzicheng/label-bot:1.0
imagePullPolicy: Always
ports:
- containerPort: 8003
env:
- name: api_url
value: "http://data-cache/api/dataCache/pushGiteeIssue"
volumeMounts:
- name: log-volume
#mountPropagation: "Bidirectional"
mountPath: "/app/src/log/"

volumes:
- name: log-volume
hostPath:
path: /event-platform-nfs/prod/label-bot-log
type: DirectoryOrCreate
18 changes: 18 additions & 0 deletions k8s-res/label-bot/label-bot.svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: label-bot
labels:
run: label-bot
spec:
ports:
- port: 9001
targetPort: 8003
nodePort: 9105
protocol: TCP
externalIPs: []
type: NodePort

selector:
app: label-bot
#run: issue-retriever
2 changes: 2 additions & 0 deletions k8s-res/rule-handler/rule-handler.dep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ spec:
value: "INFO"
- name: HOST
value: "0.0.0.0"
- name: LABEL_BOT_URL
value: "http://label-bot"