Compare commits
2 Commits
f59c51a823
...
renovation
| Author | SHA1 | Date | |
|---|---|---|---|
| d0db81c64a | |||
| dbc6efc4ac |
@@ -1,11 +0,0 @@
|
||||
.git
|
||||
.gitea
|
||||
.github
|
||||
.devcontainer
|
||||
target
|
||||
build
|
||||
.gradle
|
||||
k6
|
||||
k8s
|
||||
overlays
|
||||
*.md
|
||||
@@ -1,165 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
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
|
||||
52
.gitea/workflows/techdocs.yml
Normal file
52
.gitea/workflows/techdocs.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Build and Publish TechDocs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "docs/**"
|
||||
- "mkdocs.yml"
|
||||
- "catalog-info.yaml"
|
||||
workflow_dispatch: {}
|
||||
|
||||
env:
|
||||
AZURE_FEDERATED_TOKEN_FILE: /var/run/secrets/azure/tokens/azure-identity-token
|
||||
AZURE_ACCOUNT_NAME: "bstagecjotdevsttechdocs"
|
||||
ENTITY_NAMESPACE: default
|
||||
ENTITY_KIND: component
|
||||
ENTITY_NAME: demo-vivek-11
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update -qq && apt-get install -y python3-pip
|
||||
pip3 install mkdocs-techdocs-core==1.*
|
||||
npm install -g @techdocs/cli
|
||||
- name: Build TechDocs site
|
||||
run: techdocs-cli generate --source-dir . --output-dir ./site --no-docker --verbose
|
||||
- name: Install Azure CLI
|
||||
run: |
|
||||
if ! command -v az &>/dev/null; then curl -sL https://aka.ms/InstallAzureCLIDeb | bash; fi
|
||||
- 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: Publish TechDocs site
|
||||
run: |
|
||||
techdocs-cli publish \
|
||||
--publisher-type azureBlobStorage \
|
||||
--storage-name "techdocs" \
|
||||
--azureAccountName "$AZURE_ACCOUNT_NAME" \
|
||||
--entity "$ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME"
|
||||
42
Dockerfile
42
Dockerfile
@@ -1,18 +1,30 @@
|
||||
# Spring PetClinic: build the jar with Maven, run it on a slim JRE.
|
||||
|
||||
# Plain Maven, not ./mvnw: the Maven wrapper jar is not committed.
|
||||
# Multi-stage Dockerfile for Spring Boot Application
|
||||
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
|
||||
|
||||
# Copy dependency files first for better caching
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline -B
|
||||
|
||||
# Copy source code and build
|
||||
COPY src ./src
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
# Runtime stage - lean JRE for Spring Boot executable JAR (~200MB vs ~500MB Tomcat)
|
||||
FROM mcr.microsoft.com/openjdk/jdk:17-ubuntu
|
||||
WORKDIR /app
|
||||
|
||||
# Create non-root user for security
|
||||
RUN groupadd -g 1001 appuser && useradd -u 1001 -g appuser -s /bin/sh appuser && \
|
||||
chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
COPY --from=build /app/target/*.jar app.jar
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
CMD ["java", "-jar", "app.jar"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Spring PetClinic Sample Application [](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)[](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml)
|
||||
# Spring PetClinic Sample Application [](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)[](https://github.com/spring-projects/spring-petclinic/actions/workflows/gradle-build.yml)
|
||||
|
||||
[](https://gitpod.io/#https://github.com/spring-projects/spring-petclinic) [](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=7517918)
|
||||
|
||||
|
||||
@@ -1,67 +1,46 @@
|
||||
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
description: 'demo-vivek-11 — renovated onto the crucible platform orchestrator'
|
||||
annotations:
|
||||
gitea.kyndemo.live/project-slug: validate/demo-vivek-11
|
||||
gitea.kyndemo.live/repo-slug: validate/demo-vivek-11
|
||||
# The orchestrator names each environment's namespace ns-xxxxx at deploy time, so a
|
||||
# namespace can never be known here -- pinning one only hides the workload. Omitted
|
||||
# deliberately: the Kubernetes plugin then searches every namespace it is given.
|
||||
#
|
||||
# kubernetes-id matches the label the score-workload module propagates from the Score
|
||||
# metadata.labels block. The previous selector, app.humanitec.io/name=..., was a
|
||||
# Humanitec SaaS label that nothing on this platform has ever set.
|
||||
backstage.io/kubernetes-id: demo-vivek-11
|
||||
backstage.io/techdocs-ref: dir:.
|
||||
# Vestigial key names, live values. These drive the Orchestrator tab, which reads
|
||||
# humanitec.dev/orgId and humanitec.dev/projectId; renaming the keys would break every
|
||||
# entity already in the catalog, so the names stay and the values point at crucible.
|
||||
humanitec.dev/orgId: crucible
|
||||
# THE PROJECT IS THE APPLICATION. This was `apps-cluster`, a single project shared by
|
||||
# every renovated app, which is why the Orchestrator tab on any one component listed the
|
||||
# whole estate -- the tab shows a project's environments, and every app's environment
|
||||
# lived in that one project. Now each app owns a project, so the tab shows this app's
|
||||
# stages and nothing else. The deploy workflow creates the project, its runner rule and
|
||||
# its environments on first deploy.
|
||||
humanitec.dev/projectId: demo-vivek-11
|
||||
# The environments are now STAGES of this application -- dev, staging, prod -- rather
|
||||
# than one environment named after the component.
|
||||
humanitec.dev/appId: demo-vivek-11
|
||||
cjot.io/target-domain: apps
|
||||
gitea.kyndemo.live/project-slug: validate/demo-vivek-11
|
||||
gitea.kyndemo.live/repo-slug: validate/demo-vivek-11
|
||||
grafana.com/dashboard-url: https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=demo-vivek-11
|
||||
grafana/alert-label-selector: app=demo-vivek-11
|
||||
grafana/dashboard-selector: uid == 'otel-app-observability-v2'
|
||||
grafana/grafana-instance: default
|
||||
humanitec.dev/appId: demo-vivek-11
|
||||
humanitec.dev/orgId: crucible
|
||||
humanitec.dev/projectId: demo-vivek-11
|
||||
sonarqube.org/project-key: demo-vivek-11
|
||||
grafana/grafana-instance: "default"
|
||||
grafana/alert-label-selector: "app=demo-vivek-11"
|
||||
grafana/dashboard-selector: "uid == 'otel-app-observability-v2'"
|
||||
grafana.com/dashboard-url: "https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=demo-vivek-11"
|
||||
tags:
|
||||
- platform-orchestrator
|
||||
- renovation
|
||||
- postgresql
|
||||
description: "demo-vivek-11 \u2014 renovated onto the crucible platform orchestrator"
|
||||
links:
|
||||
# console.humanitec.dev is the dead SaaS. This is the live crucible console, deep-linked
|
||||
# to the per-application environment the deploy workflow creates.
|
||||
- url: https://console.dev.orchestrator.crucible.kyndemo.live/orgs/crucible/projects/demo-vivek-11/environments/dev
|
||||
title: Orchestrator Console
|
||||
icon: dashboard
|
||||
- url: https://demo-vivek-11.apps.dev.crucible.kyndemo.live
|
||||
title: Live Application
|
||||
icon: web
|
||||
- url: https://gitea.kyndemo.live/validate/demo-vivek-11
|
||||
title: Source Repository
|
||||
icon: github
|
||||
- url: https://gitea.kyndemo.live/validate/demo-vivek-11/actions
|
||||
title: CI/CD Pipelines
|
||||
icon: code
|
||||
- url: https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=demo-vivek-11
|
||||
title: Grafana Dashboard
|
||||
icon: dashboard
|
||||
- icon: dashboard
|
||||
title: Orchestrator Console
|
||||
url: https://console.dev.orchestrator.crucible.kyndemo.live/orgs/crucible/projects/demo-vivek-11/environments/dev
|
||||
- icon: web
|
||||
title: Live Application
|
||||
url: https://demo-vivek-11.apps.dev.crucible.kyndemo.live
|
||||
- icon: github
|
||||
title: Source Repository
|
||||
url: https://gitea.kyndemo.live/validate/demo-vivek-11
|
||||
- icon: code
|
||||
title: CI/CD Pipelines
|
||||
url: https://gitea.kyndemo.live/validate/demo-vivek-11/actions
|
||||
- icon: dashboard
|
||||
title: Grafana Dashboard
|
||||
url: https://grafana.kyndemo.live/d/otel-app-observability-v2/opentelemetry-application-observability?orgId=1&var-app=demo-vivek-11
|
||||
name: demo-vivek-11
|
||||
tags:
|
||||
- platform-orchestrator
|
||||
- renovation
|
||||
- postgresql
|
||||
spec:
|
||||
type: service
|
||||
dependsOn:
|
||||
- resource:default/cjot-aks
|
||||
- resource:default/ho-v2-postgresql
|
||||
lifecycle: experimental
|
||||
owner: platform-engineering
|
||||
dependsOn:
|
||||
- resource:default/cjot-aks
|
||||
- resource:default/ho-v2-postgresql
|
||||
type: service
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# deploy/
|
||||
|
||||
How demo-vivek-11 reaches the lab. Everything starts from `score-lab.yaml`; nothing here is written
|
||||
by hand.
|
||||
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
| What | Where | Produced by |
|
||||
|---|---|---|
|
||||
| Deployment, Service, HTTPRoute, NetworkPolicy (`lab/`) | lab **spoke** | score-k8s with the platform's provisioners, delivered by Argo CD |
|
||||
| Argo CD Application `team-demo/demo-vivek-11` | lab **hub** | the orchestrator, from the workload in `score-lab.yaml` |
|
||||
| Public route (Backend + HTTPRoute) | lab **hub** | the orchestrator, from the `workload-ingress` resource |
|
||||
|
||||
## Workflows
|
||||
|
||||
1. **Build and Push to ACR (lab)** builds the image, renders `score-lab.yaml` into `lab/` and commits
|
||||
it. The image tag is the commit that was built. Argo CD then rolls it out.
|
||||
2. **Deploy to Orchestrator (lab)** creates or updates the Application and the public route. It is
|
||||
needed the first time and whenever the hostname, team or repository in `score-lab.yaml` changes.
|
||||
|
||||
`lab/` is **generated**: never edit it. To change what is deployed, change `score-lab.yaml` and run
|
||||
the build workflow. The provisioners version is pinned in that workflow.
|
||||
|
||||
## What `score-lab.yaml` must carry
|
||||
|
||||
- `metadata.annotations["crucible.kyndryl.com/team"]`: the owning team (`demo`). The Application is
|
||||
created in `team-demo`, and may deploy only to spoke namespaces named `demo-*`.
|
||||
- `metadata.annotations["crucible.kyndryl.com/repo-url"]`: this repository.
|
||||
- Readiness and liveness probes, required by the platform's policy check.
|
||||
@@ -1,90 +0,0 @@
|
||||
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: {}
|
||||
@@ -1,27 +0,0 @@
|
||||
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: /
|
||||
@@ -1,8 +0,0 @@
|
||||
# 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
|
||||
@@ -1,20 +0,0 @@
|
||||
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
|
||||
@@ -1,21 +0,0 @@
|
||||
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: {}
|
||||
25
docs/api.md
Normal file
25
docs/api.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# API Reference
|
||||
|
||||
## Endpoints
|
||||
|
||||
### Health Check
|
||||
|
||||
```
|
||||
GET /health
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{"status": "UP", "service": "demo-vivek-11"}
|
||||
```
|
||||
|
||||
### Root
|
||||
|
||||
```
|
||||
GET /
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{"service": "demo-vivek-11", "description": "Modernized demo-vivek-11 service", "version": "1.0.0"}
|
||||
```
|
||||
15
docs/architecture.md
Normal file
15
docs/architecture.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Architecture
|
||||
|
||||
## Service Design
|
||||
|
||||
demo-vivek-11 is a microservice following cloud-native patterns.
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Runtime**: Java Spring Boot
|
||||
- **Deployment**: Humanitec Platform Orchestrator
|
||||
- **CI/CD**: Gitea Actions → ACR → Humanitec
|
||||
|
||||
## Dependencies
|
||||
|
||||
See `score.yaml` for external resource dependencies.
|
||||
32
docs/index.md
Normal file
32
docs/index.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# demo-vivek-11
|
||||
|
||||
Modernized demo-vivek-11 service
|
||||
|
||||
## Overview
|
||||
|
||||
This service is built with **Java Spring Boot** and follows the Golden Path architecture patterns.
|
||||
|
||||
### Key Features
|
||||
|
||||
- 🚀 Production-ready configuration
|
||||
- 📊 Prometheus metrics exposed
|
||||
- 🏥 Health check endpoints
|
||||
- 🔒 Security scanning in CI/CD
|
||||
- 📦 Containerized deployment
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
git clone https://gitea.kyndemo.live/kyndryl-demos/demo-vivek-11.git
|
||||
cd demo-vivek-11
|
||||
```
|
||||
|
||||
## Monitoring
|
||||
|
||||
- **Metrics**: Prometheus metrics at `/metrics`
|
||||
- **Health**: `/health`
|
||||
- **Grafana**: [View Dashboard](https://grafana.kyndemo.live/d/app-demo-vivek-11)
|
||||
|
||||
## Support
|
||||
|
||||
Contact the Platform Engineering team.
|
||||
43
docs/migration-plan.md
Normal file
43
docs/migration-plan.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Modernization Plan for demo-vivek-11
|
||||
|
||||
## Application Type
|
||||
Java Application
|
||||
|
||||
## Selected Modernization Strategy
|
||||
- **Migration Approach**: containerize-optimize
|
||||
- **Target Platform**: orchestrator
|
||||
- **Observability**: ENABLED (Prometheus metrics, health checks, tracing)
|
||||
- **Security Scanning**: ENABLED (Trivy vulnerability scanning)
|
||||
|
||||
## Discovery Summary
|
||||
### Discovery Report
|
||||
|
||||
#### Application Overview
|
||||
The application appears to be a Java-based project using the Spring framework. It includes both Maven and Gradle build files (`pom.xml`, `build.gradle`), indicating support for both build systems. The presence of Spring Boot dependencies suggests it is a Spring Boot application.
|
||||
|
||||
#### Technology Stack
|
||||
- **Language**: Java
|
||||
- **Framework**: Spring Boot
|
||||
- **Build Tools**: Maven and Gradle
|
||||
- **Database**: H2 (in-memory), MySQL, PostgreSQL
|
||||
- **Frontend*...
|
||||
|
||||
## Generated Artifacts
|
||||
1. **Dockerfile**: Optimized with health checks and metrics endpoints
|
||||
2. **score.yaml**: Platform intent with service ports and DNS resource
|
||||
3. **CI Workflow**: Automated build/push to ACR with Trivy security scanning
|
||||
|
||||
## Next Steps
|
||||
1. Review and customize generated artifacts
|
||||
2. Test container build and run
|
||||
3. Deploy to development environment using score.yaml
|
||||
4. Validate application functionality
|
||||
5. Promote to staging/production via Humanitec
|
||||
|
||||
## Migration Strategy Details
|
||||
|
||||
### Containerize Optimize
|
||||
Add cloud-native patterns: health checks, metrics, optimized base images.
|
||||
|
||||
### Platform: orchestrator
|
||||
score.yaml optimized for Azure Container Apps with managed scaling and Azure-specific configuration.
|
||||
13
mkdocs.yml
Normal file
13
mkdocs.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
site_name: demo-vivek-11
|
||||
site_description: Modernized demo-vivek-11 service
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Architecture: architecture.md
|
||||
- API Reference: api.md
|
||||
|
||||
plugins:
|
||||
- techdocs-core
|
||||
|
||||
theme:
|
||||
name: material
|
||||
188
openapi.yaml
Normal file
188
openapi.yaml
Normal file
@@ -0,0 +1,188 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: demo-vivek-11
|
||||
description: Modernized demo-vivek-11 service
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://demo-vivek-11.kyndemo.live
|
||||
description: Production
|
||||
- url: http://localhost:8080
|
||||
description: Local development
|
||||
paths:
|
||||
/health:
|
||||
get:
|
||||
summary: Health check
|
||||
operationId: getHealth
|
||||
tags:
|
||||
- System
|
||||
responses:
|
||||
'200':
|
||||
description: Healthy
|
||||
/vets.html:
|
||||
get:
|
||||
summary: GET /vets.html
|
||||
operationId: getVets.html
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/owners/{ownerId}/owners/{ownerId}:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}/owners/{ownerId}
|
||||
operationId: getOwners_ownerId_owners_ownerId
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/owners/{ownerId}/pets/new:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}/pets/new
|
||||
operationId: getOwners_ownerId_pets_new
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/owners/{ownerId}/pets/{petId}/edit:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}/pets/{petId}/edit
|
||||
operationId: getOwners_ownerId_pets_petId_edit
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: petId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/owners/{ownerId}/pets/{petId}/visits/new:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}/pets/{petId}/visits/new
|
||||
operationId: getOwners_ownerId_pets_petId_visits_new
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: petId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/owners/new:
|
||||
get:
|
||||
summary: GET /owners/new
|
||||
operationId: getOwners_new
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/owners/find:
|
||||
get:
|
||||
summary: GET /owners/find
|
||||
operationId: getOwners_find
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/owners:
|
||||
get:
|
||||
summary: GET /owners
|
||||
operationId: getOwners
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/owners/{ownerId}/edit:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}/edit
|
||||
operationId: getOwners_ownerId_edit
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/owners/{ownerId}:
|
||||
get:
|
||||
summary: GET /owners/{ownerId}
|
||||
operationId: getOwners_ownerId
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
parameters:
|
||||
- name: ownerId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
/:
|
||||
get:
|
||||
summary: GET /
|
||||
operationId: getRoot
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/oups:
|
||||
get:
|
||||
summary: GET /oups
|
||||
operationId: getOups
|
||||
responses:
|
||||
'200':
|
||||
description: Success
|
||||
'400':
|
||||
description: Bad request
|
||||
/actuator/prometheus:
|
||||
get:
|
||||
summary: Prometheus metrics
|
||||
operationId: getMetrics
|
||||
tags:
|
||||
- System
|
||||
responses:
|
||||
'200':
|
||||
description: text/plain; Prometheus exposition format
|
||||
@@ -1,56 +0,0 @@
|
||||
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
|
||||
85
score.yaml
85
score.yaml
@@ -1,58 +1,41 @@
|
||||
apiVersion: score.dev/v1b1
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
labels:
|
||||
app: demo-vivek-11
|
||||
|
||||
containers:
|
||||
main:
|
||||
demo-vivek-11:
|
||||
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"
|
||||
DATABASE_URL: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.name}"
|
||||
|
||||
service:
|
||||
ports:
|
||||
web:
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
|
||||
SPRING_DATASOURCE_PASSWORD: ${resources.db.password}
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://${resources.db.hostname}:${resources.db.port}/${resources.db.database}
|
||||
SPRING_DATASOURCE_USERNAME: ${resources.db.username}
|
||||
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,app=demo-vivek-11
|
||||
OTEL_METRICS_EXPORTER: otlp
|
||||
OTEL_TRACES_EXPORTER: otlp
|
||||
OTEL_LOGS_EXPORTER: none
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/path: /metrics
|
||||
prometheus.io/port: '8080'
|
||||
prometheus.io/scrape: 'true'
|
||||
labels:
|
||||
app: demo-vivek-11
|
||||
backstage.io/kubernetes-id: demo-vivek-11
|
||||
name: demo-vivek-11
|
||||
resources:
|
||||
env:
|
||||
type: environment
|
||||
|
||||
# Gives the renovated workload a public HTTPS URL. Without this the deploy still goes
|
||||
# green and the pod still runs -- there is simply no Ingress, no certificate and no
|
||||
# hostname, so the demo's payoff (curl the renovated app) has nothing to hit.
|
||||
#
|
||||
# hostname is hardcoded to the apps domain deliberately: it is the only domain the apps
|
||||
# cluster serves, and both the wildcard A record (*.apps.dev) and the cert-manager
|
||||
# ClusterIssuer are scoped to exactly it.
|
||||
#
|
||||
# service_port is the Score `service.ports.web.port` below (80), NOT the container port.
|
||||
# An Ingress naming a Service or port that does not exist fails at neither plan nor
|
||||
# apply -- it surfaces only as nginx answering 503.
|
||||
#
|
||||
# CAVEAT: modernization-factory's generate_score_yaml rewrites BOTH `port` and
|
||||
# `targetPort` to the detected application port whenever that port is not 8080. An app
|
||||
# on 3000 therefore ends up with a Service on 3000 and this Ingress pointing at a port
|
||||
# that no longer exists. Apps already listening on 8080 (Spring PetClinic among them)
|
||||
# skip that patch entirely and are unaffected.
|
||||
ingress:
|
||||
type: workload-ingress
|
||||
params:
|
||||
name: demo-vivek-11
|
||||
hostname: demo-vivek-11.apps.dev.crucible.kyndemo.live
|
||||
service_name: demo-vivek-11
|
||||
service_port: 80
|
||||
db:
|
||||
type: postgres
|
||||
env:
|
||||
type: environment
|
||||
ingress:
|
||||
params:
|
||||
hostname: demo-vivek-11.apps.dev.crucible.kyndemo.live
|
||||
name: demo-vivek-11
|
||||
service_name: demo-vivek-11
|
||||
service_port: 8080
|
||||
type: workload-ingress
|
||||
service:
|
||||
ports:
|
||||
http:
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
|
||||
Reference in New Issue
Block a user