{
  "name": "kubernetes",
  "version": "0.2.0",
  "description": "How containers are scheduled, exposed, configured and secured on a Kubernetes cluster, and packaged with Helm: clusters, namespaces, workloads, services, ingresses, config, secrets, storage and access. Model what a designer decides; what the cluster creates for itself (pods, nodes, replica sets) is left out. Rules keep every object in a namespace and every workload running a container.",
  "license": "Apache-2.0",
  "publisher": "trumly",
  "namespace": "k8s",
  "tier": "verified",
  "role": "enrichment",
  "useWhen": "When containers run on a Kubernetes cluster and you need to say how they are scheduled, reached, configured and secured.",
  "enriches": [
    "design"
  ],
  "requires": [
    "core@^1.0.0",
    "containers@^0.1.0"
  ],
  "optional": [
    "hosting@^0.3.0",
    "links@^1.0.0",
    "naming@^0.2.0"
  ],
  "includes": [],
  "sha256": "148ede8d0ec1f590aafc194d390530e1e5faf01c406779b0bbaa54e9fe661a3e",
  "files": [
    [
      "k8s--derived-autoscaler-handle",
      "---\nid: k8s--derived-autoscaler-handle\ntype: derived\ntitle: Autoscaler handle\nfields:\n  name: autoscaler-handle\n  field-name: handle\n  description: An autoscaler takes the name of the workload it scales.\n  template: '{scales/title}'\n  applies_to:\n    type: autoscaler\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nAn autoscaler that scales no workload is reported incomplete.\n"
    ],
    [
      "k8s--derived-chart-handle",
      "---\nid: k8s--derived-chart-handle\ntype: derived\ntitle: Chart handle\nfields:\n  name: chart-handle\n  field-name: handle\n  description: A chart is named by its title.\n  template: '{title}'\n  applies_to:\n    type: chart\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nTitle the chart with the application it installs (`ops`).\n"
    ],
    [
      "k8s--derived-config-map-handle",
      "---\nid: k8s--derived-config-map-handle\ntype: derived\ntitle: Config map handle\nfields:\n  name: config-map-handle\n  field-name: handle\n  description: A config map is named for the workload that reads it, with -config.\n  template: '{^consumes/title}-config'\n  applies_to:\n    type: config-map\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nA config map no workload consumes is reported incomplete.\n"
    ],
    [
      "k8s--derived-handle",
      "---\nid: k8s--derived-handle\ntype: derived\ntitle: Namespace handle\nfields:\n  name: namespace-handle\n  field-name: handle\n  description: 'The name a namespace has in each environment: its own name and the code of the environment its cluster serves.'\n  template: '{title}-{belongs-to/runs-in/code}'\n  applies_to:\n    type: namespace\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nA namespace is titled with its name (`ops`). The environment comes through its cluster: the cluster it belongs to runs in an environment, and the environment's `code` is the last part. Until the environment has a code the handle is reported incomplete.\n"
    ],
    [
      "k8s--derived-ingress-handle",
      "---\nid: k8s--derived-ingress-handle\ntype: derived\ntitle: Ingress handle\nfields:\n  name: ingress-handle\n  field-name: handle\n  description: An ingress takes the name of the workload behind the service it routes to.\n  template: '{routes-to/exposes/title}'\n  applies_to:\n    type: ingress\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nAn ingress that routes to no service, or to a service that exposes no workload, is reported incomplete.\n"
    ],
    [
      "k8s--derived-release-handle",
      "---\nid: k8s--derived-release-handle\ntype: derived\ntitle: Release handle\nfields:\n  name: release-handle\n  field-name: handle\n  description: A release is named for its chart and the environment code of the namespace it installs into.\n  template: '{installs/title}-{belongs-to/belongs-to/runs-in/code}'\n  applies_to:\n    type: release\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nSo two environments can install the same chart side by side (`ops-prd`, `ops-dev`).\n"
    ],
    [
      "k8s--derived-secret-handle",
      "---\nid: k8s--derived-secret-handle\ntype: derived\ntitle: Secret handle\nfields:\n  name: secret-handle\n  field-name: handle\n  description: A secret is named for the workload that reads it and its own title.\n  template: '{^consumes/title}-{title}'\n  applies_to:\n    type: secret\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nTitle the secret with what it holds (`db`, `tls`) and it comes out as `ops-api-db`. Never put the value or the vault path in the name.\n"
    ],
    [
      "k8s--derived-service-account-handle",
      "---\nid: k8s--derived-service-account-handle\ntype: derived\ntitle: Service account handle\nfields:\n  name: service-account-handle\n  field-name: handle\n  description: A service account takes the name of the workload that runs as it.\n  template: '{^consumes/title}'\n  applies_to:\n    type: service-account\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nA service account no workload consumes is reported incomplete.\n"
    ],
    [
      "k8s--derived-service-handle",
      "---\nid: k8s--derived-service-handle\ntype: derived\ntitle: Service handle\nfields:\n  name: service-handle\n  field-name: handle\n  description: A service takes the name of the workload it exposes.\n  template: '{exposes/title}'\n  applies_to:\n    type: service\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nA service that exposes no workload is reported incomplete.\n"
    ],
    [
      "k8s--derived-volume-claim-handle",
      "---\nid: k8s--derived-volume-claim-handle\ntype: derived\ntitle: Volume claim handle\nfields:\n  name: volume-claim-handle\n  field-name: handle\n  description: A volume claim is named for the workload that mounts it and its own title.\n  template: '{^mounts/title}-{title}'\n  applies_to:\n    type: persistent-volume-claim\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nTitle the claim with what it keeps (`data`) and it comes out as `ops-cache-data`.\n"
    ],
    [
      "k8s--derived-workload-handle",
      "---\nid: k8s--derived-workload-handle\ntype: derived\ntitle: Workload handle\nfields:\n  name: workload-handle\n  field-name: handle\n  description: A workload is named by its title, the name the cluster knows it by.\n  template: '{title}'\n  applies_to:\n    type: workload\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nTitle the workload with its name (`ops-api`). Deployments, stateful sets, daemon sets, jobs and cron jobs all use the same rule, so labelling a map by `handle` names every Kubernetes object, workloads included.\n"
    ],
    [
      "k8s--derived-workload-labels",
      "---\nid: k8s--derived-workload-labels\ntype: derived\ntitle: Workload labels\nfields:\n  name: workload-labels\n  field-name: labels\n  description: The Kubernetes recommended labels for a workload, worked out from its name, its environment and its namespace.\n  template: 'app.kubernetes.io/name={title}, app.kubernetes.io/instance={title}-{belongs-to/belongs-to/runs-in/code}, app.kubernetes.io/part-of={belongs-to/title}'\n  applies_to:\n    type: workload\n  enabled: true\n  pack: kubernetes@0.2.0\n---\nPut these on the workload and on everything it owns, so tools can group them. `instance` adds the environment code (ops-api-prd).\n"
    ],
    [
      "k8s--helm",
      "---\nid: k8s--helm\ntype: plane\ntitle: Helm\nfields:\n  order: 2\n  stack: Kubernetes\n  shapes:\n    chart: folder\n    release: hexagon\n  pack: kubernetes@0.2.0\n---\nHow a set of Kubernetes objects is packaged (a chart) and installed (a release) as one versioned unit.\n"
    ],
    [
      "k8s--kubernetes",
      "---\nid: k8s--kubernetes\ntype: plane\ntitle: Kubernetes\nfields:\n  order: 1\n  stack: Kubernetes\n  shapes:\n    autoscaler: triangle\n    cluster: cloud\n    config-map: document\n    ingress: pipe\n    namespace: folder\n    network-policy: shield\n    nodepool: circle\n    persistent-volume-claim: database\n    role: person\n    role-binding: person\n    secret: star\n    service: pipe\n    service-account: person\n    workload: diamond\n  pack: kubernetes@0.2.0\n---\nHow containers are scheduled, exposed, configured and secured on a Kubernetes cluster. Model what a designer decides (workloads, services, configuration, access). Do not model what the cluster creates for itself, such as pods, nodes and replica sets.\n"
    ],
    [
      "k8s--link-type-bundles",
      "---\nid: k8s--link-type-bundles\ntype: link-type\ntitle: bundles\nfields:\n  name: bundles\n  description: Use to say which Kubernetes objects a Helm chart contains.\n  inverse: bundled in\n  from:\n  - chart\n  to:\n  - workload\n  - service\n  - ingress\n  - config-map\n  - secret\n  - autoscaler\n  - persistent-volume-claim\n  - service-account\n  - role\n  - role-binding\n  - network-policy\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-grants-to",
      "---\nid: k8s--link-type-grants-to\ntype: link-type\ntitle: grants-to\nfields:\n  name: grants-to\n  description: Use to say which identity a role binding gives its role to.\n  inverse: receives\n  from:\n  - role-binding\n  to:\n  - service-account\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-grants",
      "---\nid: k8s--link-type-grants\ntype: link-type\ntitle: grants\nfields:\n  name: grants\n  description: Use to say which role a role binding gives out.\n  inverse: granted by\n  from:\n  - role-binding\n  to:\n  - role\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-installs",
      "---\nid: k8s--link-type-installs\ntype: link-type\ntitle: installs\nfields:\n  name: installs\n  description: Use to say which chart a release is an installed copy of.\n  inverse: installed by\n  from:\n  - release\n  to:\n  - chart\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-protects",
      "---\nid: k8s--link-type-protects\ntype: link-type\ntitle: protects\nfields:\n  name: protects\n  description: Use to say which workloads a network policy limits traffic to and from.\n  inverse: protected by\n  from:\n  - network-policy\n  to:\n  - workload\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-routes-to",
      "---\nid: k8s--link-type-routes-to\ntype: link-type\ntitle: routes-to\nfields:\n  name: routes-to\n  description: Use to say which service an ingress sends outside traffic to.\n  inverse: receives traffic from\n  from:\n  - ingress\n  to:\n  - service\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--link-type-scales",
      "---\nid: k8s--link-type-scales\ntype: link-type\ntitle: scales\nfields:\n  name: scales\n  description: Use to say which workload an autoscaler resizes.\n  inverse: scaled by\n  from:\n  - autoscaler\n  to:\n  - workload\n  pack: kubernetes@0.2.0\n---\n\n"
    ],
    [
      "k8s--names",
      "---\nid: k8s--names\ntype: plane\ntitle: Kubernetes names\nfields:\n  order: 7\n  stack: Naming\n  shapes:\n    name-pattern: document\n  pack: kubernetes@0.2.0\n---\nHow Kubernetes things are named: the patterns the kubernetes pack ships. Descriptive only.\n"
    ],
    [
      "k8s--pack",
      "---\nid: k8s--pack\ntype: pack\ntitle: Kubernetes\nfields:\n  name: kubernetes\n  namespace: k8s\n  version: 0.2.0\n  license: Apache-2.0\n  publisher: trumly\n  default-pattern: starter-cluster\n  starter-patterns:\n  - starter-cluster\n  - naming-kubernetes\n  role: enrichment\n  enriches:\n  - design\n  description: 'How containers are scheduled, exposed, configured and secured on a Kubernetes cluster,\n    and packaged with Helm: clusters, namespaces, workloads, services, ingresses, config, secrets, storage\n    and access. Model what a designer decides; what the cluster creates for itself (pods, nodes, replica\n    sets) is left out. Rules keep every object in a namespace and every workload running a container.'\n  use-when: When containers run on a Kubernetes cluster and you need to say how they are scheduled, reached,\n    configured and secured.\n  requires:\n  - core@^1.0.0\n  - containers@^0.1.0\n  optional:\n  - hosting@^0.3.0\n  - links@^1.0.0\n  - naming@^0.2.0\n---\n\n"
    ],
    [
      "k8s--rule-autoscaler-bounds-ordered",
      "---\nid: k8s--rule-autoscaler-bounds-ordered\ntype: rule\ntitle: Autoscaler bounds in order\nfields:\n  name: Autoscaler bounds in order\n  statement: An autoscaler's minimum is not above its maximum\n  severity: error\n  applies_to:\n    type: autoscaler\n  check:\n    compare_fields:\n      left: min-replicas\n      op: <=\n      right: max-replicas\n  pack: kubernetes@0.2.0\n---\n**Fix:** check the `min-replicas` and `max-replicas` fields.\n"
    ],
    [
      "k8s--rule-autoscaler-scales-workload",
      "---\nid: k8s--rule-autoscaler-scales-workload\ntype: rule\ntitle: Autoscalers scale a workload\nfields:\n  name: Autoscalers scale a workload\n  statement: Every autoscaler scales exactly one workload\n  severity: error\n  applies_to:\n    type: autoscaler\n  check:\n    require_link:\n      min: 1\n      type: scales\n      max: 1\n      node_type: workload\n  pack: kubernetes@0.2.0\n---\n**Fix:** add a `scales` link to the workload it resizes.\n"
    ],
    [
      "k8s--rule-chart-bundles-objects",
      "---\nid: k8s--rule-chart-bundles-objects\ntype: rule\ntitle: Charts bundle something\nfields:\n  name: Charts bundle something\n  statement: Every chart bundles at least one object\n  severity: warn\n  applies_to:\n    type: chart\n  check:\n    require_link:\n      min: 1\n      type: bundles\n  pack: kubernetes@0.2.0\n---\n**Fix:** add `bundles` links to the workloads, services and config the chart contains.\n"
    ],
    [
      "k8s--rule-cluster-runs-somewhere",
      "---\nid: k8s--rule-cluster-runs-somewhere\ntype: rule\ntitle: Clusters say where they run\nfields:\n  name: Clusters say where they run\n  statement: Every cluster says what provides it\n  severity: warn\n  applies_to:\n    type: cluster\n  check:\n    any_of:\n    - require_link:\n        type: runs-in\n        node_type: cloud-service\n        min: 1\n        max: 1\n    - require_link:\n        type: runs-in\n        node_type: host\n        min: 1\n        max: 1\n  pack: kubernetes@0.2.0\n---\n**Why:** this ties the cluster to where it physically lives, so cost, region and ownership can be traced.\n\n**Fix:** add a `runs-in` link to the managed Kubernetes cloud service (with the hosting pack), or to a host for a self-built cluster.\n"
    ],
    [
      "k8s--rule-cron-job-has-schedule",
      "---\nid: k8s--rule-cron-job-has-schedule\ntype: rule\ntitle: Cron jobs have a schedule\nfields:\n  name: Cron jobs have a schedule\n  statement: Every cron-job workload has a schedule\n  severity: error\n  applies_to:\n    type: workload\n    kind: cron-job\n  check:\n    require_fields:\n    - schedule\n  pack: kubernetes@0.2.0\n---\n**Fix:** fill in the `schedule` field, for example `0 2 * * *` for 2am daily.\n"
    ],
    [
      "k8s--rule-ingress-routes-to-service",
      "---\nid: k8s--rule-ingress-routes-to-service\ntype: rule\ntitle: Ingresses route to a service\nfields:\n  name: Ingresses route to a service\n  statement: Every ingress routes to a service\n  severity: warn\n  applies_to:\n    type: ingress\n  check:\n    require_link:\n      min: 1\n      type: routes-to\n      node_type: service\n  pack: kubernetes@0.2.0\n---\n**Why:** an ingress receives outside traffic and must hand it to something.\n\n**Fix:** add a `routes-to` link to a service.\n"
    ],
    [
      "k8s--rule-names-fit",
      "---\nid: k8s--rule-names-fit\ntype: rule\ntitle: Names fit the Kubernetes limit\nfields:\n  name: Names fit the Kubernetes limit\n  statement: A namespace or service name is at most 63 characters\n  severity: warn\n  applies_to:\n    type:\n    - namespace\n    - service\n  check:\n    field_is:\n      handle:\n        max_length: 63\n        optional: true\n  pack: kubernetes@0.2.0\n---\n**Why:** namespaces and services are DNS labels, which Kubernetes limits to 63 characters.\n\n**Fix:** shorten the title or the environment code in the name.\n"
    ],
    [
      "k8s--rule-namespace-in-cluster",
      "---\nid: k8s--rule-namespace-in-cluster\ntype: rule\ntitle: Namespaces are in a cluster\nfields:\n  name: Namespaces are in a cluster\n  statement: Every namespace belongs to exactly one cluster\n  severity: error\n  applies_to:\n    type: namespace\n  check:\n    require_link:\n      min: 1\n      type: belongs-to\n      max: 1\n      node_type: cluster\n  pack: kubernetes@0.2.0\n---\n**Why:** a namespace only exists inside a cluster.\n\n**Fix:** add a `belongs-to` link to a cluster.\n"
    ],
    [
      "k8s--rule-nodepool-in-cluster",
      "---\nid: k8s--rule-nodepool-in-cluster\ntype: rule\ntitle: Nodepools are in a cluster\nfields:\n  name: Nodepools are in a cluster\n  statement: Every nodepool belongs to a cluster\n  severity: warn\n  applies_to:\n    type: nodepool\n  check:\n    require_link:\n      min: 1\n      type: belongs-to\n      max: 1\n      node_type: cluster\n  pack: kubernetes@0.2.0\n---\n**Fix:** add a `belongs-to` link to a cluster.\n"
    ],
    [
      "k8s--rule-release-installs-chart-in-namespace",
      "---\nid: k8s--rule-release-installs-chart-in-namespace\ntype: rule\ntitle: Releases install one chart\nfields:\n  name: Releases install one chart\n  statement: Every release installs one chart into one namespace\n  severity: error\n  applies_to:\n    type: release\n  check:\n    require_link:\n    - min: 1\n      type: installs\n      max: 1\n      node_type: chart\n    - min: 1\n      type: belongs-to\n      max: 1\n      node_type: namespace\n  pack: kubernetes@0.2.0\n---\n**Fix:** add an `installs` link to the chart and a `belongs-to` link to the namespace.\n"
    ],
    [
      "k8s--rule-release-name-fits",
      "---\nid: k8s--rule-release-name-fits\ntype: rule\ntitle: Release names fit Helm's limit\nfields:\n  name: Release names fit Helm's limit\n  statement: A release name is at most 53 characters\n  severity: warn\n  applies_to:\n    type: release\n  check:\n    field_is:\n      handle:\n        max_length: 53\n        optional: true\n  pack: kubernetes@0.2.0\n---\n**Why:** Helm refuses release names longer than 53 characters.\n\n**Fix:** shorten the chart title or the environment code in the name.\n"
    ],
    [
      "k8s--rule-role-binding-grants-role-to-identity",
      "---\nid: k8s--rule-role-binding-grants-role-to-identity\ntype: rule\ntitle: Bindings give a role out\nfields:\n  name: Bindings give a role out\n  statement: Every role binding gives one role to at least one identity\n  severity: error\n  applies_to:\n    type: role-binding\n  check:\n    require_link:\n    - min: 1\n      type: grants\n      max: 1\n      node_type: role\n    - min: 1\n      type: grants-to\n      node_type: service-account\n  pack: kubernetes@0.2.0\n---\n**Why:** a role does nothing until a binding attaches it to an identity.\n\n**Fix:** add a `grants` link to the role and a `grants-to` link to the service account.\n"
    ],
    [
      "k8s--rule-secret-records-source",
      "---\nid: k8s--rule-secret-records-source\ntype: rule\ntitle: Secrets say where they live\nfields:\n  name: Secrets say where they live\n  statement: Every secret records where its value is kept\n  severity: error\n  applies_to:\n    type: secret\n  check:\n    require_fields:\n    - source\n  pack: kubernetes@0.2.0\n---\n**Why:** the model never holds secret values, but it must say where the real one lives so someone can find and rotate it.\n\n**Fix:** fill in the `source` field, for example a key vault path.\n"
    ],
    [
      "k8s--rule-service-exposes-workload",
      "---\nid: k8s--rule-service-exposes-workload\ntype: rule\ntitle: Services expose a workload\nfields:\n  name: Services expose a workload\n  statement: Every service exposes a workload\n  severity: warn\n  applies_to:\n    type: service\n  check:\n    require_link:\n      min: 1\n      type: exposes\n      node_type: workload\n  pack: kubernetes@0.2.0\n---\n**Why:** a service with nothing behind it is an address that goes nowhere.\n\n**Fix:** add an `exposes` link to the workload that receives the traffic.\n"
    ],
    [
      "k8s--rule-stateful-workload-mounts-storage",
      "---\nid: k8s--rule-stateful-workload-mounts-storage\ntype: rule\ntitle: Stateful sets keep storage\nfields:\n  name: Stateful sets keep storage\n  statement: Every stateful set mounts a persistent volume claim\n  severity: warn\n  applies_to:\n    type: workload\n    kind: stateful-set\n  check:\n    require_link:\n      min: 1\n      type: mounts\n      node_type: persistent-volume-claim\n  pack: kubernetes@0.2.0\n---\n**Why:** a stateful set exists because it keeps data. Without durable storage that data is lost when it restarts.\n\n**Fix:** add a `mounts` link to a persistent volume claim.\n"
    ],
    [
      "k8s--rule-workload-has-container",
      "---\nid: k8s--rule-workload-has-container\ntype: rule\ntitle: Workloads run a container\nfields:\n  name: Workloads run a container\n  statement: Every workload runs at least one container\n  severity: error\n  applies_to:\n    type: workload\n  check:\n    require_link:\n      min: 1\n      type: runs-in\n      node_type: container\n      dir: in\n  pack: kubernetes@0.2.0\n---\n**Why:** a workload is a request to run something. If nothing says what, the design is incomplete.\n\n**Fix:** add a container that `runs-in` the workload.\n"
    ],
    [
      "k8s--rule-workload-in-namespace",
      "---\nid: k8s--rule-workload-in-namespace\ntype: rule\ntitle: Workloads are in a namespace\nfields:\n  name: Workloads are in a namespace\n  statement: Every workload belongs to exactly one namespace\n  severity: error\n  applies_to:\n    type: workload\n  check:\n    require_link:\n      min: 1\n      type: belongs-to\n      max: 1\n      node_type: namespace\n  pack: kubernetes@0.2.0\n---\n**Why:** namespaces carry the access rules and resource limits that apply to a workload.\n\n**Fix:** add a `belongs-to` link to a namespace.\n"
    ],
    [
      "k8s--rule-workload-realises-design",
      "---\nid: k8s--rule-workload-realises-design\ntype: rule\ntitle: Workloads realise design\nfields:\n  name: Workloads realise design\n  statement: Every workload details a component or a datastore\n  severity: warn\n  applies_to:\n    type: workload\n  check:\n    any_of:\n    - require_link:\n        min: 1\n        type: details\n        node_type: component\n    - require_link:\n        min: 1\n        type: details\n        node_type: datastore\n  pack: kubernetes@0.2.0\n---\n**Why:** a workload that realises nothing in the design is something the cluster runs for no stated reason, and nobody can trace a change in the design to what runs.\n\n**Fix:** add a `details` link to the component it runs, or to the datastore it is (a database or cache run in the cluster).\n"
    ],
    [
      "k8s--type-autoscaler",
      "---\nid: k8s--type-autoscaler\ntype: type\ntitle: autoscaler\nfields:\n  name: autoscaler\n  plane: k8s--kubernetes\n  description: Use when a workload should add or remove copies of itself automatically as load changes.\n    Skip it for workloads with a fixed size.\n  fields:\n  - name: min-replicas\n    kind: number\n    required: true\n  - name: max-replicas\n    kind: number\n    required: true\n  - name: metric\n    kind: choice\n    values:\n    - cpu\n    - memory\n    - custom\n  - name: target\n    kind: text\n    label: Target (e.g. 70%)\n  pack: kubernetes@0.2.0\n---\n**Ask:** What load pattern do you expect? What are the smallest and largest sensible sizes? What measurement triggers scaling?\n\nKubernetes calls this a HorizontalPodAutoscaler.\n"
    ],
    [
      "k8s--type-chart",
      "---\nid: k8s--type-chart\ntype: type\ntitle: chart\nfields:\n  name: chart\n  plane: k8s--helm\n  description: Use for a reusable, versioned package of Kubernetes objects (workloads, services, config)\n    that can be installed again and again with different settings.\n  fields:\n  - name: version\n    kind: text\n    required: true\n  - name: repository\n    kind: text\n  pack: kubernetes@0.2.0\n---\n**Ask:** Which Kubernetes objects belong together as one installable unit? What settings can vary between installs?\n\nLink it to what it contains with `bundles`.\n"
    ],
    [
      "k8s--type-cluster",
      "---\nid: k8s--type-cluster\ntype: type\ntitle: cluster\nfields:\n  name: cluster\n  plane: k8s--kubernetes\n  description: 'Use for one Kubernetes cluster: the set of machines and the control plane that runs your\n    workloads. Usually one per environment, or one shared by several.'\n  fields:\n  - name: version\n    kind: text\n    label: Kubernetes version\n  - name: distribution\n    kind: choice\n    values:\n    - aks\n    - eks\n    - gke\n    - k3s\n    - other\n  pack: kubernetes@0.2.0\n---\n**Ask:** Which cloud service provides it? Which Kubernetes version? How many clusters per environment?\n\nLink it to what provides it with `runs-in`: the managed Kubernetes cloud service, or a host for a self-built cluster. You do not need to model the machines in it; use `nodepool` for the groups that matter.\n"
    ],
    [
      "k8s--type-config-map",
      "---\nid: k8s--type-config-map\ntype: type\ntitle: config-map\nfields:\n  name: config-map\n  plane: k8s--kubernetes\n  description: Use for non-confidential settings a workload reads at start-up, such as feature switches,\n    URLs and log levels, kept outside the image so they can change without a rebuild.\n  fields:\n  - name: purpose\n    kind: text\n  pack: kubernetes@0.2.0\n---\n**Ask:** What settings differ between environments? Which workloads need them?\n\n**Watch for:** anything confidential. Passwords and keys belong in a secret.\n"
    ],
    [
      "k8s--type-ingress",
      "---\nid: k8s--type-ingress\ntype: type\ntitle: ingress\nfields:\n  name: ingress\n  plane: k8s--kubernetes\n  description: Use for the public front door that routes outside web traffic by hostname and path to a\n    service inside the cluster. Skip it for anything that is only used internally.\n  fields:\n  - name: host\n    kind: text\n    label: Hostname\n    required: true\n  - name: tls\n    kind: boolean\n    label: HTTPS\n  - name: controller\n    kind: text\n    label: Ingress controller\n  pack: kubernetes@0.2.0\n---\n**Ask:** What hostname do people use? Does it need HTTPS? Which service receives the traffic?\n\nThe controller field replaces a separate ingress-class type.\n"
    ],
    [
      "k8s--type-namespace",
      "---\nid: k8s--type-namespace\ntype: type\ntitle: namespace\nfields:\n  name: namespace\n  plane: k8s--kubernetes\n  description: Use for a named partition of a cluster that keeps one team, environment or application\n    separate from the others, with its own access rules and resources.\n  fields:\n  - name: purpose\n    kind: text\n  pack: kubernetes@0.2.0\n---\n**Ask:** What does it separate: teams, environments or applications? Who may use it?\n\nEvery workload, service, config and secret belongs to one namespace, and each namespace belongs to one cluster.\n"
    ],
    [
      "k8s--type-network-policy",
      "---\nid: k8s--type-network-policy\ntype: type\ntitle: network-policy\nfields:\n  name: network-policy\n  plane: k8s--kubernetes\n  description: Use to limit which workloads may talk to each other, so a break-in to one does not open\n    up the rest.\n  fields:\n  - name: stance\n    kind: choice\n    required: true\n    values:\n    - deny-by-default\n    - allow-all\n  - name: allows\n    kind: text\n    label: What is allowed, in plain words\n  pack: kubernetes@0.2.0\n---\n**Ask:** Which workloads may talk to which? Is the default open or closed?\n\nLink it to the workloads it protects with `protects`. A deny-by-default stance is the safer start.\n"
    ],
    [
      "k8s--type-nodepool",
      "---\nid: k8s--type-nodepool\ntype: type\ntitle: nodepool\nfields:\n  name: nodepool\n  plane: k8s--kubernetes\n  description: Use for a group of identical machines inside a cluster, when different kinds of work need\n    different sizes or hardware, such as a small system pool and a larger application pool.\n  fields:\n  - name: vm-size\n    kind: text\n  - name: min-nodes\n    kind: number\n  - name: max-nodes\n    kind: number\n  - name: purpose\n    kind: choice\n    values:\n    - system\n    - application\n    - batch\n    - gpu\n  pack: kubernetes@0.2.0\n---\n**Ask:** What kind of work runs here? How many machines at minimum and maximum? Does anything need special hardware?\n\nIndividual nodes are created by the cloud, so they are not modelled.\n"
    ],
    [
      "k8s--type-persistent-volume-claim",
      "---\nid: k8s--type-persistent-volume-claim\ntype: type\ntitle: persistent-volume-claim\nfields:\n  name: persistent-volume-claim\n  plane: k8s--kubernetes\n  description: Use for a request for durable storage that outlives any one copy of a workload, such as\n    a database's data disk. It states how much and what kind of storage is needed.\n  fields:\n  - name: size\n    kind: text\n    required: true\n  - name: access-mode\n    kind: choice\n    values:\n    - read-write-once\n    - read-only-many\n    - read-write-many\n  - name: storage-class\n    kind: text\n  pack: kubernetes@0.2.0\n---\n**Ask:** What data is stored? How much? Must it survive the workload being replaced or moved?\n\nThe cluster or cloud provides the actual disk (a persistent volume), so only the request is modelled. Stateful workloads almost always need one.\n"
    ],
    [
      "k8s--type-release",
      "---\nid: k8s--type-release\ntype: type\ntitle: release\nfields:\n  name: release\n  plane: k8s--helm\n  description: Use for one installed copy of a chart in a particular namespace, with its own settings.\n    The same chart installed in test and in production is two releases.\n  fields:\n  - name: chart-version\n    kind: text\n  - name: values-file\n    kind: text\n    label: Settings file\n  pack: kubernetes@0.2.0\n---\n**Ask:** Which chart and version? Into which namespace? Which settings differ from the defaults?\n\nLink it to the chart with `installs` and to its namespace with `belongs-to`. One chart can have a release per environment.\n"
    ],
    [
      "k8s--type-role-binding",
      "---\nid: k8s--type-role-binding\ntype: type\ntitle: role-binding\nfields:\n  name: role-binding\n  plane: k8s--kubernetes\n  description: Use to give an identity a role. This is the step that actually grants the permissions.\n  fields:\n  - name: scope\n    kind: choice\n    required: true\n    values:\n    - namespace\n    - cluster\n  pack: kubernetes@0.2.0\n---\n**Ask:** Which identity gets which role, and where?\n\nLink it to the role with `grants` and to the identity with `grants-to`. Covers role bindings and cluster role bindings through `scope`.\n"
    ],
    [
      "k8s--type-role",
      "---\nid: k8s--type-role\ntype: type\ntitle: role\nfields:\n  name: role\n  plane: k8s--kubernetes\n  description: Use for a named set of permissions, such as 'read pods'. It grants nothing until a role\n    binding attaches it to an identity.\n  fields:\n  - name: scope\n    kind: choice\n    required: true\n    values:\n    - namespace\n    - cluster\n  - name: permissions\n    kind: text\n    label: What it allows, in plain words\n    required: true\n  pack: kubernetes@0.2.0\n---\n**Ask:** What exactly must be allowed? Choose the narrowest scope: one namespace if you can.\n\nThis single type covers both Kubernetes roles (`scope: namespace`) and cluster roles (`scope: cluster`).\n"
    ],
    [
      "k8s--type-secret",
      "---\nid: k8s--type-secret\ntype: type\ntitle: secret\nfields:\n  name: secret\n  plane: k8s--kubernetes\n  description: Use for confidential values a workload needs, such as passwords, tokens and keys. The model\n    records that the secret exists and where its real value is kept, never the value itself.\n  fields:\n  - name: source\n    kind: text\n    label: Where the value is kept\n    required: true\n  - name: rotation\n    kind: text\n    label: Rotation\n  pack: kubernetes@0.2.0\n---\n**Ask:** What does it protect? Where is the real value kept? Who rotates it, and how often?\n\nThe value itself is never written in the model. Record where it lives (for example a key vault path) in `source`.\n"
    ],
    [
      "k8s--type-service-account",
      "---\nid: k8s--type-service-account\ntype: type\ntitle: service-account\nfields:\n  name: service-account\n  plane: k8s--kubernetes\n  description: Use for the identity a workload runs as when it talks to the cluster itself. Needed whenever\n    a workload must be allowed to do something, or when you want to keep its permissions separate.\n  fields:\n  - name: purpose\n    kind: text\n  pack: kubernetes@0.2.0\n---\n**Ask:** What does this workload need to be allowed to do inside the cluster? Give each workload its own account rather than sharing.\n\nGrant permissions by linking a role binding to it with `grants-to`.\n"
    ],
    [
      "k8s--type-service",
      "---\nid: k8s--type-service\ntype: type\ntitle: service\nfields:\n  name: service\n  plane: k8s--kubernetes\n  description: Use for the stable internal address through which other things reach a workload, because\n    the workload's copies come and go. Every workload that receives traffic needs one.\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - cluster-ip\n    - node-port\n    - load-balancer\n  - name: port\n    kind: number\n    required: true\n  pack: kubernetes@0.2.0\n---\n**Ask:** Who calls it: other things in the cluster, or the outside world? On which port?\n\nThis is a Kubernetes service (a stable address), not a business service or a cloud service.\n"
    ],
    [
      "k8s--type-workload",
      "---\nid: k8s--type-workload\ntype: type\ntitle: workload\nfields:\n  name: workload\n  plane: k8s--kubernetes\n  description: 'Use for anything you ask the cluster to run: an API, a worker, a database, a one-off task\n    or a scheduled job. The kind says how it runs. This replaces separate deployment, stateful-set, daemon-set,\n    job and cron-job types.'\n  fields:\n  - name: kind\n    kind: choice\n    required: true\n    values:\n    - deployment\n    - stateful-set\n    - daemon-set\n    - job\n    - cron-job\n  - name: replicas\n    kind: number\n    label: Copies\n  - name: schedule\n    kind: text\n    label: Schedule (cron-job only)\n  pack: kubernetes@0.2.0\n---\n**Ask:** Does it run all the time, once, or on a schedule? Does it keep its own data? How many copies?\n\n- **deployment**: stateless, runs continuously (most web apps and APIs).\n- **stateful-set**: runs continuously and keeps its own storage and identity (databases, queues).\n- **daemon-set**: one copy on every machine (log or monitoring agents).\n- **job**: runs once to completion (a migration).\n- **cron-job**: runs on a schedule (a nightly report).\n\nLink its containers with `runs-in` (from the container), its namespace with `belongs-to`, and config, secrets and its service account with `consumes`. Pods are created by the cluster and are not modelled.\n"
    ],
    [
      "examples/ops-api-kubernetes/acceptance-criterion-jobs-listed",
      "---\nid: acceptance-criterion-jobs-listed\ntype: acceptance-criterion\ntitle: Jobs listed\nplane: def--requirements\nfields:\n  given: A job has just changed state\n  when: Ops staff open the job list\n  then: The job and its new state are shown within 60 seconds\n  method: test\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/actor-ops-staff",
      "---\nid: actor-ops-staff\ntype: actor\ntitle: Ops staff\nplane: def--capabilities\nlinks:\n- type: uses\n  to: component-ops-api\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/assumption-job-volume",
      "---\nid: assumption-job-volume\ntype: assumption\ntitle: Job volume stays modest\nplane: def--intent\nfields:\n  statement: No more than 5,000 jobs run each night.\n  how-to-check: Count the nightly jobs for a month\n  owner: Platform\n  state: open\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/autoscaler-ops-api",
      "---\nid: autoscaler-ops-api\ntype: autoscaler\ntitle: API autoscaler\nplane: k8s--kubernetes\nfields:\n  min-replicas: 3\n  max-replicas: 10\n  metric: cpu\n  target: 70%\nlinks:\n- type: scales\n  to: workload-ops-api\n- type: belongs-to\n  to: namespace-ops\n---\nAdds copies of the API when CPU stays above 70%.\n"
    ],
    [
      "examples/ops-api-kubernetes/capability-view-job-status",
      "---\nid: capability-view-job-status\ntype: capability\ntitle: View job status\nplane: def--capabilities\nfields:\n  statement: view the current status of every job\n  scope: in\n  priority: must\n  status: proposed\nlinks:\n- type: performed-by\n  to: actor-ops-staff\n- type: derives-from\n  to: goal-timely-visibility\n- type: refers-to\n  to: concept-job\n- type: relies-on\n  to: assumption-job-volume\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/chart-ops",
      "---\nid: chart-ops\ntype: chart\ntitle: ops\nplane: k8s--helm\nfields:\n  version: 0.3.0\nlinks:\n- type: bundles\n  to: workload-ops-api\n- type: bundles\n  to: service-ops-api\n- type: bundles\n  to: config-map-ops-api\n- type: bundles\n  to: autoscaler-ops-api\n- type: bundles\n  to: service-account-ops-api\n- type: bundles\n  to: network-policy-ops-default\n---\nEverything needed to run the API, packaged so it can be installed the same way in every environment. The ingress is left out and defined per environment.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-provider-aws",
      "---\nid: cloud-provider-aws\ntype: cloud-provider\ntitle: AWS\nplane: hst--hosting\nfields:\n  kind: public-cloud\n  account: ops-production\nlinks:\n- type: details\n  to: environment-production\n---\nThe account that hosts production.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-service-apprunner",
      "---\nid: cloud-service-apprunner\ntype: cloud-service\ntitle: AWS App Runner\nplane: hst--hosting\nfields:\n  service: AWS App Runner\n  kind: compute\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: component-ops-api\n- type: in-region\n  to: region-london\n---\nA managed container service with no cluster to look after. Used for a lightweight preview copy of the API.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-service-ecr",
      "---\nid: cloud-service-ecr\ntype: cloud-service\ntitle: Amazon ECR\nplane: hst--hosting\nfields:\n  service: Amazon ECR\n  kind: storage\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: component-ops-api\n- type: in-region\n  to: region-london\n---\nStores the container images for the API and the cache.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-service-eks",
      "---\nid: cloud-service-eks\ntype: cloud-service\ntitle: Amazon EKS\nplane: hst--hosting\nfields:\n  service: Amazon EKS\n  kind: compute\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: component-ops-api\n- type: in-region\n  to: region-london\n---\nThe managed Kubernetes control plane that runs the API service.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-service-fargate",
      "---\nid: cloud-service-fargate\ntype: cloud-service\ntitle: ECS Fargate\nplane: hst--hosting\nfields:\n  service: ECS Fargate\n  kind: compute\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: component-ops-api\n- type: in-region\n  to: region-london\n---\nRuns the API service.\n"
    ],
    [
      "examples/ops-api-kubernetes/cloud-service-rds",
      "---\nid: cloud-service-rds\ntype: cloud-service\ntitle: RDS for PostgreSQL\nplane: hst--hosting\nfields:\n  service: RDS for PostgreSQL\n  kind: database\nlinks:\n- type: runs-in\n  to: cloud-provider-aws\n- type: details\n  to: datastore-ops-db\n- type: in-region\n  to: region-london\n---\nManaged database that holds the operations data.\n"
    ],
    [
      "examples/ops-api-kubernetes/cluster-eks-prod",
      "---\nid: cluster-eks-prod\ntype: cluster\ntitle: Production cluster\nplane: k8s--kubernetes\nfields:\n  distribution: eks\n  version: '1.31'\nlinks:\n- type: runs-in\n  to: cloud-service-eks\n- type: runs-in\n  to: environment-production\n---\nThe production Kubernetes cluster, provided by Amazon EKS.\n"
    ],
    [
      "examples/ops-api-kubernetes/component-log-agent",
      "---\nid: component-log-agent\ntype: component\ntitle: Log agent\nplane: dsn--design\nfields:\n  kind: service\n  owner: Platform\n  status: planned\nlinks:\n- type: runs-in\n  to: environment-production\n- type: satisfies\n  to: requirement-list-jobs\n- type: placed-in\n  to: zone-private\n---\nShips every machine's logs to one place, so a stale status can be traced to the machine that caused it.\n"
    ],
    [
      "examples/ops-api-kubernetes/component-ops-api",
      "---\nid: component-ops-api\ntype: component\ntitle: Ops API\nplane: dsn--design\nfields:\n  kind: service\n  owner: Platform\n  status: planned\nlinks:\n- type: satisfies\n  to: requirement-list-jobs\n- type: writes\n  to: datastore-ops-db\n- type: runs-in\n  to: environment-production\n- type: exposes\n  to: interface-ops-api\n- type: writes\n  to: datastore-ops-cache\n- type: depends-on\n  to: component-log-agent\n- type: placed-in\n  to: zone-private\n---\n\nServes the list of jobs and their status to operations staff.\n"
    ],
    [
      "examples/ops-api-kubernetes/compose-project-ops-local",
      "---\nid: compose-project-ops-local\ntype: compose-project\ntitle: Local development stack\nplane: ctr--containers\nfields:\n  file: compose.yaml\n  purpose: development\nlinks:\n- type: runs-in\n  to: host-dev-laptop\n---\nThe API as developers run it on their own machine. Not used in production.\n"
    ],
    [
      "examples/ops-api-kubernetes/concept-job",
      "---\nid: concept-job\ntype: concept\ntitle: Job\nplane: def--capabilities\nfields:\n  definition: A scheduled piece of work run for a customer.\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/config-map-ops-api",
      "---\nid: config-map-ops-api\ntype: config-map\ntitle: API settings\nplane: k8s--kubernetes\nfields:\n  purpose: Log level and feature switches for the API\nlinks:\n- type: belongs-to\n  to: namespace-ops\n---\nLog level and feature switches. Changing these does not need a new image.\n"
    ],
    [
      "examples/ops-api-kubernetes/consequence-one-engine",
      "---\nid: consequence-one-engine\ntype: consequence\ntitle: Vertical scaling\nplane: gov--decisions\nfields:\n  effect: negative\n---\nThe database scales up before it scales out, so growth in jobs costs more.\n"
    ],
    [
      "examples/ops-api-kubernetes/constraint-uk-eu-data",
      "---\nid: constraint-uk-eu-data\ntype: constraint\ntitle: Data stays in UK/EU\nplane: def--intent\nfields:\n  statement: Customer data stays in the UK or the EU.\n  kind: legal\n  source: Customer contracts\n  status: proposed\nlinks:\n- type: governs\n  to: capability-view-job-status\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/container-log-agent",
      "---\nid: container-log-agent\ntype: container\ntitle: Log agent container\nplane: ctr--containers\nfields:\n  runs-as-root: true\nlinks:\n- type: runs\n  to: image-log-agent\n- type: runs-in\n  to: workload-log-agent\n---\nReads log files from each node and ships them. Runs as root because it must read files owned by other processes.\n"
    ],
    [
      "examples/ops-api-kubernetes/container-ops-api-apprunner",
      "---\nid: container-ops-api-apprunner\ntype: container\ntitle: API on App Runner\nplane: ctr--containers\nfields:\n  port: 8080\n  runs-as-root: false\nlinks:\n- type: details\n  to: component-ops-api\n- type: runs\n  to: image-ops-api\n- type: runs-in\n  to: cloud-service-apprunner\n---\nThe same image run on a managed container service: no cluster to look after, fewer controls. Used for preview copies.\n"
    ],
    [
      "examples/ops-api-kubernetes/container-ops-api-cluster",
      "---\nid: container-ops-api-cluster\ntype: container\ntitle: API in the cluster\nplane: ctr--containers\nfields:\n  port: 8080\n  cpu-limit: 500m\n  memory-limit: 512Mi\n  runs-as-root: false\nlinks:\n- type: runs\n  to: image-ops-api\n- type: runs-in\n  to: workload-ops-api\n---\nThe container the operations API workload starts in each copy.\n"
    ],
    [
      "examples/ops-api-kubernetes/container-ops-api-local",
      "---\nid: container-ops-api-local\ntype: container\ntitle: API on a laptop\nplane: ctr--containers\nfields:\n  port: 8080\n  runs-as-root: false\nlinks:\n- type: details\n  to: component-ops-api\n- type: runs\n  to: image-ops-api\n- type: runs-in\n  to: host-dev-laptop\n- type: belongs-to\n  to: compose-project-ops-local\n- type: mounts\n  to: volume-ops-local-data\n---\nThe same image as production, started by Compose for local development.\n"
    ],
    [
      "examples/ops-api-kubernetes/container-ops-cache",
      "---\nid: container-ops-cache\ntype: container\ntitle: Cache container\nplane: ctr--containers\nfields:\n  port: 6379\n  runs-as-root: false\nlinks:\n- type: runs\n  to: image-ops-cache\n- type: runs-in\n  to: workload-ops-cache\n---\nThe cache server that holds the latest job status.\n"
    ],
    [
      "examples/ops-api-kubernetes/container-ops-migrate",
      "---\nid: container-ops-migrate\ntype: container\ntitle: Migration container\nplane: ctr--containers\nfields:\n  runs-as-root: false\nlinks:\n- type: runs\n  to: image-ops-api\n- type: runs-in\n  to: workload-ops-migrate\n---\nSame image as the API, started with the migration command.\n"
    ],
    [
      "examples/ops-api-kubernetes/convention-short-titles",
      "---\nid: convention-short-titles\ntype: convention\ntitle: Short titles\nplane: abt--about\nlinks:\n- type: describes\n  to: overview\n---\nKeep a title to a short label and put the long text in the description.\n"
    ],
    [
      "examples/ops-api-kubernetes/datastore-ops-cache",
      "---\nid: datastore-ops-cache\ntype: datastore\ntitle: Ops cache\nplane: dsn--design\nfields:\n  kind: cache\n  owner: Platform\nlinks:\n- type: placed-in\n  to: zone-private\n---\nHolds recent job statuses so the API does not ask the database every time. It can be rebuilt from the database.\n"
    ],
    [
      "examples/ops-api-kubernetes/datastore-ops-db",
      "---\nid: datastore-ops-db\ntype: datastore\ntitle: Ops db\nplane: dsn--design\nfields:\n  kind: relational\n  owner: Platform\nlinks:\n- type: placed-in\n  to: zone-private\n---\n\nHolds every job and its latest status.\n"
    ],
    [
      "examples/ops-api-kubernetes/decision-option-document-store",
      "---\nid: decision-option-document-store\ntype: decision-option\ntitle: Managed document store\nplane: gov--decisions\nfields:\n  chosen: false\n  summary: Documents, managed\n---\nScales out easily but the job list would need joins in code.\n"
    ],
    [
      "examples/ops-api-kubernetes/decision-option-managed-postgres",
      "---\nid: decision-option-managed-postgres\ntype: decision-option\ntitle: Managed PostgreSQL\nplane: gov--decisions\nfields:\n  chosen: true\n  summary: Relational, managed\n---\nJoins and constraints come for free; scaling is mostly vertical.\n"
    ],
    [
      "examples/ops-api-kubernetes/decision-use-postgres",
      "---\nid: decision-use-postgres\ntype: decision\ntitle: Database choice\nplane: gov--decisions\nfields:\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\n  review-by: '2027-05-01'\nlinks:\n- type: considers\n  to: decision-option-managed-postgres\n- type: considers\n  to: decision-option-document-store\n- type: has-consequence\n  to: consequence-one-engine\n- type: governs\n  to: datastore-ops-db\n- type: derives-from\n  to: requirement-list-jobs\n- type: complies-with\n  to: principle-prefer-managed\n- type: relies-on\n  to: assumption-job-volume\n---\nUse a managed relational database. Job data is highly structured and listing jobs needs joins.\n"
    ],
    [
      "examples/ops-api-kubernetes/environment-production",
      "---\nid: environment-production\ntype: environment\ntitle: Production\nplane: dsn--design\nfields:\n  code: prd\n  kind: production\n---\n\nThe live system that operations staff use.\n"
    ],
    [
      "examples/ops-api-kubernetes/example",
      "---\nid: example\ntype: example\ntitle: The ops API on Kubernetes\nfields:\n  title: The ops API on Kubernetes\n  description: 'The operations API on an Amazon EKS cluster: its workloads, the service and ingress in\n    front of it, config, a secret, storage, access and a Helm chart and release, alongside the laptop\n    and App Runner copies.'\n  use: starter\n  requires:\n  - kubernetes\n  - containers\n  - hosting\n  - naming\n  - core\n---\n\n"
    ],
    [
      "examples/ops-api-kubernetes/goal-timely-visibility",
      "---\nid: goal-timely-visibility\ntype: goal\ntitle: Timely ops visibility\nplane: def--intent\nfields:\n  statement: Operations staff see the state of every job within a minute.\n  status: proposed\nlinks:\n- type: measured-by\n  to: metric-status-freshness\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/host-dev-laptop",
      "---\nid: host-dev-laptop\ntype: host\ntitle: Developer laptop\nplane: ctr--containers\nfields:\n  runtime: docker\n  kind: laptop\n  os: macOS\n---\nWhere developers run the API locally against the same image that ships to production.\n"
    ],
    [
      "examples/ops-api-kubernetes/image-log-agent",
      "---\nid: image-log-agent\ntype: image\ntitle: Log agent image\nplane: ctr--containers\nfields:\n  repository: log-agent\n  tag: 2.9.1\nlinks:\n- type: stored-in\n  to: registry-ecr\n---\nCollects logs from every machine and ships them to the log store.\n"
    ],
    [
      "examples/ops-api-kubernetes/image-ops-api",
      "---\nid: image-ops-api\ntype: image\ntitle: ops-api image\nplane: ctr--containers\nfields:\n  repository: ops-api\n  tag: 1.4.2\n  base-image: node:22-slim\nlinks:\n- type: packages\n  to: component-ops-api\n- type: stored-in\n  to: registry-ecr\n---\nThe operations API, built once and run on laptops and in the managed app service.\n"
    ],
    [
      "examples/ops-api-kubernetes/image-ops-cache",
      "---\nid: image-ops-cache\ntype: image\ntitle: Cache image\nplane: ctr--containers\nfields:\n  repository: ops-cache\n  tag: '7.2'\n  base-image: none (vendor image)\nlinks:\n- type: stored-in\n  to: registry-ecr\n---\nThird-party cache server, mirrored into our own registry so deployments do not depend on a public one.\n"
    ],
    [
      "examples/ops-api-kubernetes/increment-live-status",
      "---\nid: increment-live-status\ntype: increment\ntitle: Live job status\nplane: pln--plan\nfields:\n  status: planned\nlinks:\n- type: enables\n  to: capability-view-job-status\n---\n\nThe first slice: staff can see live job status.\n"
    ],
    [
      "examples/ops-api-kubernetes/ingress-ops-api",
      "---\nid: ingress-ops-api\ntype: ingress\ntitle: API front door\nplane: k8s--kubernetes\nfields:\n  host: ops.example.com\n  tls: true\n  controller: nginx\nlinks:\n- type: routes-to\n  to: service-ops-api\n- type: belongs-to\n  to: namespace-ops\n---\nPublic entry point for the API. Hostname is a placeholder.\n"
    ],
    [
      "examples/ops-api-kubernetes/interface-ops-api",
      "---\nid: interface-ops-api\ntype: interface\ntitle: Ops API\nplane: dsn--design\nfields:\n  protocol: http\n---\nThe boundary operations tools call to read job status.\n"
    ],
    [
      "examples/ops-api-kubernetes/metric-status-freshness",
      "---\nid: metric-status-freshness\ntype: metric\ntitle: Job status age\nplane: def--intent\nfields:\n  kind: success\n  unit: seconds\n  direction: lower-is-better\n  target: 60\n  how-measured: Age of the newest status for each job, sampled every minute\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/namespace-ops",
      "---\nid: namespace-ops\ntype: namespace\ntitle: ops\nplane: k8s--kubernetes\nfields:\n  purpose: Operations API and its supporting jobs\nlinks:\n- type: belongs-to\n  to: cluster-eks-prod\n---\nEverything that makes up the operations API, kept apart from other applications on the cluster.\n"
    ],
    [
      "examples/ops-api-kubernetes/network-policy-ops-default",
      "---\nid: network-policy-ops-default\ntype: network-policy\ntitle: Ops default policy\nplane: k8s--kubernetes\nfields:\n  stance: deny-by-default\n  allows: The ingress controller to the API on port 8080, and the API to the database\nlinks:\n- type: protects\n  to: workload-ops-api\n- type: belongs-to\n  to: namespace-ops\n---\nClosed by default; only the traffic the API needs is allowed.\n"
    ],
    [
      "examples/ops-api-kubernetes/nodepool-apps",
      "---\nid: nodepool-apps\ntype: nodepool\ntitle: Application pool\nplane: k8s--kubernetes\nfields:\n  vm-size: m6i.xlarge\n  min-nodes: 3\n  max-nodes: 6\n  purpose: application\nlinks:\n- type: belongs-to\n  to: cluster-eks-prod\n---\nGeneral-purpose machines for the API and its helpers.\n"
    ],
    [
      "examples/ops-api-kubernetes/overview",
      "---\nid: overview\ntype: overview\ntitle: Ops API\nplane: abt--about\nfields:\n  purpose: A status API so operations staff can see what every job is doing.\n  audience: The build team and operations staff\n  owner: Platform\n  stage: design\nlinks:\n- type: starts-at\n  to: goal-timely-visibility\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/persistent-volume-claim-ops-cache",
      "---\nid: persistent-volume-claim-ops-cache\ntype: persistent-volume-claim\ntitle: data\nplane: k8s--kubernetes\nfields:\n  size: 10Gi\n  access-mode: read-write-once\nlinks:\n- type: belongs-to\n  to: namespace-ops\n---\nDurable disk so the cache keeps its contents when its workload is restarted.\n"
    ],
    [
      "examples/ops-api-kubernetes/principle-prefer-managed",
      "---\nid: principle-prefer-managed\ntype: principle\ntitle: Prefer managed services\nplane: gov--decisions\nfields:\n  statement: Prefer managed services over running our own.\n  status: accepted\n  accepted-by: Mat\n  accepted-on: '2026-11-03'\n---\nWe would rather pay for a managed service than operate one ourselves.\n"
    ],
    [
      "examples/ops-api-kubernetes/region-london",
      "---\nid: region-london\ntype: region\ntitle: London\nplane: hst--topology\nfields:\n  code: eu-west-2\n  short: euw2\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/registry-ecr",
      "---\nid: registry-ecr\ntype: registry\ntitle: Container registry\nplane: ctr--containers\nfields:\n  url: 123456789012.dkr.ecr.eu-west-2.amazonaws.com\n  visibility: private\nlinks:\n- type: runs-in\n  to: cloud-service-ecr\n---\nPrivate registry for every image the system ships. Provided by Amazon ECR.\n"
    ],
    [
      "examples/ops-api-kubernetes/release-ops-prod",
      "---\nid: release-ops-prod\ntype: release\ntitle: Operations API (production)\nplane: k8s--helm\nfields:\n  chart-version: 0.3.0\n  values-file: values-prod.yaml\nlinks:\n- type: installs\n  to: chart-ops\n- type: belongs-to\n  to: namespace-ops\n---\nThe production install of the chart. A test environment would be a second release of the same chart.\n"
    ],
    [
      "examples/ops-api-kubernetes/requirement-list-jobs",
      "---\nid: requirement-list-jobs\ntype: requirement\ntitle: List jobs\nplane: def--requirements\nfields:\n  statement: The system shall list every job with its current status.\n  kind: functional\n  priority: must\n  status: proposed\nlinks:\n  - type: verified-by\n    to: acceptance-criterion-jobs-listed\n  - type: derives-from\n    to: capability-view-job-status\n---\n"
    ],
    [
      "examples/ops-api-kubernetes/risk-job-volume-growth",
      "---\nid: risk-job-volume-growth\ntype: risk\ntitle: Job volume growth\nplane: pln--plan\nfields:\n  likelihood: medium\n  impact: high\n  mitigation: Recount nightly jobs every month\n  state: open\nlinks:\n- type: owned-by\n  to: team-platform\n- type: about\n  to: assumption-job-volume\n- type: arises-from\n  to: assumption-job-volume\n---\nIf job volume grows past the assumption, the database may need a bigger plan.\n"
    ],
    [
      "examples/ops-api-kubernetes/role-binding-metrics-reader",
      "---\nid: role-binding-metrics-reader\ntype: role-binding\ntitle: API reads metrics\nplane: k8s--kubernetes\nfields:\n  scope: cluster\nlinks:\n- type: belongs-to\n  to: cluster-eks-prod\n- type: grants\n  to: role-metrics-reader\n- type: grants-to\n  to: service-account-ops-api\n---\nA cluster-scoped binding, because the role it grants is cluster-wide.\n"
    ],
    [
      "examples/ops-api-kubernetes/role-binding-ops-reader",
      "---\nid: role-binding-ops-reader\ntype: role-binding\ntitle: API reads config\nplane: k8s--kubernetes\nfields:\n  scope: namespace\nlinks:\n- type: belongs-to\n  to: namespace-ops\n- type: grants\n  to: role-ops-reader\n- type: grants-to\n  to: service-account-ops-api\n---\nGives the API identity the config reader role in its own namespace.\n"
    ],
    [
      "examples/ops-api-kubernetes/role-metrics-reader",
      "---\nid: role-metrics-reader\ntype: role\ntitle: Metrics reader\nplane: k8s--kubernetes\nfields:\n  scope: cluster\n  permissions: Read node and pod metrics across the whole cluster\nlinks:\n- type: belongs-to\n  to: cluster-eks-prod\n---\nA cluster-wide role, because metrics are read across every namespace.\n"
    ],
    [
      "examples/ops-api-kubernetes/role-ops-reader",
      "---\nid: role-ops-reader\ntype: role\ntitle: Config reader\nplane: k8s--kubernetes\nfields:\n  scope: namespace\n  permissions: Read config maps in the ops namespace\nlinks:\n- type: belongs-to\n  to: namespace-ops\n---\nNarrowest useful scope: one namespace.\n"
    ],
    [
      "examples/ops-api-kubernetes/secret-ops-db",
      "---\nid: secret-ops-db\ntype: secret\ntitle: db\nplane: k8s--kubernetes\nfields:\n  source: 'AWS Secrets Manager: ops/db-password'\n  rotation: Every 90 days\nlinks:\n- type: belongs-to\n  to: namespace-ops\n---\nOnly the location of the value is recorded here. The value itself lives in the secrets manager.\n"
    ],
    [
      "examples/ops-api-kubernetes/service-account-ops-api",
      "---\nid: service-account-ops-api\ntype: service-account\ntitle: API identity\nplane: k8s--kubernetes\nfields:\n  purpose: Identity for the operations API\nlinks:\n- type: belongs-to\n  to: namespace-ops\n---\nThe identity the API runs as inside the cluster, so its permissions are its own.\n"
    ],
    [
      "examples/ops-api-kubernetes/service-ops-api",
      "---\nid: service-ops-api\ntype: service\ntitle: API address\nplane: k8s--kubernetes\nfields:\n  kind: cluster-ip\n  port: 80\nlinks:\n- type: exposes\n  to: workload-ops-api\n- type: belongs-to\n  to: namespace-ops\n---\nThe stable address in front of the API copies.\n"
    ],
    [
      "examples/ops-api-kubernetes/team-dev",
      "---\nid: team-dev\ntype: team\ntitle: Dev\nplane: pln--plan\nfields:\n  kind: agent\n  focus: Implements work packages for review\n---\n\nAn AI agent that writes code and hands it to people to review.\n"
    ],
    [
      "examples/ops-api-kubernetes/team-platform",
      "---\nid: team-platform\ntype: team\ntitle: Platform\nplane: pln--plan\nfields:\n  kind: human\n  focus: Builds and runs the platform\n---\n\nThe people who own the system.\n"
    ],
    [
      "examples/ops-api-kubernetes/volume-ops-local-data",
      "---\nid: volume-ops-local-data\ntype: volume\ntitle: Local API data\nplane: ctr--containers\nfields:\n  kind: named\n  size: 1GB\n---\nScratch data for local development. Safe to delete.\n"
    ],
    [
      "examples/ops-api-kubernetes/work-package-build-status-api",
      "---\nid: work-package-build-status-api\ntype: work-package\ntitle: Build status API\nplane: pln--plan\nfields:\n  status: planned\nlinks:\n  - type: owned-by\n    to: team-dev\n  - type: reviewed-by\n    to: team-platform\n  - type: delivers\n    to: component-ops-api\n  - type: delivers\n    to: component-log-agent\n  - type: delivers\n    to: datastore-ops-cache\n  - type: part-of\n    to: increment-live-status\n---\n\nBuild the service that lists job status.\n"
    ],
    [
      "examples/ops-api-kubernetes/workload-log-agent",
      "---\nid: workload-log-agent\ntype: workload\ntitle: log-agent\nplane: k8s--kubernetes\nfields:\n  kind: daemon-set\nlinks:\n- type: details\n  to: component-log-agent\n- type: belongs-to\n  to: namespace-ops\n---\nOne copy on every machine, so it collects logs from everything that runs there.\n"
    ],
    [
      "examples/ops-api-kubernetes/workload-ops-api",
      "---\nid: workload-ops-api\ntype: workload\ntitle: ops-api\nplane: k8s--kubernetes\nfields:\n  kind: deployment\n  replicas: 3\nlinks:\n- type: details\n  to: component-ops-api\n- type: belongs-to\n  to: namespace-ops\n- type: runs-in\n  to: nodepool-apps\n- type: consumes\n  to: config-map-ops-api\n- type: consumes\n  to: secret-ops-db\n- type: consumes\n  to: service-account-ops-api\n---\nThe always-on, stateless API. Three copies for resilience; the autoscaler adds more under load.\n"
    ],
    [
      "examples/ops-api-kubernetes/workload-ops-cache",
      "---\nid: workload-ops-cache\ntype: workload\ntitle: ops-cache\nplane: k8s--kubernetes\nfields:\n  kind: stateful-set\n  replicas: 1\nlinks:\n- type: details\n  to: datastore-ops-cache\n- type: belongs-to\n  to: namespace-ops\n- type: mounts\n  to: persistent-volume-claim-ops-cache\n---\nKeeps its own data, so it is a stateful set with a durable disk.\n"
    ],
    [
      "examples/ops-api-kubernetes/workload-ops-migrate",
      "---\nid: workload-ops-migrate\ntype: workload\ntitle: ops-migrate\nplane: k8s--kubernetes\nfields:\n  kind: job\nlinks:\n- type: details\n  to: component-ops-api\n- type: belongs-to\n  to: namespace-ops\n- type: consumes\n  to: secret-ops-db\n---\nRuns once per release to bring the database schema up to date, then stops.\n"
    ],
    [
      "examples/ops-api-kubernetes/zone-private",
      "---\nid: zone-private\ntype: network-zone\ntitle: Private zone\nplane: hst--topology\nfields:\n  exposure: private\nlinks:\n- type: in-region\n  to: region-london\n---\n"
    ],
    [
      "patterns/naming-kubernetes/charts",
      "---\nid: charts\ntype: name-pattern\ntitle: Helm charts\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Helm charts\n  pattern: '{title}'\n  example: ops\n  case: kebab\n  max-length: 53\nlinks:\n- type: describes\n  to: k8s--type-chart\n---\nThe application's short name, lower case; title the chart with it and its handle is calculated. Helm limits a release name to 53 characters, and a chart name follows it.\n"
    ],
    [
      "patterns/naming-kubernetes/clusters",
      "---\nid: clusters\ntype: name-pattern\ntitle: Clusters\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Kubernetes clusters\n  pattern: '{distribution}-{runs-in/code}'\n  example: ops-prd\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: k8s--type-cluster\n---\n`<platform>` is the short name of what the cluster serves. Cloud providers add their own rules (an AKS cluster follows the Azure pattern in the hosting pack). Guidance only.\n"
    ],
    [
      "patterns/naming-kubernetes/config-maps",
      "---\nid: config-maps\ntype: name-pattern\ntitle: Config maps\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Config maps\n  pattern: '{^consumes/title}-config'\n  example: ops-api-config\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-config-map\n---\nNamed for the workload that reads them, with -config on the end. A config map name is a DNS subdomain, so it may be up to 253 characters and contain dots; keep it short. Calculated for you from the workload that consumes it.\n"
    ],
    [
      "patterns/naming-kubernetes/namespaces",
      "---\nid: namespaces\ntype: name-pattern\ntitle: Kubernetes namespaces\nplane: k8s--names\nfields:\n  scope: Kubernetes namespaces\n  pattern: '{title}-{belongs-to/runs-in/code}'\n  example: ops-prd\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: k8s--type-namespace\n---\nNames must be valid DNS labels: lower case letters, digits and -, starting and ending with a letter or digit, 63 characters at most. Calculated for you: a namespace's `handle` is its title and the code of the environment its cluster runs in. Title the namespace with its name (`ops`), and set `code` on the environment the cluster runs in (see Naming – Environment codes).\n"
    ],
    [
      "patterns/naming-kubernetes/network-policies",
      "---\nid: network-policies\ntype: name-pattern\ntitle: Network policies\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Network policies\n  pattern: '{title}'\n  example: default-deny\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-network-policy\n---\nNamed for what it does, not for what it selects: default-deny, allow-api-from-ingress, allow-egress-dns. One intent per policy.\n"
    ],
    [
      "patterns/naming-kubernetes/nodepools",
      "---\nid: nodepools\ntype: name-pattern\ntitle: Node pools\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Node pools\n  pattern: '{purpose}'\n  example: apps\n  case: kebab\n  max-length: 12\nlinks:\n- type: describes\n  to: k8s--type-nodepool\n---\nNamed for what they are for: system, apps, batch, gpu. Short and lower case with no dashes, because AKS limits a pool to 12 letters and digits; EKS and GKE allow more.\n"
    ],
    [
      "patterns/naming-kubernetes/objects",
      "---\nid: objects\ntype: name-pattern\ntitle: Workloads and their addresses\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Workloads, services, ingresses, autoscalers and service accounts\n  pattern: '{title}'\n  example: ops-api\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: k8s--type-workload\n- type: describes\n  to: k8s--type-service\n- type: describes\n  to: k8s--type-ingress\n- type: describes\n  to: k8s--type-autoscaler\n- type: describes\n  to: k8s--type-service-account\n---\nNames must be valid DNS labels: lower case letters, digits and -, starting and ending with a letter or digit, 63 characters at most. The workload's title is its name (`ops-api`), and the same name is used for every object that belongs to the workload (the workload, its service, its ingress, its autoscaler and its service account). The namespace already says the environment, so names do not repeat it. Title the workload with it; it and the service, ingress, autoscaler and service account all show it as their calculated `handle`, and the workload also gets its recommended labels as a calculated `labels` value. Label every object with the Kubernetes recommended labels: app.kubernetes.io/name, instance, version, component, part-of and managed-by.\n"
    ],
    [
      "patterns/naming-kubernetes/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Naming – Kubernetes\nfields:\n  title: Naming – Kubernetes\n  description: 'How every Kubernetes object is named, with the rules of the platform: namespaces as {app}-{belongs-to/runs-in/code} (ops-prd), clusters, node pools, workloads and the objects that go with them (ops-api), config, secrets, storage, roles and bindings, network policies, and Helm charts and releases. Names are calculated for namespaces, workloads, services, ingresses, autoscalers, config maps, secrets, volume claims, service accounts, charts and releases, and workloads get their recommended labels.'\n  use: starter\n  requires:\n  - kubernetes\n  - naming\n  root: namespaces\n  prefix: kn\n---\n\n"
    ],
    [
      "patterns/naming-kubernetes/releases",
      "---\nid: releases\ntype: name-pattern\ntitle: Helm releases\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Helm releases\n  pattern: '{installs/title}-{belongs-to/belongs-to/runs-in/code}'\n  example: ops-prd\n  case: kebab\n  max-length: 53\nlinks:\n- type: describes\n  to: k8s--type-release\n---\nCalculated for you: the title of the chart it installs and the environment code of the namespace it installs into, so two environments can install the same chart side by side. 53 characters at most, which is Helm's own limit.\n"
    ],
    [
      "patterns/naming-kubernetes/role-bindings",
      "---\nid: role-bindings\ntype: name-pattern\ntitle: Role bindings\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Role bindings\n  pattern: '{grants-to/title}-{grants/title}'\n  example: ops-api-config-reader\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-role-binding\n---\nThe subject first, then the role it is given, so a list of bindings reads as who may do what.\n"
    ],
    [
      "patterns/naming-kubernetes/roles",
      "---\nid: roles\ntype: name-pattern\ntitle: Roles\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Roles\n  pattern: '{title}'\n  example: config-reader\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-role\n---\nWhat it allows, in the form resource then access: config-reader, pods-viewer, secrets-editor. Say the scope (namespace or cluster) in the scope field, not in the name.\n"
    ],
    [
      "patterns/naming-kubernetes/secrets",
      "---\nid: secrets\ntype: name-pattern\ntitle: Secrets\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Secrets\n  pattern: '{^consumes/title}-{title}'\n  example: ops-api-db\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-secret\n---\nNamed for the workload that reads them and what they hold: ops-api-db, ops-api-tls. Calculated for you from the workload that reads it and the secret's own title, which says what it holds. Never put the value or the vault path in the name. A secret name is a DNS subdomain, up to 253 characters.\n"
    ],
    [
      "patterns/naming-kubernetes/volume-claims",
      "---\nid: volume-claims\ntype: name-pattern\ntitle: Persistent volume claims\nparent: namespaces\nplane: k8s--names\nfields:\n  scope: Persistent volume claims\n  pattern: '{^mounts/title}-{title}'\n  example: ops-cache-data\n  case: kebab\n  max-length: 253\nlinks:\n- type: describes\n  to: k8s--type-persistent-volume-claim\n---\nNamed for the workload that mounts them and what they hold (data, logs, cache). Calculated for you from the workload that mounts it and the claim's own title, which says what it keeps. A stateful set's claim templates add the pod name themselves, so name the template, not the result.\n"
    ],
    [
      "patterns/starter-cluster/app",
      "---\nid: app\ntype: namespace\nparent: cluster\ntitle: myapp\nplane: k8s--kubernetes\nfields:\n  purpose: The application and its helpers\nlinks:\n- type: belongs-to\n  to: cluster\n---\nEverything for one application, kept apart from others. Its name is calculated from its title and the environment code: myapp-prd. Change the title to your application's short name.\n"
    ],
    [
      "patterns/starter-cluster/apps",
      "---\nid: apps\ntype: nodepool\nparent: cluster\ntitle: Application pool\nplane: k8s--kubernetes\nfields:\n  vm-size: m6i.xlarge\n  min-nodes: 3\n  max-nodes: 6\n  purpose: application\nlinks:\n- type: belongs-to\n  to: cluster\n---\nGeneral-purpose machines for the workloads. Change the size and counts to yours.\n"
    ],
    [
      "patterns/starter-cluster/cluster",
      "---\nid: cluster\ntype: cluster\ntitle: Cluster\nplane: k8s--kubernetes\nfields:\n  distribution: eks\n  version: '1.31'\nlinks:\n- type: runs-in\n  to: production\n---\nThe cluster everything below runs on. It runs in the production environment, which is how its namespaces find the environment code. Set the distribution and version to yours.\n"
    ],
    [
      "patterns/starter-cluster/identity",
      "---\nid: identity\ntype: service-account\nparent: cluster\ntitle: App identity\nplane: k8s--kubernetes\nfields:\n  purpose: Identity for the application\nlinks:\n- type: belongs-to\n  to: app\n---\nThe identity the workload runs as, so its permissions are its own.\n"
    ],
    [
      "patterns/starter-cluster/namespaces",
      "---\nid: namespaces\ntype: name-pattern\nparent: cluster\ntitle: Kubernetes namespaces\nplane: k8s--names\nfields:\n  scope: Kubernetes namespaces\n  pattern: '{title}-{belongs-to/runs-in/code}'\n  example: myapp-prd\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: k8s--type-namespace\n---\nNames must be valid DNS labels. Calculated for you: the namespace's `handle` is its title and the code of the environment its cluster runs in.\n"
    ],
    [
      "patterns/starter-cluster/objects",
      "---\nid: objects\ntype: name-pattern\nparent: namespaces\ntitle: Kubernetes objects\nplane: k8s--names\nfields:\n  scope: Workloads, services and config maps\n  pattern: '{title}'\n  example: myapp-web\n  case: kebab\n  max-length: 63\nlinks:\n- type: describes\n  to: k8s--type-workload\n- type: describes\n  to: k8s--type-service\n- type: describes\n  to: k8s--type-config-map\n---\nThe object's title is its name; the namespace already says the environment.\n"
    ],
    [
      "patterns/starter-cluster/pattern",
      "---\nid: pattern\ntype: pattern\ntitle: Kubernetes – Starter\nfields:\n  title: Kubernetes – Starter\n  description: A small working cluster to start from, with its names already set. A production\n    environment, a cluster and node pool in it, a namespace, a service account, an API workload with its\n    container, image and registry, a service and a config map. Namespaces calculate as {app}-{belongs-to/runs-in/code} (myapp-prd)\n    from the app field and the environment code.\n  use: starter\n  requires:\n  - kubernetes\n  - containers\n  - naming\n  root: cluster\n  prefix: ks\n---\n"
    ],
    [
      "patterns/starter-cluster/production",
      "---\nid: production\ntype: environment\nparent: cluster\ntitle: Production\nplane: dsn--design\nfields:\n  code: prd\n  kind: production\n---\nThe live system. Its code is `prd`, so the namespace is named myapp-prd.\n"
    ],
    [
      "patterns/starter-cluster/registry",
      "---\nid: registry\ntype: registry\nparent: cluster\ntitle: Container registry\nplane: ctr--containers\nfields:\n  url: registry.example.com\n  visibility: private\nlinks:\n- type: runs-in\n  to: production\n---\nWhere the images are stored. Set the address to yours.\n"
    ],
    [
      "patterns/starter-cluster/settings",
      "---\nid: settings\ntype: config-map\nparent: cluster\ntitle: App settings\nplane: k8s--kubernetes\nfields:\n  purpose: Log level and feature switches\nlinks:\n- type: belongs-to\n  to: app\n---\nSettings that change without a new image.\n"
    ],
    [
      "patterns/starter-cluster/web-container",
      "---\nid: web-container\ntype: container\nparent: cluster\ntitle: Web container\nplane: ctr--containers\nfields:\n  port: 8080\n  runs-as-root: false\nlinks:\n- type: runs\n  to: web-image\n- type: runs-in\n  to: web\n---\nThe container the workload starts in each copy.\n"
    ],
    [
      "patterns/starter-cluster/web-image",
      "---\nid: web-image\ntype: image\nparent: cluster\ntitle: Web image\nplane: ctr--containers\nfields:\n  repository: myapp-web\n  tag: '1.0.0'\nlinks:\n- type: stored-in\n  to: registry\n---\nPin a version tag, never latest.\n"
    ],
    [
      "patterns/starter-cluster/web-service",
      "---\nid: web-service\ntype: service\nparent: cluster\ntitle: Web address\nplane: k8s--kubernetes\nfields:\n  kind: cluster-ip\n  port: 80\nlinks:\n- type: exposes\n  to: web\n- type: belongs-to\n  to: app\n---\nThe stable address in front of the workload copies.\n"
    ],
    [
      "patterns/starter-cluster/web",
      "---\nid: web\ntype: workload\nparent: cluster\ntitle: myapp-web\nplane: k8s--kubernetes\nfields:\n  kind: deployment\n  replicas: 2\nlinks:\n- type: belongs-to\n  to: app\n- type: runs-in\n  to: apps\n- type: consumes\n  to: settings\n- type: consumes\n  to: identity\n---\nThe always-on workload. Two copies so one can restart without an outage.\n"
    ]
  ]
}
