Skip to content

Commit 3801295

Browse files
authored
Merge pull request #97 from DataDog/k8s-manifest-updates
K8s manifest updates
2 parents 587e79b + 3115013 commit 3801295

10 files changed

Lines changed: 55 additions & 17 deletions

File tree

k8s-manifests/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export REGISTRY_URL=localhost:5000
8282
> Building and pushing containers to the local registry needs to be done on the worker node.
8383
8484
```bash
85-
docker build -t $REGISTRY_URL/backend:latest ./services/backend && docker push $REGISTRY_URL/backend:latest
85+
SERVICE_NAME=ads
86+
docker build -t $REGISTRY_URL/$SERVICE_NAME:latest ./services/$SERVICE_NAME && docker push $REGISTRY_URL/$SERVICE_NAME:latest
8687
```
8788

8889
## Prerequisites
@@ -140,7 +141,7 @@ export SD_TAG=1.4.0
140141
export DD_VERSION_ADS=1.0.0
141142
export DD_VERSION_BACKEND=1.0.0
142143
export DD_VERSION_DISCOUNTS=1.0.0
143-
export DD_VERSION_NGINX=1.0.0
144+
export DD_VERSION_NGINX=1.28.0
144145
export NEXT_PUBLIC_DD_SERVICE_FRONTEND=store-frontend
145146
export NEXT_PUBLIC_DD_VERSION_FRONTEND=1.0.0
146147
export DD_ENV=development
@@ -174,7 +175,7 @@ The storedog-app definition files contain variables which need to be set before
174175

175176
1. **Deploy Cluster Components (one-time setup per cluster):**
176177

177-
This single command installs the storage provisioner and the ingress controller.
178+
Install the storage provisioner and the ingress controller.
178179

179180
```bash
180181
kubectl apply -R -f k8s-manifests/cluster-setup/
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: feature-flags-config
5+
labels:
6+
app: frontend
7+
managed-by: storedog
8+
purpose: feature-flags
9+
environment: development
10+
tier: application
11+
data:
12+
featureFlags.config.json: |
13+
[
14+
{
15+
"id": "1",
16+
"name": "dbm",
17+
"active": false
18+
},
19+
{
20+
"id": "2",
21+
"name": "error-tracking",
22+
"active": false
23+
},
24+
{
25+
"id": "3",
26+
"name": "api-errors",
27+
"active": false
28+
},
29+
{
30+
"id": "4",
31+
"name": "product-card-frustration",
32+
"active": false
33+
}
34+
]

k8s-manifests/storedog-app/deployments/backend.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
labels:
2525
app: backend
2626
annotations:
27-
ad.datadoghq.com/backend.logs: '[{"source": "ruby"}, "auto_multi_line_detection":true }]'
27+
ad.datadoghq.com/backend.logs: '[{"source": "ruby", "auto_multi_line_detection":true}]'
2828
spec:
2929
volumes:
3030
- name: apmsocketpath
@@ -39,7 +39,6 @@ spec:
3939
image: ${REGISTRY_URL}/backend:${SD_TAG}
4040
ports:
4141
- containerPort: 4000
42-
command: ["bundle", "exec", "rails", "s", "-b", "0.0.0.0", "-p", "4000"]
4342
env:
4443
- name: REDIS_URL
4544
valueFrom:

k8s-manifests/storedog-app/deployments/discounts.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ spec:
3939
image: ${REGISTRY_URL}/discounts:${SD_TAG}
4040
ports:
4141
- containerPort: 2814
42-
command: ["ddtrace-run", "flask", "run", "--port=2814", "--host=0.0.0.0"]
4342
env:
4443
- name: FLASK_APP
4544
value: "discounts.py"
45+
- name: DISCOUNTS_PORT
46+
value: "2814"
4647
- name: FLASK_DEBUG
4748
value: "0"
4849
- name: POSTGRES_PASSWORD

k8s-manifests/storedog-app/deployments/frontend.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
- name: apmsocketpath
3131
hostPath:
3232
path: /var/run/datadog/
33+
- name: feature-flags-config
34+
configMap:
35+
name: feature-flags-config
3336
initContainers:
3437
- name: wait-for-backend
3538
image: busybox
@@ -106,6 +109,9 @@ spec:
106109
volumeMounts:
107110
- name: apmsocketpath
108111
mountPath: /var/run/datadog
112+
- name: feature-flags-config
113+
mountPath: /app/featureFlags.config.json
114+
subPath: featureFlags.config.json
109115
livenessProbe:
110116
httpGet:
111117
path: /

k8s-manifests/storedog-app/deployments/nginx.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ spec:
3030
tags.datadoghq.com/service: service-proxy
3131
tags.datadoghq.com/version: 1.28.0
3232
annotations:
33-
ad.datadoghq.com/nginx.logs: '[{"source": "nginx"}]'
34-
ad.datadoghq.com/nginx.checks: |
33+
ad.datadoghq.com/service-proxy.logs: '[{"source": "nginx"}]'
34+
ad.datadoghq.com/service-proxy.checks: |
3535
{
3636
"nginx": {
3737
"init_config": {},

k8s-manifests/storedog-app/deployments/worker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
labels:
1313
app: worker
1414
annotations:
15-
ad.datadoghq.com/worker.logs: '[{"source": "ruby"}, "auto_multi_line_detection":true }]'
15+
ad.datadoghq.com/worker.logs: '[{"source": "ruby", "auto_multi_line_detection":true}]'
1616
spec:
1717
volumes:
1818
- name: apmsocketpath

k8s-manifests/storedog-app/ingress/nginx-ingress.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
name: storedog-ingress
5-
namespace: storedog
65
spec:
76
ingressClassName: nginx
87
# All traffic that doesn't match a more specific rule below will

k8s-manifests/storedog-app/statefulsets/postgres.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ kind: StatefulSet
1515
metadata:
1616
name: postgres
1717
labels:
18+
tags.datadoghq.com/env: ${DD_ENV}
1819
tags.datadoghq.com/service: store-db
1920
tags.datadoghq.com/version: "15.0"
2021
spec:
@@ -27,16 +28,11 @@ spec:
2728
metadata:
2829
labels:
2930
app: postgres
31+
tags.datadoghq.com/env: ${DD_ENV}
3032
tags.datadoghq.com/service: store-db
3133
tags.datadoghq.com/version: "15.0"
3234
annotations:
33-
ad.datadoghq.com/postgres.logs: |
34-
{
35-
"source": "postgresql",
36-
"auto_multi_line_detection":true,
37-
"path": "/var/log/pg_log/postgresql*.json",
38-
"type": "file"
39-
}
35+
ad.datadoghq.com/postgres.logs: '[{"source": "postgresql", "auto_multi_line_detection":true}]'
4036
ad.datadoghq.com/postgres.checks: |
4137
{
4238
"postgres": {

k8s-manifests/storedog-app/statefulsets/redis.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ kind: StatefulSet
1515
metadata:
1616
name: redis
1717
labels:
18+
tags.datadoghq.com/env: ${DD_ENV}
1819
tags.datadoghq.com/service: redis
1920
tags.datadoghq.com/version: "6.2"
2021
spec:
@@ -27,6 +28,7 @@ spec:
2728
metadata:
2829
labels:
2930
app: redis
31+
tags.datadoghq.com/env: ${DD_ENV}
3032
tags.datadoghq.com/service: redis
3133
tags.datadoghq.com/version: "6.2"
3234
annotations:

0 commit comments

Comments
 (0)