Skip to content

Commit 8a37ca7

Browse files
authored
Merge pull request #16 from signadot/add-signadot-virtual-sandbox
fixed Dockerfiles and other fixes to get demo working
2 parents a3540bc + 8df9b74 commit 8a37ca7

File tree

15 files changed

+66
-32
lines changed

15 files changed

+66
-32
lines changed

kubernetes-manifests/adservice.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ spec:
3838
resources:
3939
requests:
4040
cpu: 250m
41-
memory: 180Mi
41+
memory: 256Mi
4242
limits:
4343
cpu: 500m
44-
memory: 300Mi
44+
memory: 512Mi
4545
---
4646
apiVersion: v1
4747
kind: Service

kubernetes-manifests/cartservice.yaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ spec:
2121
ports:
2222
- containerPort: 7070
2323
env:
24+
- name: ASPNETCORE_URLS
25+
value: "http://0.0.0.0:7070"
2426
- name: REDIS_ADDR
2527
value: "redis-cart:6379"
2628
- name: SERVICE_NAME
@@ -36,19 +38,26 @@ spec:
3638
resources:
3739
requests:
3840
cpu: 200m
39-
memory: 64Mi
41+
memory: 128Mi
4042
limits:
4143
cpu: 300m
42-
memory: 128Mi
43-
# readinessProbe:
44-
# initialDelaySeconds: 15
45-
# exec:
46-
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
47-
# livenessProbe:
48-
# initialDelaySeconds: 15
49-
# periodSeconds: 10
50-
# exec:
51-
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
44+
memory: 256Mi
45+
readinessProbe:
46+
initialDelaySeconds: 20
47+
periodSeconds: 10
48+
timeoutSeconds: 10
49+
successThreshold: 1
50+
failureThreshold: 3
51+
exec:
52+
command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s", "-connect-timeout=5s"]
53+
livenessProbe:
54+
initialDelaySeconds: 30
55+
periodSeconds: 30
56+
timeoutSeconds: 10
57+
successThreshold: 1
58+
failureThreshold: 3
59+
exec:
60+
command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s", "-connect-timeout=5s"]
5261
---
5362
apiVersion: v1
5463
kind: Service

sbx-virtual.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "baseline-traffic-rec-arjun"
2+
spec:
3+
cluster: "arjun-docker-desktop"
4+
ttl:
5+
duration: 24h
6+
description: "Recording baseline traffic for microservices demo app"
7+
virtual:
8+
- name: "checkout"
9+
workload:
10+
kind: Deployment
11+
namespace: "default"
12+
name: "checkoutservice"
13+
- name: "cart"
14+
workload:
15+
kind: Deployment
16+
namespace: "default"
17+
name: "cartservice"
18+
- name: "catalog"
19+
workload:
20+
kind: Deployment
21+
namespace: "default"
22+
name: "productcatalogservice"

skaffold.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build:
3131
tagPolicy:
3232
gitCommit: {}
3333
local:
34-
useBuildkit: false
34+
useBuildkit: true
3535
deploy:
3636
kubectl:
3737
manifests:

src/adservice/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:11-slim as builder
1+
FROM eclipse-temurin:11-jdk as builder
22

33
WORKDIR /app
44

@@ -11,7 +11,7 @@ COPY . .
1111
RUN chmod +x gradlew
1212
RUN ./gradlew installDist
1313

14-
FROM openjdk:11-slim
14+
FROM eclipse-temurin:11-jre
1515

1616
RUN apt-get -y update && apt-get install -qqy \
1717
wget \

src/cartservice/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
2-
FROM mcr.microsoft.com/dotnet/sdk:5.0.103 as builder
2+
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:5.0.103 as builder
33
WORKDIR /app
44
COPY cartservice.csproj .
55
RUN dotnet restore cartservice.csproj -r linux-musl-x64
66
COPY . .
77
# Fix the issue on Debian 10: https://github.com/dotnet/dotnet-docker/issues/2470
88
ENV COMPlus_EnableDiagnostics=0
9+
# Fix for Google.Protobuf.Tools detection in Docker
10+
ENV PROTOBUF_TOOLS_OS=linux
11+
ENV PROTOBUF_TOOLS_CPU=x64
912
RUN dotnet publish cartservice.csproj -p:PublishSingleFile=true -r linux-musl-x64 --self-contained true -p:PublishTrimmed=True -p:TrimMode=Link -c release -o /cartservice --no-restore
1013

1114
# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
12-
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0.3-alpine3.12-amd64
15+
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/runtime-deps:5.0.3-alpine3.12-amd64
1316
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 && \
1417
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
1518
chmod +x /bin/grpc_health_probe
1619
WORKDIR /app
1720
COPY --from=builder /cartservice .
18-
ENV ASPNETCORE_URLS http://*:7070
21+
ENV ASPNETCORE_URLS http://0.0.0.0:7070
1922
ENTRYPOINT ["/app/cartservice"]

src/checkoutservice/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17-alpine as builder
1+
FROM --platform=linux/amd64 golang:1.17-alpine as builder
22
RUN apk add --no-cache ca-certificates git
33
WORKDIR /src
44

@@ -9,7 +9,7 @@ RUN go mod download
99
COPY . .
1010
RUN go build -gcflags='-N -l' -o /checkoutservice .
1111

12-
FROM alpine as release
12+
FROM --platform=linux/amd64 alpine as release
1313
RUN apk add --no-cache ca-certificates
1414
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 && \
1515
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \

src/currencyservice/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12-alpine as base
1+
FROM --platform=linux/amd64 node:12-alpine as base
22

33
FROM base as builder
44

src/emailservice/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7-slim as base
1+
FROM --platform=linux/amd64 python:3.7-slim as base
22

33
FROM base as builder
44

src/frontend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17-alpine as builder
1+
FROM --platform=linux/amd64 golang:1.17-alpine as builder
22
RUN apk add --no-cache ca-certificates git
33
WORKDIR /src
44

@@ -8,7 +8,7 @@ RUN go mod download
88
COPY . .
99
RUN go build -o /go/bin/frontend .
1010

11-
FROM alpine as release
11+
FROM --platform=linux/amd64 alpine as release
1212
RUN apk add --no-cache ca-certificates \
1313
busybox-extras net-tools bind-tools
1414
WORKDIR /frontend

0 commit comments

Comments
 (0)