Skip to content
Merged
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
7 changes: 4 additions & 3 deletions k8s-manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export REGISTRY_URL=localhost:5000
> Building and pushing containers to the local registry needs to be done on the worker node.

```bash
docker build -t $REGISTRY_URL/backend:latest ./services/backend && docker push $REGISTRY_URL/backend:latest
SERVICE_NAME=ads
docker build -t $REGISTRY_URL/$SERVICE_NAME:latest ./services/$SERVICE_NAME && docker push $REGISTRY_URL/$SERVICE_NAME:latest
```

## Prerequisites
Expand Down Expand Up @@ -140,7 +141,7 @@ export SD_TAG=1.4.0
export DD_VERSION_ADS=1.0.0
export DD_VERSION_BACKEND=1.0.0
export DD_VERSION_DISCOUNTS=1.0.0
export DD_VERSION_NGINX=1.0.0
export DD_VERSION_NGINX=1.28.0
export NEXT_PUBLIC_DD_SERVICE_FRONTEND=store-frontend
export NEXT_PUBLIC_DD_VERSION_FRONTEND=1.0.0
export DD_ENV=development
Expand Down Expand Up @@ -174,7 +175,7 @@ The storedog-app definition files contain variables which need to be set before

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

This single command installs the storage provisioner and the ingress controller.
Install the storage provisioner and the ingress controller.

```bash
kubectl apply -R -f k8s-manifests/cluster-setup/
Expand Down
34 changes: 34 additions & 0 deletions k8s-manifests/storedog-app/configmaps/feature-flags-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: feature-flags-config
labels:
app: frontend
managed-by: storedog
purpose: feature-flags
environment: development
tier: application
data:
featureFlags.config.json: |
[
{
"id": "1",
"name": "dbm",
"active": false
},
{
"id": "2",
"name": "error-tracking",
"active": false
},
{
"id": "3",
"name": "api-errors",
"active": false
},
{
"id": "4",
"name": "product-card-frustration",
"active": false
}
]
3 changes: 1 addition & 2 deletions k8s-manifests/storedog-app/deployments/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
labels:
app: backend
annotations:
ad.datadoghq.com/backend.logs: '[{"source": "ruby"}, "auto_multi_line_detection":true }]'
ad.datadoghq.com/backend.logs: '[{"source": "ruby", "auto_multi_line_detection":true}]'
spec:
volumes:
- name: apmsocketpath
Expand All @@ -39,7 +39,6 @@ spec:
image: ${REGISTRY_URL}/backend:${SD_TAG}
ports:
- containerPort: 4000
command: ["bundle", "exec", "rails", "s", "-b", "0.0.0.0", "-p", "4000"]
env:
- name: REDIS_URL
valueFrom:
Expand Down
3 changes: 2 additions & 1 deletion k8s-manifests/storedog-app/deployments/discounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ spec:
image: ${REGISTRY_URL}/discounts:${SD_TAG}
ports:
- containerPort: 2814
command: ["ddtrace-run", "flask", "run", "--port=2814", "--host=0.0.0.0"]
env:
- name: FLASK_APP
value: "discounts.py"
- name: DISCOUNTS_PORT
value: "2814"
- name: FLASK_DEBUG
value: "0"
- name: POSTGRES_PASSWORD
Expand Down
6 changes: 6 additions & 0 deletions k8s-manifests/storedog-app/deployments/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
- name: apmsocketpath
hostPath:
path: /var/run/datadog/
- name: feature-flags-config
configMap:
name: feature-flags-config
initContainers:
- name: wait-for-backend
image: busybox
Expand Down Expand Up @@ -106,6 +109,9 @@ spec:
volumeMounts:
- name: apmsocketpath
mountPath: /var/run/datadog
- name: feature-flags-config
mountPath: /app/featureFlags.config.json
subPath: featureFlags.config.json
livenessProbe:
httpGet:
path: /
Expand Down
4 changes: 2 additions & 2 deletions k8s-manifests/storedog-app/deployments/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ spec:
tags.datadoghq.com/service: service-proxy
tags.datadoghq.com/version: 1.28.0
annotations:
ad.datadoghq.com/nginx.logs: '[{"source": "nginx"}]'
ad.datadoghq.com/nginx.checks: |
ad.datadoghq.com/service-proxy.logs: '[{"source": "nginx"}]'
ad.datadoghq.com/service-proxy.checks: |
{
"nginx": {
"init_config": {},
Expand Down
2 changes: 1 addition & 1 deletion k8s-manifests/storedog-app/deployments/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
labels:
app: worker
annotations:
ad.datadoghq.com/worker.logs: '[{"source": "ruby"}, "auto_multi_line_detection":true }]'
ad.datadoghq.com/worker.logs: '[{"source": "ruby", "auto_multi_line_detection":true}]'
spec:
volumes:
- name: apmsocketpath
Expand Down
1 change: 0 additions & 1 deletion k8s-manifests/storedog-app/ingress/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: storedog-ingress
namespace: storedog
spec:
ingressClassName: nginx
# All traffic that doesn't match a more specific rule below will
Expand Down
10 changes: 3 additions & 7 deletions k8s-manifests/storedog-app/statefulsets/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kind: StatefulSet
metadata:
name: postgres
labels:
tags.datadoghq.com/env: ${DD_ENV}
tags.datadoghq.com/service: store-db
tags.datadoghq.com/version: "15.0"
spec:
Expand All @@ -27,16 +28,11 @@ spec:
metadata:
labels:
app: postgres
tags.datadoghq.com/env: ${DD_ENV}
tags.datadoghq.com/service: store-db
tags.datadoghq.com/version: "15.0"
annotations:
ad.datadoghq.com/postgres.logs: |
{
"source": "postgresql",
"auto_multi_line_detection":true,
"path": "/var/log/pg_log/postgresql*.json",
"type": "file"
}
ad.datadoghq.com/postgres.logs: '[{"source": "postgresql", "auto_multi_line_detection":true}]'
ad.datadoghq.com/postgres.checks: |
{
"postgres": {
Expand Down
2 changes: 2 additions & 0 deletions k8s-manifests/storedog-app/statefulsets/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ kind: StatefulSet
metadata:
name: redis
labels:
tags.datadoghq.com/env: ${DD_ENV}
tags.datadoghq.com/service: redis
tags.datadoghq.com/version: "6.2"
spec:
Expand All @@ -27,6 +28,7 @@ spec:
metadata:
labels:
app: redis
tags.datadoghq.com/env: ${DD_ENV}
tags.datadoghq.com/service: redis
tags.datadoghq.com/version: "6.2"
annotations:
Expand Down