-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkubernetes-deployment.yaml
More file actions
86 lines (86 loc) · 2.29 KB
/
kubernetes-deployment.yaml
File metadata and controls
86 lines (86 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Example: Kubernetes Deployment with Dapr sidecar
# Update the image and namespace as needed.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-go-app
namespace: default
labels:
app: example-go-app
spec:
replicas: 1
selector:
matchLabels:
app: example-go-app
template:
metadata:
labels:
app: example-go-app
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "example-go-app"
dapr.io/app-port: "8080"
dapr.io/enable-api-logging: "true"
spec:
containers:
- name: example-go-app
image: ghcr.io/miguelmartens/example-go-dapr-otel:latest
ports:
- containerPort: 8080
name: http
env:
- name: APP_PORT
value: "8080"
- name: STATESTORE_NAME
value: "statestore"
# Optional: OpenTelemetry (Grafana Tempo, Datadog, etc.)
# - name: OTEL_EXPORTER_OTLP_ENDPOINT
# value: "http://otel-collector:4318"
# - name: OTEL_SERVICE_NAME
# value: "example-go-app"
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 500m
memory: 128Mi
# Startup: allow up to 60s for app + Dapr sidecar to initialize
startupProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 12
timeoutSeconds: 3
# Readiness: remove from Service when not ready to accept traffic
readinessProbe:
httpGet:
path: /readyz
port: http
periodSeconds: 5
failureThreshold: 3
timeoutSeconds: 3
# Liveness: restart container when unrecoverable; higher failureThreshold than readiness
livenessProbe:
httpGet:
path: /livez
port: http
periodSeconds: 10
failureThreshold: 6
timeoutSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
name: example-go-app
namespace: default
spec:
selector:
app: example-go-app
ports:
- port: 80
targetPort: 8080
name: http