build: add dockerfile and k8s manifests

This commit is contained in:
Artem Mezentsev 2025-04-13 13:15:46 +03:00
parent dd56d52807
commit c6de46b8dc
4 changed files with 57 additions and 0 deletions

13
deploy/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY ./ .
RUN go build -o metrics-counter .
# Runtime stage
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/metrics-counter .
EXPOSE 8080
CMD ["./metrics-counter"]

View File

@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: metrics-counter
namespace: metrics-counter
spec:
replicas: 1
selector:
matchLabels:
app: metrics-counter
template:
metadata:
labels:
app: metrics-counter
spec:
containers:
- name: metrics-counter
image: docker.io/sigthror/metrics-counter:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: metrics-counter

12
deploy/k8s/service.yaml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: metrics-counter
namespace: metrics-counter
spec:
selector:
app: metrics-counter
ports:
- protocol: TCP
port: 8080
targetPort: 8080