-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathk8s-web-service.yaml
109 lines (109 loc) · 2.89 KB
/
k8s-web-service.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: drawtogether-localhost
annotations:
kubernetes.io/ingress.class: "nginx" # Updated annotation
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"
spec:
rules:
- host: drawtogether.localdev.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: drawtogether
port:
number: 8080
---
apiVersion: v1
kind: Service
metadata:
name: drawtogether
labels:
app: drawtogether
spec:
publishNotReadyAddresses: true
clusterIP: None
ports:
- port: 8558
name: management
- port: 5055
name: akka-remote
- port: 8080
name: http
selector:
app: drawtogether
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: drawtogether
labels:
app: drawtogether
spec:
serviceName: drawtogether
replicas: 3
selector:
matchLabels:
app: drawtogether
template:
metadata:
labels:
app: drawtogether
cluster: drawtogether
spec:
terminationGracePeriodSeconds: 35
containers:
- name: pbm-sidecar
image: petabridge/pbm:latest #sidecar
- name: drawtogether-app
image: drawtogether-app:0.2.2
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: ConnectionStrings__DefaultConnection
value: "Server=sqlserver,1644; Database=DrawTogether; User Id=sa; Password=yourStrong(!)Password; TrustServerCertificate=true;"
- name: AkkaSettings__RemoteOptions__Port
value: "5055"
- name: AkkaSettings__RemoteOptions__PublicHostname
value: "$(POD_NAME).drawtogether"
- name: AkkaSettings__AkkaManagementOptions__Enabled
value: "true"
- name: AkkaSettings__AkkaManagementOptions__DiscoveryMethod
value: "Kubernetes"
- name: ASPNETCORE_ENVIRONMENT
value: "Production"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://$(NODE_IP):4317"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "service.namespace=$(NAMESPACE),service.instance.id=$(POD_NAME)"
- name: OTEL_SERVICE_NAME
value: "drawtogether"
readinessProbe:
tcpSocket:
port: 8080
ports:
- containerPort: 8558
protocol: TCP
name: management
- containerPort: 5055
protocol: TCP
name: akka-remote
- containerPort: 8080
protocol: TCP
name: http