diff --git a/docker/label-bot/Dockerfile b/docker/label-bot/Dockerfile new file mode 100644 index 0000000..0778cd4 --- /dev/null +++ b/docker/label-bot/Dockerfile @@ -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"] \ No newline at end of file diff --git a/k8s-res/label-bot/label-bot.dep.yaml b/k8s-res/label-bot/label-bot.dep.yaml new file mode 100644 index 0000000..604de57 --- /dev/null +++ b/k8s-res/label-bot/label-bot.dep.yaml @@ -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 \ No newline at end of file diff --git a/k8s-res/label-bot/label-bot.svc.yaml b/k8s-res/label-bot/label-bot.svc.yaml new file mode 100644 index 0000000..e229f93 --- /dev/null +++ b/k8s-res/label-bot/label-bot.svc.yaml @@ -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 \ No newline at end of file diff --git a/k8s-res/rule-handler/rule-handler.dep.yaml b/k8s-res/rule-handler/rule-handler.dep.yaml index 609cfae..81a66b5 100644 --- a/k8s-res/rule-handler/rule-handler.dep.yaml +++ b/k8s-res/rule-handler/rule-handler.dep.yaml @@ -36,4 +36,6 @@ spec: value: "INFO" - name: HOST value: "0.0.0.0" + - name: LABEL_BOT_URL + value: "http://label-bot"