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>
This commit is contained in:
@@ -12,7 +12,7 @@ browser ─► hub pe-gatewayapi (demo-vivek-11.apps.lab…) ─► Private Link
|
||||
|---|---|---|
|
||||
| `argocd/` | lab **hub** | `kubectl apply` once |
|
||||
| `hub/` | lab **hub** | `kubectl apply` once |
|
||||
| `manifests/` | lab **spoke** | Argo CD, from this repo |
|
||||
| `lab/` | lab **spoke** | Argo CD, from this repo. **Generated**: never edit by hand |
|
||||
|
||||
## Apply
|
||||
|
||||
@@ -31,7 +31,10 @@ The lab uses argocd-agent's **destination-based mapping**, and this app belongs
|
||||
- `destination.name: apps-lab`: the agent to deploy to, and the routing key. **Never**
|
||||
`destination.server`, which resolves to the hub itself.
|
||||
|
||||
## Image
|
||||
## How `lab/` is produced
|
||||
|
||||
`manifests/kustomization.yaml` pins the tag. Set it to the commit the lab build pushed, and commit:
|
||||
Argo CD deploys what is in Git.
|
||||
`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.
|
||||
|
||||
@@ -11,7 +11,7 @@ spec:
|
||||
source:
|
||||
repoURL: https://gitea.kyndemo.live/validate/demo-vivek-11.git
|
||||
targetRevision: main
|
||||
path: deploy/manifests
|
||||
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.
|
||||
|
||||
88
deploy/lab/deployment-demo-vivek-11.yaml
Normal file
88
deploy/lab/deployment-demo-vivek-11.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
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:
|
||||
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:9bc0bce407eb2e817eb2d8ccb17a03b51489893e
|
||||
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: {}
|
||||
27
deploy/lab/httproute-demo-vivek-11.yaml
Normal file
27
deploy/lab/httproute-demo-vivek-11.yaml
Normal 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: /
|
||||
8
deploy/lab/kustomization.yaml
Normal file
8
deploy/lab/kustomization.yaml
Normal 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
|
||||
20
deploy/lab/networkpolicy-demo-vivek-11.yaml
Normal file
20
deploy/lab/networkpolicy-demo-vivek-11.yaml
Normal 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
|
||||
21
deploy/lab/service-demo-vivek-11.yaml
Normal file
21
deploy/lab/service-demo-vivek-11.yaml
Normal 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: {}
|
||||
@@ -1,59 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
labels:
|
||||
app: demo-vivek-11
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: demo-vivek-11
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: demo-vivek-11
|
||||
spec:
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
containers:
|
||||
- name: main
|
||||
image: demo-vivek-11
|
||||
# Only while the tag is `latest`. Remove once kustomization.yaml pins a sha.
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
env:
|
||||
- name: OTEL_SERVICE_NAME
|
||||
value: demo-vivek-11
|
||||
- name: OTEL_EXPORTER_OTLP_ENDPOINT
|
||||
value: http://otel-collector.monitoring.svc.cluster.local:4318
|
||||
- name: OTEL_EXPORTER_OTLP_PROTOCOL
|
||||
value: http/protobuf
|
||||
- name: OTEL_RESOURCE_ATTRIBUTES
|
||||
value: service.name=demo-vivek-11
|
||||
- name: OTEL_METRICS_EXPORTER
|
||||
value: otlp
|
||||
- name: OTEL_TRACES_EXPORTER
|
||||
value: otlp
|
||||
- name: OTEL_LOGS_EXPORTER
|
||||
value: none
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: http
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /actuator/health
|
||||
port: http
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 20
|
||||
resources:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 512Mi
|
||||
limits:
|
||||
memory: 1Gi
|
||||
@@ -1,22 +0,0 @@
|
||||
# On the SPOKE's internal Gateway. The hub rewrites Host to this name before forwarding
|
||||
# (deploy/hub/remote-route.yaml), so it must match remote_hostname there.
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: pe-gatewayapi-int
|
||||
namespace: gatewayapi
|
||||
# The hub forwards plaintext to port 80 across Private Link.
|
||||
sectionName: http
|
||||
hostnames:
|
||||
- demo-vivek-11.int.apps.lab.crucible.kyndemo.live
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
- name: demo-vivek-11
|
||||
port: 80
|
||||
@@ -1,12 +0,0 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: demo-vivek-11
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- httproute.yaml
|
||||
images:
|
||||
- name: demo-vivek-11
|
||||
newName: cruciblecoredevacr.azurecr.io/demo-vivek-11
|
||||
# Replace with the commit sha "Build and Push to ACR (lab)" pushed.
|
||||
newTag: latest
|
||||
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: demo-vivek-11
|
||||
labels:
|
||||
app: demo-vivek-11
|
||||
spec:
|
||||
selector:
|
||||
app: demo-vivek-11
|
||||
ports:
|
||||
- name: web
|
||||
port: 80
|
||||
targetPort: http
|
||||
Reference in New Issue
Block a user