# Illustrative R2 consumer. Deploy only after exact common/V1 + releases/R2 gate.
# The publisher image, PVC, actual digest and launcher are deployment prerequisites.
# Mountability/sharing depends on CSI backend, access mode and node/zone topology.
apiVersion: v1
kind: Pod
metadata: {name: consumer-r2, namespace: domain-a}
spec:
  securityContext: {runAsUser: 1000, runAsGroup: 1000, fsGroup: 1000}
  containers:
    - name: consumer
      image: registry.example/consumer@sha256:4444444444444444444444444444444444444444444444444444444444444444
      command: [/opt/consumer/start]
      # These variable names are an illustrative launcher contract, not Kubernetes APIs.
      env:
        - {name: COMMON_ROOT, value: /artifacts/common/V1}
        - {name: RELEASE_ROOT, value: /artifacts/releases/R2}
        - {name: RUNTIME_WRITE_ROOT, value: /local}
      securityContext: {readOnlyRootFilesystem: true}
      volumeMounts:
        - {name: artifacts, mountPath: /artifacts/common/V1, subPath: common/V1, readOnly: true}
        - {name: artifacts, mountPath: /artifacts/releases/R2, subPath: releases/R2, readOnly: true}
        - {name: local, mountPath: /local} # expansion/config/work/temp/logs stay local
        - {name: tmp, mountPath: /tmp}
  volumes:
    - name: artifacts
      persistentVolumeClaim: {claimName: domain-a-artifacts, readOnly: true}
    - {name: local, emptyDir: {sizeLimit: 2Gi}}
    - {name: tmp, emptyDir: {sizeLimit: 128Mi}}
# R1 rollback selects its retained digest + common/V1 + releases/R1 explicitly.
# Read-only mounts protect this consumer view; storage ACLs must exclude other writers.
