Skip to content
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
11 changes: 0 additions & 11 deletions Dockerfile → images/products.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM golang:1.24 AS builder

# Set destination for COPY
WORKDIR /

# Copy the source code
COPY ./internal ./internal

Expand All @@ -24,13 +23,3 @@ RUN apk --no-cache add ca-certificates

# Copy the binary from the build stage
COPY --from=builder /products /products
COPY ./internal/services/products/conf/config.development.json ./config.development.json

# Expose the port
EXPOSE 8080

# Set environment variable
ENV CONFIG_PATH=./

# Run
CMD ["/products"]
Binary file added infra/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes
File renamed without changes
25 changes: 12 additions & 13 deletions docker-compose.yml → infra/monitoring/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
ports:
- "3100:3100"
volumes:
- ./monitoring/grafana/loki-config.yaml:/etc/loki/loki-config.yaml
- ./grafana/loki-config.yaml:/etc/loki/loki-config.yaml
command: -config.file=/etc/loki/loki-config.yaml

# Grafana (Visualization)
Expand All @@ -39,7 +39,7 @@ services:
volumes:
- grafana-storage:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin # Default Grafana password
- GF_SECURITY_ADMIN_PASSWORD=admin # Default Grafana password
depends_on:
- loki
- prometheus
Expand All @@ -59,14 +59,14 @@ services:
restart: always
command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"]
volumes:
- ./monitoring/telementry/otel-collector-config.yaml:/etc/otel-collector-config.yaml
- ./telementry/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "55679:55679" # zpages extension
depends_on:
- jaeger-all-in-one
Expand All @@ -76,7 +76,7 @@ services:
image: prom/prometheus:latest
restart: always
volumes:
- ./monitoring/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"

Expand All @@ -85,7 +85,7 @@ services:
container_name: consul-server
restart: always
volumes:
- ./monitoring/discovery/server.json:/consul/config/server.json:ro
- ./discovery/server.json:/consul/config/server.json:ro
# networks:
# - consul
ports:
Expand All @@ -99,7 +99,7 @@ services:
container_name: consul-client
restart: always
volumes:
- ./monitoring/discovery/client.json:/consul/config/client.json:ro
- ./discovery/client.json:/consul/config/client.json:ro
# networks:
# - consul
command: "agent"
Expand All @@ -108,7 +108,6 @@ volumes:
postgres_data:
mysql_data:
grafana-storage:

# networks:
# consul:
# driver: bridge
# driver: bridge
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
257 changes: 257 additions & 0 deletions infra/monitoring/kubernetes/monitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# ------------------------------------------------
# ADMINER
# ------------------------------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: adminer
spec:
replicas: 1
selector:
matchLabels:
app: adminer
template:
metadata:
labels:
app: adminer
spec:
containers:
- name: adminer
image: adminer
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
env:
- name: ADMINER_DEFAULT_SERVER
value: mysql
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: adminer-service
spec:
ports:
- port: 8080
targetPort: 8080
nodePort: 30003
selector:
app: adminer
type: NodePort
---
# ------------------------------------------------
# ADMINER
# ------------------------------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: loki
spec:
replicas: 1
selector:
matchLabels:
app: loki
template:
metadata:
labels:
app: loki
spec:
containers:
- name: loki
image: grafana/loki:latest
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
args: ["-config.file=/etc/loki/loki-config.yaml"]
ports:
- containerPort: 3100
volumeMounts:
- name: loki-config
mountPath: /etc/loki/
volumes:
- name: loki-config
hostPath:
path: ./monitoring/grafana/loki-config.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
spec:
replicas: 1
selector:
matchLabels:
app: grafana
template:
metadata:
labels:
app: grafana
spec:
containers:
- name: grafana
image: grafana/grafana:latest
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
env:
- name: GF_SECURITY_ADMIN_PASSWORD
value: "admin"
ports:
- containerPort: 3000
volumeMounts:
- name: grafana-storage
mountPath: /var/lib/grafana
volumes:
- name: grafana-storage
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: grafana-service
spec:
ports:
- port: 3000
targetPort: 3000
selector:
app: grafana
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
spec:
replicas: 1
selector:
matchLabels:
app: jaeger
template:
metadata:
labels:
app: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/all-in-one:latest
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
ports:
- containerPort: 16686
- containerPort: 14268
- containerPort: 14250
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
containers:
- name: prometheus
image: prom/prometheus:latest
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config
mountPath: /etc/prometheus/
volumes:
- name: prometheus-config
hostPath:
path: ./monitoring/prometheus/prometheus.yaml
---
apiVersion: v1
kind: Service
metadata:
name: prometheus-service
spec:
ports:
- port: 9090
targetPort: 9090
selector:
app: prometheus

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
spec:
replicas: 1
selector:
matchLabels:
app: otel-collector
template:
metadata:
labels:
app: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector:latest
resources:
limits:
memory: "1Gi"
cpu: "300m"
requests:
memory: "1Gi"
cpu: "250m"
args: ["--config=/etc/otel-collector-config.yaml"]
ports:
- containerPort: 4317
- containerPort: 4318
volumeMounts:
- name: otel-config
mountPath: /etc/otel-collector/
volumes:
- name: otel-config
hostPath:
path: ./monitoring/telementry/otel-collector-config.yaml
---
apiVersion: v1
kind: Service
metadata:
name: otel-collector-service
spec:
ports:
- name: grpc
port: 4317
targetPort: 4317
- name: http
port: 4318
targetPort: 4318
selector:
app: otel-collector
Loading