Compare commits

...

28 Commits

Author SHA1 Message Date
gitea-actions
219b822bcf deploy(lab): render f4d3951e85 [skip ci] 2026-10-01 15:57:14 +00:00
f4d3951e85 Push the rendered manifests without rebasing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 16:55:26 +01:00
b9b9062a27 Let the render job rebase despite line-ending noise in the checkout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 16:51:44 +01:00
58b9995283 Let the orchestrator create the Argo CD Application and hub route for the lab
score-lab.yaml names the team and repository; the lab deploy workflow targets an environment of
type lab, where the catalog resolves the workload to an Application and the ingress to the hub route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 13:47:48 +01:00
39e7cc81fc Pin the platform provisioners to v0.1.2, the first published release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 13:44:52 +01:00
bddd387bab Deliver the lab from manifests rendered from score-lab.yaml
deploy/lab is rendered by score-k8s with the platform's provisioners and replaces the
hand-written deploy/manifests. The lab build workflow now renders and commits it after the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 12:53:21 +01:00
30dc34e700 Declare readiness and liveness probes in score-lab.yaml
Required by the platform's score-k8s policy check: the platform cannot know an app's health
endpoint. Spring Boot's actuator answers {"status":"UP"} at /actuator/health on 8080. The
platform derives a startupProbe from the liveness probe, so a slow JVM start is not killed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 21:19:40 +01:00
f8de42521e Reapply "Removing a one-off teardown for the lab orchestrator deployment"
This reverts commit 796cdf0669.
2026-09-29 15:27:44 +01:00
796cdf0669 Revert "Removing a one-off teardown for the lab orchestrator deployment"
This reverts commit f9f9312195.
2026-09-29 15:26:57 +01:00
f9f9312195 Removing a one-off teardown for the lab orchestrator deployment 2026-09-29 15:22:21 +01:00
80db5e8920 Add a one-off teardown for the lab orchestrator deployment 2026-09-29 15:17:15 +01:00
b1fa450372 Adopting teams destination based provisioning 2026-09-29 11:57:16 +01:00
06e0ab0fb3 Adopting teams destination based provisioning 2026-09-29 11:57:02 +01:00
5d9d29e186 Fix remote route 2026-09-28 19:57:27 +01:00
f487d5e7c1 ArgoCD Deployment 2026-09-28 19:28:51 +01:00
9bc0bce407 Updating ACR NAME For IMAGE 2026-09-28 19:16:52 +01:00
05d69ecd08 Rectifing workflow for lab build 2026-09-28 18:58:28 +01:00
67e6f0d93a Updating ACR NAME For IMAGE 2026-09-28 18:56:26 +01:00
09cbd3a8f7 Update README.md 2026-09-28 17:55:06 +00:00
6695625f8e Add .gitea/workflows/build-lab.yml 2026-09-28 17:54:00 +00:00
a7343bcf86 Updating ACR NAME For IMAGE 2026-09-28 18:24:06 +01:00
17682e9cfc fixing labs score yaml 2026-09-28 18:09:38 +01:00
03a85a43f5 fixing labs score yaml 2026-09-28 18:05:25 +01:00
2dd3bfc27a Update score-lab.yaml 2026-09-28 17:00:45 +00:00
5e23103a14 Update score-lab.yaml 2026-09-28 16:54:52 +00:00
5960df4f34 Add score-lab.yaml 2026-09-28 16:54:31 +00:00
f9541e6943 Update .gitea/workflows/deploy-labs.yaml 2026-09-28 16:53:24 +00:00
c10bbb6029 Add .gitea/workflows/deploy-labs.yaml 2026-09-28 16:52:17 +00:00
14 changed files with 682 additions and 1 deletions

11
.dockerignore Normal file
View File

@@ -0,0 +1,11 @@
.git
.gitea
.github
.devcontainer
target
build
.gradle
k6
k8s
overlays
*.md

View File

