Placement decision: PLACED on Public cloud · US East - for review (#1)

This commit was merged in pull request #1.
This commit is contained in:
2026-10-13 16:08:04 +00:00
parent 75f87c205c
commit b7229bfd11
7 changed files with 279 additions and 0 deletions

18
.platform/placement.md Normal file
View File

@@ -0,0 +1,18 @@
# Placement decision — dealer-service
**Decision: PLACED.** Every requirement is met by Public cloud · US East.
| Criterion | Answer | Rule | Outcome |
|---|---|---|---|
| Latency | Interactive — people and partners over the internet | No constraint | ✓ no constraint |
| Data sensitivity | Internal — no personal data | No constraint | ✓ no constraint |
| Run cost | Variable — follows demand | No constraint | ✓ no constraint |
| Lifecycle | 3–5 years, then replaced | No constraint | ✓ no constraint |
| Integration | Customers and partners over the internet | Internet-facing needs public ingress | ✓ met by Public cloud · US East |
| Skills & control | A product team on the golden path | No constraint | ✓ no constraint |
**Landing zone:** Public cloud · US East · runner `crucible-orchestrator-dev-apps-dev-runner`
Merging this pull request approves the decision. Every deploy reads `.platform/placement.yaml`
and goes only to the landing zone named there. A refused record fails the deploy, with the reason above.

36
.platform/placement.yaml Normal file
View File

@@ -0,0 +1,36 @@
# Placement decision record. Written by the golden path from the workload profile and
# approved by merging the Gate 1 pull request. deploy.yml reads decision, runner and
# reason on every deploy: keep them top-level, one line each.
decision: placed
landing_zone: public-us-east
landing_zone_name: "Public cloud · US East"
runner: crucible-orchestrator-dev-apps-dev-runner
reason: "Every requirement is met by Public cloud · US East."
workload: "dealer-service"
criteria:
- criterion: "Latency"
answer: "Interactive — people and partners over the internet"
rule: "No constraint"
outcome: "✓ no constraint"
- criterion: "Data sensitivity"
answer: "Internal — no personal data"
rule: "No constraint"
outcome: "✓ no constraint"
- criterion: "Run cost"
answer: "Variable — follows demand"
rule: "No constraint"
outcome: "✓ no constraint"
- criterion: "Lifecycle"
answer: "3–5 years, then replaced"
rule: "No constraint"
outcome: "✓ no constraint"
- criterion: "Integration"
answer: "Customers and partners over the internet"
rule: "Internet-facing needs public ingress"
outcome: "✓ met by Public cloud · US East"
- criterion: "Skills & control"
answer: "A product team on the golden path"
rule: "No constraint"
outcome: "✓ no constraint"
flags: []

110
k6/load-test.js Normal file
View File

@@ -0,0 +1,110 @@
import http from 'k6/http';
import { check, sleep, group } from 'k6';
const vus = parseInt(__ENV.TEST_VUS || '10');
const duration = __ENV.TEST_DURATION || '30s';
const targetUrl = __ENV.TARGET_URL || 'http://frontend.demo-apps.svc.cluster.local:80';
export const options = {
scenarios: {
load_test: {
executor: 'ramping-vus',
startVUs: 0,
stages: [
{ duration: '10s', target: vus },
{ duration: duration, target: vus },
{ duration: '5s', target: 0 },
],
},
},
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
http.setResponseCallback(http.expectedStatuses({ min: 200, max: 399 }));
export default function () {
group('System API', () => {
const resWelcome = http.get(`${targetUrl}/`);
check(resWelcome, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
const resCrash = http.get(`${targetUrl}/oups`, { responseCallback: http.expectedStatuses(500) });
check(resCrash, {
'status is 500': (r) => r.status === 500,
});
});
sleep(0.5);
group('Owner API', () => {
const resFindOwners = http.get(`${targetUrl}/owners/find`);
check(resFindOwners, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
const resOwners = http.get(`${targetUrl}/owners`);
check(resOwners, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
const resOwnerDetails = http.get(`${targetUrl}/owners/1`);
check(resOwnerDetails, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
const resCreateOwner = http.post(`${targetUrl}/owners/new`, 'firstName=John&lastName=Doe&address=123+Main+St&city=Springfield&telephone=1234567890');
check(resCreateOwner, {
'status is 302': (r) => r.status === 302,
});
const resEditOwner = http.post(`${targetUrl}/owners/1/edit`, 'firstName=Jane&lastName=Doe&address=456+Elm+St&city=Springfield&telephone=9876543210');
check(resEditOwner, {
'status is 302': (r) => r.status === 302,
});
});
sleep(0.5);
group('Pet API', () => {
const resCreatePet = http.post(`${targetUrl}/owners/1/pets/new`, 'name=Buddy&birthDate=2023-01-01&type=Dog');
check(resCreatePet, {
'status is 302': (r) => r.status === 302,
});
const resEditPet = http.post(`${targetUrl}/owners/1/pets/1/edit`, 'name=Buddy&birthDate=2023-01-01&type=Dog');
check(resEditPet, {
'status is 302': (r) => r.status === 302,
});
const resCreateVisit = http.post(`${targetUrl}/owners/1/pets/1/visits/new`, 'date=2023-12-01&description=Routine+checkup');
check(resCreateVisit, {
'status is 302': (r) => r.status === 302,
});
});
sleep(0.5);
group('Vet API', () => {
const resVetList = http.get(`${targetUrl}/vets.html`);
check(resVetList, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
const resVetJson = http.get(`${targetUrl}/vets`);
check(resVetJson, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
});
});
sleep(0.5);
}

24
k6/testrun.yaml Normal file
View File

@@ -0,0 +1,24 @@
apiVersion: k6.io/v1alpha1
kind: TestRun
metadata:
name: k6-dealer-service
namespace: demo-apps
labels:
app: dealer-service
backstage.io/component: dealer-service
app.kubernetes.io/managed-by: backstage
app.kubernetes.io/component: load-testing
spec:
parallelism: 1
script:
configMap:
name: k6-test-dealer-service
file: load-test.js
runner:
image: grafana/k6:latest
envFrom:
- configMapRef:
name: k6-test-dealer-service
env:
- name: K6_OTEL_SERVICE_NAME
value: k6-dealer-service

View File

@@ -0,0 +1,58 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: k6-test-dealer-service
namespace: demo-apps
labels:
app: dealer-service
app.kubernetes.io/managed-by: backstage
app.kubernetes.io/component: load-testing
data:
K6_OUT: opentelemetry
K6_OTEL_GRPC_EXPORTER_INSECURE: 'true'
K6_OTEL_GRPC_EXPORTER_ENDPOINT: otel-collector.monitoring.svc.cluster.local:4317
K6_OTEL_METRIC_PREFIX: k6_
K6_OTEL_FLUSH_INTERVAL: '1000'
K6_OTEL_EXPORT_INTERVAL: '5000'
K6_OTEL_SERVICE_NAME: k6-dealer-service
load-test.js: "import http from 'k6/http';\nimport { check, sleep, group } from\
\ 'k6';\n\nconst vus = parseInt(__ENV.TEST_VUS || '10');\nconst duration = __ENV.TEST_DURATION\
\ || '30s';\nconst targetUrl = __ENV.TARGET_URL || 'http://frontend.demo-apps.svc.cluster.local:80';\n\
\nexport const options = {\n scenarios: {\n load_test: {\n executor:\
\ 'ramping-vus',\n startVUs: 0,\n stages: [\n { duration: '10s',\
\ target: vus },\n { duration: duration, target: vus },\n { duration:\
\ '5s', target: 0 },\n ],\n },\n },\n thresholds: {\n http_req_duration:\
\ ['p(95)<500'],\n http_req_failed: ['rate<0.01'],\n },\n};\n\nhttp.setResponseCallback(http.expectedStatuses({\
\ min: 200, max: 399 }));\n\nexport default function () {\n group('System API',\
\ () => {\n const resWelcome = http.get(`${targetUrl}/`);\n check(resWelcome,\
\ {\n 'status is 200': (r) => r.status === 200,\n 'response time < 500ms':\
\ (r) => r.timings.duration < 500,\n });\n\n const resCrash = http.get(`${targetUrl}/oups`,\
\ { responseCallback: http.expectedStatuses(500) });\n check(resCrash, {\n\
\ 'status is 500': (r) => r.status === 500,\n });\n });\n\n sleep(0.5);\n\
\n group('Owner API', () => {\n const resFindOwners = http.get(`${targetUrl}/owners/find`);\n\
\ check(resFindOwners, {\n 'status is 200': (r) => r.status === 200,\n\
\ 'response time < 500ms': (r) => r.timings.duration < 500,\n });\n\n\
\ const resOwners = http.get(`${targetUrl}/owners`);\n check(resOwners,\
\ {\n 'status is 200': (r) => r.status === 200,\n 'response time < 500ms':\
\ (r) => r.timings.duration < 500,\n });\n\n const resOwnerDetails = http.get(`${targetUrl}/owners/1`);\n\
\ check(resOwnerDetails, {\n 'status is 200': (r) => r.status === 200,\n\
\ 'response time < 500ms': (r) => r.timings.duration < 500,\n });\n\n\
\ const resCreateOwner = http.post(`${targetUrl}/owners/new`, 'firstName=John&lastName=Doe&address=123+Main+St&city=Springfield&telephone=1234567890');\n\
\ check(resCreateOwner, {\n 'status is 302': (r) => r.status === 302,\n\
\ });\n\n const resEditOwner = http.post(`${targetUrl}/owners/1/edit`, 'firstName=Jane&lastName=Doe&address=456+Elm+St&city=Springfield&telephone=9876543210');\n\
\ check(resEditOwner, {\n 'status is 302': (r) => r.status === 302,\n\
\ });\n });\n\n sleep(0.5);\n\n group('Pet API', () => {\n const resCreatePet\
\ = http.post(`${targetUrl}/owners/1/pets/new`, 'name=Buddy&birthDate=2023-01-01&type=Dog');\n\
\ check(resCreatePet, {\n 'status is 302': (r) => r.status === 302,\n\
\ });\n\n const resEditPet = http.post(`${targetUrl}/owners/1/pets/1/edit`,\
\ 'name=Buddy&birthDate=2023-01-01&type=Dog');\n check(resEditPet, {\n \
\ 'status is 302': (r) => r.status === 302,\n });\n\n const resCreateVisit\
\ = http.post(`${targetUrl}/owners/1/pets/1/visits/new`, 'date=2023-12-01&description=Routine+checkup');\n\
\ check(resCreateVisit, {\n 'status is 302': (r) => r.status === 302,\n\
\ });\n });\n\n sleep(0.5);\n\n group('Vet API', () => {\n const resVetList\
\ = http.get(`${targetUrl}/vets.html`);\n check(resVetList, {\n 'status\
\ is 200': (r) => r.status === 200,\n 'response time < 500ms': (r) => r.timings.duration\
\ < 500,\n });\n\n const resVetJson = http.get(`${targetUrl}/vets`);\n \
\ check(resVetJson, {\n 'status is 200': (r) => r.status === 200,\n \
\ 'response time < 500ms': (r) => r.timings.duration < 500,\n });\n });\n\
\n sleep(0.5);\n}"

View File

@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../deploy
patches:
- target:
kind: Deployment
name: petclinic
patch: "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: petclinic\nspec:\n\
\ template:\n metadata:\n annotations:\n instrumentation.opentelemetry.io/inject-java:\
\ monitoring/otel-instrumentation\n spec:\n containers:\n - name:\
\ workload\n env:\n - name: OTEL_SERVICE_NAME\n value:\
\ petclinic\n - name: OTEL_EXPORTER_OTLP_ENDPOINT\n value: http://otel-collector.monitoring.svc.cluster.local:4318\n\
\ - name: OTEL_RESOURCE_ATTRIBUTES\n value: app=dealer-service\n"

View File

@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: petclinic
spec:
template:
metadata:
annotations:
instrumentation.opentelemetry.io/inject-java: monitoring/otel-instrumentation
spec:
containers:
- name: workload
env:
- name: OTEL_SERVICE_NAME
value: petclinic
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector.monitoring.svc.cluster.local:4318
- name: OTEL_RESOURCE_ATTRIBUTES
value: app=dealer-service