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
4 changes: 2 additions & 2 deletions kubernetes-manifests/adservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ spec:
resources:
requests:
cpu: 250m
memory: 180Mi
memory: 256Mi
limits:
cpu: 500m
memory: 300Mi
memory: 512Mi
---
apiVersion: v1
kind: Service
Expand Down
31 changes: 20 additions & 11 deletions kubernetes-manifests/cartservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
ports:
- containerPort: 7070
env:
- name: ASPNETCORE_URLS
value: "http://0.0.0.0:7070"
- name: REDIS_ADDR
value: "redis-cart:6379"
- name: SERVICE_NAME
Expand All @@ -36,19 +38,26 @@ spec:
resources:
requests:
cpu: 200m
memory: 64Mi
memory: 128Mi
limits:
cpu: 300m
memory: 128Mi
# readinessProbe:
# initialDelaySeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
# livenessProbe:
# initialDelaySeconds: 15
# periodSeconds: 10
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
memory: 256Mi
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
exec:
command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s", "-connect-timeout=5s"]
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
exec:
command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s", "-connect-timeout=5s"]
---
apiVersion: v1
kind: Service
Expand Down
22 changes: 22 additions & 0 deletions sbx-virtual.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "baseline-traffic-rec-arjun"
spec:
cluster: "arjun-docker-desktop"
ttl:
duration: 24h
description: "Recording baseline traffic for microservices demo app"
virtual:
- name: "checkout"
workload:
kind: Deployment
namespace: "default"
name: "checkoutservice"
- name: "cart"
workload:
kind: Deployment
namespace: "default"
name: "cartservice"
- name: "catalog"
workload:
kind: Deployment
namespace: "default"
name: "productcatalogservice"
2 changes: 1 addition & 1 deletion skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build:
tagPolicy:
gitCommit: {}
local:
useBuildkit: false
useBuildkit: true
deploy:
kubectl:
manifests:
Expand Down
4 changes: 2 additions & 2 deletions src/adservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11-slim as builder
FROM eclipse-temurin:11-jdk as builder

WORKDIR /app

Expand All @@ -11,7 +11,7 @@ COPY . .
RUN chmod +x gradlew
RUN ./gradlew installDist

FROM openjdk:11-slim
FROM eclipse-temurin:11-jre

RUN apt-get -y update && apt-get install -qqy \
wget \
Expand Down
9 changes: 6 additions & 3 deletions src/cartservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
FROM mcr.microsoft.com/dotnet/sdk:5.0.103 as builder
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:5.0.103 as builder
WORKDIR /app
COPY cartservice.csproj .
RUN dotnet restore cartservice.csproj -r linux-musl-x64
COPY . .
# Fix the issue on Debian 10: https://github.com/dotnet/dotnet-docker/issues/2470
ENV COMPlus_EnableDiagnostics=0
# Fix for Google.Protobuf.Tools detection in Docker
ENV PROTOBUF_TOOLS_OS=linux
ENV PROTOBUF_TOOLS_CPU=x64
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

# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0.3-alpine3.12-amd64
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/runtime-deps:5.0.3-alpine3.12-amd64
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 && \
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 && \
chmod +x /bin/grpc_health_probe
WORKDIR /app
COPY --from=builder /cartservice .
ENV ASPNETCORE_URLS http://*:7070
ENV ASPNETCORE_URLS http://0.0.0.0:7070
ENTRYPOINT ["/app/cartservice"]
4 changes: 2 additions & 2 deletions src/checkoutservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as builder
FROM --platform=linux/amd64 golang:1.17-alpine as builder
RUN apk add --no-cache ca-certificates git
WORKDIR /src

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

FROM alpine as release
FROM --platform=linux/amd64 alpine as release
RUN apk add --no-cache ca-certificates
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 && \
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 && \
Expand Down
2 changes: 1 addition & 1 deletion src/currencyservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12-alpine as base
FROM --platform=linux/amd64 node:12-alpine as base

FROM base as builder

Expand Down
2 changes: 1 addition & 1 deletion src/emailservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-slim as base
FROM --platform=linux/amd64 python:3.7-slim as base

FROM base as builder

Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as builder
FROM --platform=linux/amd64 golang:1.17-alpine as builder
RUN apk add --no-cache ca-certificates git
WORKDIR /src

Expand All @@ -8,7 +8,7 @@ RUN go mod download
COPY . .
RUN go build -o /go/bin/frontend .

FROM alpine as release
FROM --platform=linux/amd64 alpine as release
RUN apk add --no-cache ca-certificates \
busybox-extras net-tools bind-tools
WORKDIR /frontend
Expand Down
2 changes: 1 addition & 1 deletion src/loadgenerator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim as base
FROM --platform=linux/amd64 python:3.8-slim as base

FROM base as builder

Expand Down
2 changes: 1 addition & 1 deletion src/paymentservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12-alpine as base
FROM --platform=linux/amd64 node:12-alpine as base

FROM base as builder

Expand Down
4 changes: 2 additions & 2 deletions src/productcatalogservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine AS builder
FROM --platform=linux/amd64 golang:1.17-alpine AS builder
RUN apk add --no-cache ca-certificates git

WORKDIR /src
Expand All @@ -8,7 +8,7 @@ RUN go mod download
COPY . .
RUN go build -o /productcatalogservice .

FROM alpine AS release
FROM --platform=linux/amd64 alpine AS release
RUN apk add --no-cache ca-certificates
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 && \
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 && \
Expand Down
2 changes: 1 addition & 1 deletion src/recommendationservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-slim
FROM --platform=linux/amd64 python:3.7-slim
RUN apt-get update -qqy && \
apt-get -qqy install wget g++ && \
rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions src/shippingservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as builder
FROM --platform=linux/amd64 golang:1.17-alpine as builder
RUN apk add --no-cache ca-certificates git
WORKDIR /src

Expand All @@ -9,7 +9,7 @@ COPY . .
RUN go mod tidy
RUN go build -o /go/bin/shippingservice

FROM alpine as release
FROM --platform=linux/amd64 alpine as release
RUN apk add --no-cache ca-certificates
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.5 && \
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 && \
Expand Down
Loading