@@ -0,0 +1,165 @@
name: Build and Push to ACR (lab)
# Dispatch only while the lab path is proven. Builds the image for the dispatched commit, then
# renders score-lab.yaml with the platform's provisioners and commits the result to deploy/lab,
# which Argo CD delivers.
on:
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-lab
cancel-in-progress: true
env:
AZURE_FEDERATED_TOKEN_FILE: /var/run/secrets/azure/tokens/azure-identity-token
ACR_LOGIN_SERVER: cruciblecoredevacr.azurecr.io
# Platform provisioners release. Upgrading is a change to this pin.
PROVISIONERS_VERSION: v0.1.2
SCORE_K8S_VERSION: 0.19.0
SCORE_K8S_SHA256: 7c62f3585f1864cad7c4032557e183cb65fef22a7a15f3cbe22365849ca95e2c
ORAS_VERSION: 1.2.3
ORAS_SHA256: b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827
jobs:
build:
name: Build and Push
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Azure CLI
run: |
command -v az &>/dev/null || curl -sL https://aka.ms/InstallAzureCLIDeb | bash
- name: Install Docker CLI
run: |
command -v docker &>/dev/null || (apt-get update -qq && apt-get install -y docker.io)
docker --version
- name: Azure login (OIDC)
run: |
az login \
--service-principal \
--username "$AZURE_CLIENT_ID" \
--tenant "$AZURE_TENANT_ID" \
--federated-token "$(cat $AZURE_FEDERATED_TOKEN_FILE)"
echo "✓ Azure login successful"
- name: Get ACR details
run: |
# Pinned: `az acr list` returns whichever registry the identity sees first.
ACR_NAME=cruciblecoredevacr
echo "ACR_NAME=$ACR_NAME" >> $GITHUB_ENV
echo "ACR_LOGIN_SERVER=${ACR_NAME}.azurecr.io" >> $GITHUB_ENV
echo "✓ Using ACR: ${ACR_NAME}.azurecr.io"
- name: ACR Login
run: |
ACR_TOKEN=$(az acr login --name "$ACR_NAME" --expose-token --output tsv --query accessToken)
docker login "$ACR_LOGIN_SERVER" \
--username 00000000-0000-0000-0000-000000000000 \
--password "$ACR_TOKEN"
echo "✓ ACR login successful"
- name: Build and Push Docker image
run: |
IMAGE_TAG="${{ gitea.sha }}"
IMAGE_FULL="${ACR_LOGIN_SERVER}/demo-vivek-11:${IMAGE_TAG}"
IMAGE_LATEST="${ACR_LOGIN_SERVER}/demo-vivek-11:latest"
docker build -t "$IMAGE_FULL" -t "$IMAGE_LATEST" .
docker push "$IMAGE_FULL"
docker push "$IMAGE_LATEST"
echo "IMAGE_FULL=$IMAGE_FULL" >> $GITHUB_ENV
echo "✓ Pushed: $IMAGE_FULL"
- name: Build Summary
run: |
echo "### ✅ Build Successful" >> $GITHUB_STEP_SUMMARY
echo "| | |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| **Service** | demo-vivek-11 |" >> $GITHUB_STEP_SUMMARY
echo "| **Commit** | ${{ gitea.sha }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Image** | $IMAGE_FULL |" >> $GITHUB_STEP_SUMMARY
render:
name: Render manifests
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install tools
run: |
command -v az &>/dev/null || curl -sL https://aka.ms/InstallAzureCLIDeb | bash
python3 -c 'import yaml' 2>/dev/null || (apt-get update -qq && apt-get install -y python3-yaml)
mkdir -p "$HOME/bin" && cd "$(mktemp -d)"
curl -fsSL -o score-k8s.tgz "https://github.com/score-spec/score-k8s/releases/download/${SCORE_K8S_VERSION}/score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz"
curl -fsSL -o oras.tgz "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz"
echo "${SCORE_K8S_SHA256} score-k8s.tgz" | sha256sum -c -
echo "${ORAS_SHA256} oras.tgz" | sha256sum -c -
tar -xzf score-k8s.tgz score-k8s && tar -xzf oras.tgz oras
install -m 0755 score-k8s oras "$HOME/bin/"
echo "$HOME/bin" >> $GITHUB_PATH
- name: Azure login (OIDC)
run: |
az login \
--service-principal \
--username "$AZURE_CLIENT_ID" \
--tenant "$AZURE_TENANT_ID" \
--federated-token "$(cat $AZURE_FEDERATED_TOKEN_FILE)"
- name: Pull platform provisioners
run: |
az acr login --name "${ACR_LOGIN_SERVER%%.*}" --expose-token --output tsv --query accessToken \
| oras login "$ACR_LOGIN_SERVER" --username 00000000-0000-0000-0000-000000000000 --password-stdin
oras pull "${ACR_LOGIN_SERVER}/score-provisioners:${PROVISIONERS_VERSION}" -o "$HOME/provisioners"
ls -1 "$HOME/provisioners"
- name: Render score-lab.yaml
run: |
P="$HOME/provisioners"
OUT="$PWD/deploy/lab"
WORK="$(mktemp -d)"
cp score-lab.yaml "$WORK/score.yaml"
cd "$WORK"
score-k8s init --no-sample --quiet \
$(for f in "$P"/*.provisioners.yaml; do printf -- '--provisioners %s ' "$f"; done) \
$(for f in "$P"/*.tpl.yaml; do printf -- '--patch-templates %s ' "$f"; done)
# Platform rule: only the platform's provisioners, so an unsupported resource type fails.
rm -f .score-k8s/zz-default.provisioners.yaml
CRUCIBLE_ENV=lab score-k8s generate score.yaml --quiet \
--image "${ACR_LOGIN_SERVER}/demo-vivek-11:${{ gitea.sha }}" \
--namespace demo-vivek-11 \
-o manifests.yaml
python3 "$P/policy-check.py" manifests.yaml
python3 "$P/split.py" manifests.yaml "$OUT"
- name: Commit rendered manifests
run: |
git config user.name "gitea-actions"
git config user.email "gitea-actions@noreply.gitea.kyndemo.live"
git add deploy/lab
if git diff --cached --quiet; then
echo "deploy/lab is already up to date"
exit 0
fi
SHA="${{ gitea.sha }}"
git commit -m "deploy(lab): render ${SHA:0:12} [skip ci]"
# No rebase: gradlew.bat and mvnw.cmd always show as modified in a checkout (line endings),
# and git will not rebase a dirty tree. If the branch moved during the run, run it again.
git push origin "HEAD:${{ gitea.ref_name }}" || {
echo "::error::${{ gitea.ref_name }} moved while this job ran; run the workflow again"
exit 1
}

View File

@@ -0,0 +1,157 @@
name: Deploy to Orchestrator (lab)
# Creates or updates the Argo CD Application and the hub route for the lab, from score-lab.yaml.
# Run after "Build and Push to ACR (lab)", which renders deploy/lab. Dispatch only.
on:
workflow_dispatch: {}
env:
PO_API_URL: https://api.dev.orchestrator.crucible.kyndemo.live
PO_ORG_ID: crucible
PO_AUTH_TOKEN: ${{ secrets.PO_AUTH_TOKEN }}
# ONE ORCHESTRATOR PROJECT PER APPLICATION.
#
# This used to be the shared `apps-cluster` project with one environment per app, which
# made every app a peer of every other: the Orchestrator tab on any component listed the
# entire estate, and an app had exactly one environment named after itself, so there was
# nowhere for dev/staging/prod to live.
#
# That shape existed to avoid a Terraform pull request against config/projects.tf for every
# scaffolded app. That constraint turned out not to be real -- `octl create project`,
# `octl create runner-rule` and `octl create environment` are all runtime operations, so
# the workflow below builds the whole thing on first deploy and needs no repository change.
# Its own project, NOT demo-vivek-11. Sharing it would reuse deploy.yml's runner rule (the dev
# apps runner) and overwrite the dev workload with this file.
#
# Bound to the lab HUB's runner: what the orchestrator creates here is the Argo CD Application
# and the public route, and both live on the hub. Argo CD delivers the workload to the spoke
# from deploy/lab.
PROJECT_ID: demo-vivek-11-lab
# The runner a project's workloads execute on. This is NOT cosmetic: the Kubernetes and
# Helm providers are ambient, so a workload lands in whichever cluster its runner lives in,
# and Terraform state is keyed per runner. A project bound to the wrong runner deploys to
# the wrong cluster, and repointing it afterwards orphans the state it already owns.
PO_RUNNER_ID: crucible-orchestrator-dev-platform-lab-runner
OCTL_VERSION: 1.0.0
IMAGE: cruciblecoredevacr.azurecr.io/demo-vivek-11
jobs:
guard:
name: Platform guard
runs-on: ubuntu-latest
outputs:
ready: ${{ steps.check.outputs.ready }}
steps:
- uses: actions/checkout@v4
- name: Check platform initialized
id: check
run: |
if [ -f ".platform/initialized.md" ]; then
echo "ready=true" >> $GITHUB_OUTPUT
else
echo "ready=false" >> $GITHUB_OUTPUT
echo "Skipping: .platform/initialized.md not found"
fi
deploy:
name: Deploy to Orchestrator
needs: guard
if: >-
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && needs.guard.outputs.ready == 'true') ||
(github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install octl
run: |
set -euo pipefail
curl -fsSLo /tmp/octl.tar.gz \
"https://github.com/stellwerk-labs/platform-orchestrator-cli/releases/download/v${OCTL_VERSION}/platform-orchestrator-cli_${OCTL_VERSION}_linux_amd64.tar.gz"
tar xzf /tmp/octl.tar.gz -C /tmp
install -m 755 /tmp/octl /usr/local/bin/octl
octl --version
- name: Set environment
run: |
# One environment, of type `lab`. The type is what selects the Argo CD implementations:
# the workload becomes an Application and workload-ingress becomes the hub route.
echo "ENV_ID=lab" >> $GITHUB_ENV
- name: Ensure the project and its runner binding exist
run: |
set -euo pipefail
# Created on first deploy rather than by a pull request against config/projects.tf.
# None of this needs a repository change: project, runner rule and environment are
# all runtime objects.
#
# Neither create is idempotent, so both fall through to a read on the second run.
octl create project "$PROJECT_ID" \
--set display_name='demo-vivek-11 (lab)' || \
octl get project "$PROJECT_ID"
# The runner rule is what routes this project's deployments to the apps cluster.
# Creating it twice would leave two rules matching the same project, so it is
# created only when absent -- `create` would happily add a duplicate.
if octl get runner-rules -o json 2>/dev/null | grep -q "\"project_id\": *\"$PROJECT_ID\""; then
echo "Runner rule for '$PROJECT_ID' already exists."
else
octl create runner-rule \
--set project_id="$PROJECT_ID" \
--set runner_id="$PO_RUNNER_ID" \
--no-prompt
fi
- name: Ensure the environment exists
run: |
set -euo pipefail
octl create environment "$PROJECT_ID" "$ENV_ID" \
--set env_type_id=lab \
--set display_name="Lab" || \
octl get environment "$PROJECT_ID" "$ENV_ID"
- name: Deploy the Score workload
run: |
set -euo pipefail
# `octl score deploy` is ADDITIVE — it adds or updates a workload in the manifest and
# never removes one. That is the opposite of `octl deploy`, where omission is
# deletion. Do not substitute one for the other.
# No --show-logs: octl 1.0.0 has no such flag and exits 1 with `unknown flag`
# BEFORE contacting the orchestrator, so the whole deploy dies on an argument
# typo. Its nearest relatives are --runner-logs-level (default `info`, already
# what we want) and --skip-logs (which suppresses storage). Neither streams the
# runner's logs into this job, so there is nothing to substitute -- the runner
# logs are read from the orchestrator, not from here.
# The tag must be the commit the BUILD built, and it must be the WHOLE sha.
#
# build-push.yml tags with `` -- all 40 characters -- so the
# 7-character `${GITHUB_SHA:0:7}` this used to pass named a tag that has never
# existed in the registry.
#
# And on a workflow_run, GITHUB_SHA is the DEFAULT branch's head, while the build
# that produced the image ran on `dev`. They coincide only while the branches are
# level. `workflow_run.head_sha` is the triggering run's own commit, which is by
# definition the one that was built; `github.sha` covers the workflow_dispatch case,
# where there is no triggering run.
IMAGE_TAG="${{ github.event.workflow_run.head_sha || github.sha }}"
echo "Deploying ${IMAGE}:${IMAGE_TAG}"
octl score deploy "$PROJECT_ID" "$ENV_ID" score-lab.yaml \
--default-image "${IMAGE}:${IMAGE_TAG}" \
--no-prompt
- name: Deployment summary
if: always()
run: |
# Same commit the deploy step resolved, abbreviated for reading only -- the
# deployed tag is the full sha.
DEPLOYED_SHA="${{ github.event.workflow_run.head_sha || github.sha }}"
SHORT_SHA="${DEPLOYED_SHA:0:7}"
echo "## Deployment Result" >> $GITHUB_STEP_SUMMARY
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| Project | \`$PROJECT_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Environment | \`$ENV_ID\` |" >> $GITHUB_STEP_SUMMARY
echo "| Commit | \`$SHORT_SHA\` |" >> $GITHUB_STEP_SUMMARY
echo "[View in Orchestrator Console](https://console.dev.orchestrator.crucible.kyndemo.live/orgs/$PO_ORG_ID/projects/$PROJECT_ID/environments/$ENV_ID)" >> $GITHUB_STEP_SUMMARY

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# Spring PetClinic: build the jar with Maven, run it on a slim JRE.
# Plain Maven, not ./mvnw: the Maven wrapper jar is not committed.
FROM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /src
COPY pom.xml .
RUN mvn -B -q dependency:go-offline
COPY src ./src
# Tests run in integration-test.yml. Format and checkstyle checks gate on style, not on a working image.
RUN mvn -B -q package -DskipTests -Dspring-javaformat.skip=true -Dcheckstyle.skip=true
FROM eclipse-temurin:17-jre
WORKDIR /app
COPY --from=build /src/target/*.jar app.jar
RUN useradd --system --uid 10001 app
USER 10001
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app/app.jar"]

View File

@@ -1,4 +1,4 @@
# Spring PetClinic Sample Application [![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)[![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml)
# Spring PetClinic Sample Application [![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)[![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/spring-projects/spring-petclinic) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=7517918)

40
deploy/README.md Normal file
View File

@@ -0,0 +1,40 @@
# deploy/
Argo CD delivery of demo-vivek-11 to the lab: the hub's Argo CD pushes it to the `apps-lab` spoke
through the argocd-agent, and the hub's public kgateway Gateway forwards to it over Private Link.
```
browser ─► hub pe-gatewayapi (demo-vivek-11.apps.lab…) ─► Private Link ─► spoke pe-gatewayapi-int
(demo-vivek-11.int.apps.lab…, port 80) ─► Service demo-vivek-11 ─► pod :8080
```
| Folder | Applied to | By |
|---|---|---|
| `argocd/` | lab **hub** | `kubectl apply` once |
| `hub/` | lab **hub** | `kubectl apply` once |
| `lab/` | lab **spoke** | Argo CD, from this repo. **Generated**: never edit by hand |
## Apply
```bash
khub apply -f deploy/argocd/application.yaml
khub apply -f deploy/hub/remote-route.yaml
```
## Rules the Application must keep
The lab uses argocd-agent's **destination-based mapping**, and this app belongs to team **demo**.
- It lives in namespace **`team-demo`** on the hub: team demo's namespace. The platform creates it.
- `project: team-demo`: the platform's AppProject for the team. It accepts Applications only from
`team-demo`, and deploys only to spoke namespaces named **`demo-*`** (this app's is `demo-vivek-11`).
- `destination.name: apps-lab`: the agent to deploy to, and the routing key. **Never**
`destination.server`, which resolves to the hub itself.
## How `lab/` is produced
`lab/` is rendered from `score-lab.yaml` by the **Build and Push to ACR (lab)** workflow: it builds
the image, renders with the platform's provisioners
(`cruciblecoredevacr.azurecr.io/score-provisioners`, version pinned in the workflow), and commits the
result. The image tag is the commit that was built. To change what is deployed, change
`score-lab.yaml` and run the workflow.

View File

@@ -0,0 +1,25 @@
# Lives on the HUB, in team demo's namespace. Destination-based mapping routes it to the spoke named
# by destination.name, where it keeps this namespace (team-demo) rather than moving to argocd.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: demo-vivek-11
namespace: team-demo
spec:
# Created by the platform (argocd-principal teams). Allows deploying only to demo-* on the spoke.
project: team-demo
source:
repoURL: https://gitea.kyndemo.live/validate/demo-vivek-11.git
targetRevision: main
path: deploy/lab
destination:
# The agent to deploy to -- under destination-based mapping this IS the routing key. Never
# server: https://kubernetes.default.svc resolves to the hub itself.
name: apps-lab
namespace: demo-vivek-11
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@@ -0,0 +1,43 @@
# On the HUB's public Gateway: the public name, forwarded over Private Link to the spoke's internal
# Gateway. The same shape the catalog's kgateway-remote-route module creates.
#
# 10.20.255.100 is the hub's private endpoint to the spoke Gateway (crucible-hub-to-apps-lab-pe).
apiVersion: gateway.kgateway.dev/v1alpha1
kind: Backend
metadata:
name: demo-vivek-11
namespace: gatewayapi
spec:
type: Static
static:
hosts:
- host: 10.20.255.100
port: 80
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: demo-vivek-11
namespace: gatewayapi
spec:
parentRefs:
- name: pe-gatewayapi
namespace: gatewayapi
sectionName: https
hostnames:
- demo-vivek-11.apps.lab.crucible.kyndemo.live
rules:
- matches:
- path:
type: PathPrefix
value: /
# The spoke only serves *.int.apps.lab; without the rewrite it answers 404.
filters:
- type: URLRewrite
urlRewrite:
hostname: demo-vivek-11.int.apps.lab.crucible.kyndemo.live
# No port: kgateway rejects one on a Backend ref (BackendNotFound); the Backend carries it.
backendRefs:
- name: demo-vivek-11
kind: Backend
group: gateway.kgateway.dev

View File

@@ -0,0 +1,90 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
k8s.score.dev/workload-name: demo-vivek-11
labels:
app.kubernetes.io/instance: demo-vivek-11
app.kubernetes.io/managed-by: score-k8s
app.kubernetes.io/name: demo-vivek-11
name: demo-vivek-11
namespace: demo-vivek-11
spec:
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/instance: demo-vivek-11
strategy: {}
template:
metadata:
annotations:
crucible.kyndryl.com/repo-url: https://gitea.kyndemo.live/validate/demo-vivek-11.git
crucible.kyndryl.com/team: demo
k8s.score.dev/workload-name: demo-vivek-11
labels:
app.kubernetes.io/instance: demo-vivek-11
app.kubernetes.io/managed-by: score-k8s
app.kubernetes.io/name: demo-vivek-11
spec:
automountServiceAccountToken: false
containers:
- env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://otel-collector.monitoring.svc.cluster.local:4318
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_LOGS_EXPORTER
value: none
- name: OTEL_METRICS_EXPORTER
value: otlp
- name: OTEL_RESOURCE_ATTRIBUTES
value: service.name=demo-vivek-11
- name: OTEL_SERVICE_NAME
value: demo-vivek-11
- name: OTEL_TRACES_EXPORTER
value: otlp
image: cruciblecoredevacr.azurecr.io/demo-vivek-11:f4d3951e858b9030a9dc5b00bb268364eddcab1b
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
name: main
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
resources:
limits:
memory: 1Gi
requests:
cpu: 250m
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
startupProbe:
failureThreshold: 36
httpGet:
path: /actuator/health
port: 8080
periodSeconds: 5
volumeMounts:
- mountPath: /tmp
name: crucible-tmp
enableServiceLinks: false
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
volumes:
- emptyDir:
sizeLimit: 256Mi
name: crucible-tmp
status: {}

View File

@@ -0,0 +1,27 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
annotations:
crucible.kyndryl.com/public-hostname: demo-vivek-11.apps.lab.crucible.kyndemo.live
k8s.score.dev/resource-uid: workload-ingress.default#demo-vivek-11.ingress
k8s.score.dev/source-workload: demo-vivek-11
labels:
app.kubernetes.io/managed-by: score-k8s
app.kubernetes.io/name: demo-vivek-11
name: demo-vivek-11
namespace: demo-vivek-11
spec:
hostnames:
- demo-vivek-11.int.apps.lab.crucible.kyndemo.live
parentRefs:
- name: pe-gatewayapi-int
namespace: gatewayapi
sectionName: http
rules:
- backendRefs:
- name: demo-vivek-11
port: 80
matches:
- path:
type: PathPrefix
value: /

View File

@@ -0,0 +1,8 @@
# Generated by crucible-platform-score-provisioners. Do not edit: re-render instead.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment-demo-vivek-11.yaml
- httproute-demo-vivek-11.yaml
- networkpolicy-demo-vivek-11.yaml
- service-demo-vivek-11.yaml

View File

@@ -0,0 +1,20 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: score-k8s
app.kubernetes.io/name: demo-vivek-11
name: demo-vivek-11
namespace: demo-vivek-11
spec:
ingress:
- from:
- podSelector: {}
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: gatewayapi
podSelector:
matchLabels:
app.kubernetes.io/instance: demo-vivek-11
policyTypes:
- Ingress

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
annotations:
k8s.score.dev/workload-name: demo-vivek-11
labels:
app.kubernetes.io/instance: demo-vivek-11
app.kubernetes.io/managed-by: score-k8s
app.kubernetes.io/name: demo-vivek-11
name: demo-vivek-11
namespace: demo-vivek-11
spec:
ports:
- name: web
port: 80
protocol: TCP
targetPort: 8080
selector:
app.kubernetes.io/instance: demo-vivek-11
status:
loadBalancer: {}

56
score-lab.yaml Normal file
View File

@@ -0,0 +1,56 @@
apiVersion: score.dev/v1b1
metadata:
name: demo-vivek-11
labels:
app: demo-vivek-11
# Read by the orchestrator to create the Argo CD Application: which team owns it, and the
# repository whose deploy/lab folder holds the rendered manifests.
annotations:
crucible.kyndryl.com/team: demo
crucible.kyndryl.com/repo-url: https://gitea.kyndemo.live/validate/demo-vivek-11.git
containers:
main:
image: .
variables:
# The Watcher's OTel work lands in overlays/otel/, which only ArgoCD reads. On the
# orchestrator path nothing consumes that overlay, so without these variables the
# renovated app emits no telemetry at all and never appears in Grafana.
OTEL_SERVICE_NAME: "demo-vivek-11"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.monitoring.svc.cluster.local:4318"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_RESOURCE_ATTRIBUTES: "service.name=demo-vivek-11"
OTEL_METRICS_EXPORTER: "otlp"
OTEL_TRACES_EXPORTER: "otlp"
OTEL_LOGS_EXPORTER: "none"
# Required by the platform's policy check. Spring Boot's actuator answers {"status":"UP"} here.
# The platform adds a startupProbe from the liveness probe, so a slow JVM start is not killed.
readinessProbe:
httpGet:
path: /actuator/health
port: 8080
livenessProbe:
httpGet:
path: /actuator/health
port: 8080
service:
ports:
web:
port: 80
targetPort: 8080
resources:
env:
type: environment
ingress:
type: workload-ingress
params:
name: demo-vivek-11
hostname: demo-vivek-11.apps.lab.crucible.kyndemo.live
service_name: demo-vivek-11
service_port: 80
# No database until one exists on the lab: CloudNativePG is not installed there. When it is
# restored, add back DATABASE_URL using ${resources.db.hostname} and ${resources.db.database}.
# db:
# type: postgres