Skip to content

Commit

Permalink
add k8s.yml / switch to lgtm-stack
Browse files Browse the repository at this point in the history
switch to lgtm stack / add k8s
  • Loading branch information
led0nk committed May 10, 2024
1 parent e674d4e commit 14476fe
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 36 deletions.
105 changes: 105 additions & 0 deletions guestbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"name":"guestbook-demo","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"guestbook-demo"}},"template":{"metadata":{"labels":{"app":"guestbook-demo"}},"spec":{"containers":[{"args":["/guestbook","-addr","0.0.0.0:80","-grpcaddr","lgtm-service.observability:4317","-domain","test.k8s.klimlive.de"],"image":"ghcr.io/led0nk/guestbook:latest","imagePullPolicy":"Always","name":"nginx","ports":[{"containerPort":80}],"volumeMounts":[{"mountPath":"/testdata","name":"testdata-volume"},{"mountPath":"/etc/ssl/certs/ca-certificates.crt","name":"ca-certificates","readOnly":true}]}],"initContainers":[{"command":["/bin/sh","-c","echo '{}' \u003e /testdata/entries.json \u0026\u0026 echo '{}' \u003e /testdata/user.json \u0026\u0026 echo 'EMAIL=\"[email protected]\"\nSMTPPW=\"qnkx ndoi vmom ezvo\"\nHOST=\"smtp.gmail.com\"\nPORT=\"587\"\nTOKENSECRET=\"secret\"' \u003e /testdata/.env"],"image":"busybox:1.32","name":"create-files","volumeMounts":[{"mountPath":"/testdata","name":"testdata-volume"}]}],"volumes":[{"emptyDir":{},"name":"testdata-volume"},{"hostPath":{"path":"/etc/ssl/certs/ca-certificates.crt"},"name":"ca-certificates"}]}}}}
creationTimestamp: "2024-05-10T19:50:39Z"
generation: 1
name: guestbook-demo
namespace: default
resourceVersion: "1366"
uid: da0f4fa2-49ca-40c4-a76d-209f07268b8f
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: guestbook-demo
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: guestbook-demo
spec:
containers:
- args:
- /guestbook
- -addr
- 0.0.0.0:80
- -grpcaddr
- lgtm-service.observability:4317
- -domain
- test.k8s.klimlive.de
image: ghcr.io/led0nk/guestbook:latest
imagePullPolicy: Always
name: nginx
ports:
- containerPort: 80
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /testdata
name: testdata-volume
- mountPath: /etc/ssl/certs/ca-certificates.crt
name: ca-certificates
readOnly: true
dnsPolicy: ClusterFirst
initContainers:
- command:
- /bin/sh
- -c
- |-
echo '{}' > /testdata/entries.json && echo '{}' > /testdata/user.json && echo 'EMAIL="[email protected]"
SMTPPW="qnkx ndoi vmom ezvo"
HOST="smtp.gmail.com"
PORT="587"
TOKENSECRET="secret"' > /testdata/.env
image: busybox:1.32
imagePullPolicy: IfNotPresent
name: create-files
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /testdata
name: testdata-volume
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir: {}
name: testdata-volume
- hostPath:
path: /etc/ssl/certs/ca-certificates.crt
type: ""
name: ca-certificates
status:
availableReplicas: 1
conditions:
- lastTransitionTime: "2024-05-10T19:50:42Z"
lastUpdateTime: "2024-05-10T19:50:42Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2024-05-10T19:50:39Z"
lastUpdateTime: "2024-05-10T19:50:42Z"
message: ReplicaSet "guestbook-demo-6fdffc7f49" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 1
readyReplicas: 1
replicas: 1
updatedReplicas: 1
49 changes: 13 additions & 36 deletions monitoring/podman-compose.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
version: "3.5"
services:
# Jaeger Tracing for traces
jaeger:
grafana:
networks:
- backend
image: jaegertracing/all-in-one:latest
volumes:
- "./jaeger-ui.json:/etc/jaeger/jaeger-ui.json:Z"
environment:
- COLECTOR_OTLP_ENABLED=true
- LOG_LEVEL=debug
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
ports:
- "16686:16686" # Jaeger UI
- "14250:14250"
command: --query.ui-config /etc/jaeger/jaeger-ui.json

otel_collector:
networks:
- backend
image: otel/opentelemetry-collector-contrib:latest
volumes:
- "./otel-collector-config.yml:/etc/otelcol/otel-collector-config.yml:Z"
command: --config /etc/otelcol/otel-collector-config.yml
image: grafana/otel-lgtm
ports:
- "14278:14278"
- "4317:4317"
- "4318:4318"
depends_on:
- jaeger

# Prometheus Service for metrics
prometheus:
- "127.0.0.1:3000:3000"
- "127.0.0.1:4317:4317"
- "127.0.0.1:4318:4318"
guestbook:
networks:
- backend
image: prom/prometheus
image: ghcr.io/led0nk/guestbook:latest
command: /guestbook -addr=0.0.0.0:8080 -grpcaddr=grafana:4317
ports:
- "9090:9090" # Prometheus server
- "127.0.0.1:8080:8080"
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml:Z"
command:
- "--enable-feature=otlp-write-receiver"
- "--config.file=/etc/prometheus/prometheus.yml"
- "./../testdata:/testdata:Z"

networks:
backend:

volumes:
configs:

0 comments on commit 14476fe

Please sign in to comment.