> For the complete documentation index, see [llms.txt](https://experience-digital-transform.gitbook.io/experience-digital-transformation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://experience-digital-transform.gitbook.io/experience-digital-transformation/cloud-for-dpi/chapter-5/3-create-the-loadbalancer-spoke.md).

# 3. Create the LoadBalancer Spoke

We create `loadbalancer` first so that the shared routing environment is ready when the workload Spokes need incoming connections. Its cluster input combines the routing role with the selected machines and address allocations.

The following excerpt uses the machine sizes chosen in Step 2 and the LoadBalancer addresses from the plan in Step 4. [\[13\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/templates/loadbalancer-foundation-apps.yaml.j2)[\[15\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/config/environments/oslab-ciab.example.yml)

```yaml
cluster:
  name: loadbalancer
  role: loadbalancer                 # Shared routing role.
  namespace: govstack-clusters       # Resources stored in Management.
  kubernetes_version: v1.36.3        # Version of the selected machine image.
  control_plane: {replicas: 1, flavor: SCS-2V-4-20s}
  workers: {replicas: 1, flavor: SCS-2V-4-20s}
  openstack:
    identity_secret: loadbalancer-openstack
    child_cloud_secret: loadbalancer-cloud
    image: state                    # Image ID from recorded image metadata.
  networking:
    api_vip: 10.42.0.12              # Private API endpoint.
    pod_cidr: 172.21.0.0/16
    service_cidr: 10.80.0.0/16
    service_vip_range: 10.42.0.121-10.42.0.126
```

The API address reaches the Spoke's control plane. The Pod and Service ranges provide internal Kubernetes addresses, and the exposed-Service pool supplies private ingress addresses. The two Secret names connect the controllers to protected cloud configuration. The complete cluster file also specifies the network references and gateway settings. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[13\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/templates/loadbalancer-foundation-apps.yaml.j2)

## Generate the request

The renderer reads this cluster file, the environment file, infrastructure outputs and machine-image metadata. It produces a directory under `gitops/spokes/loadbalancer/` with three files: [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[13\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/templates/loadbalancer-foundation-apps.yaml.j2)

| Generated file       | Purpose                                                           |
| -------------------- | ----------------------------------------------------------------- |
| `cluster.yaml`       | Cluster API resources and the GovStackSpoke environment resource  |
| `foundations.yaml`   | Management Argo CD declarations for the Spoke's platform services |
| `bridge-access.yaml` | Permissions used by the bridge to access the Spoke                |

We inspect the generated resources before publishing the directory. This is where the selected image, addresses and machine counts become the declarations consumed by the platform.

## Read GovStackSpoke

The CRD is installed once in Management as `govstackspokes.govstack.itu.int`. It defines API version `govstack.itu.int/v1alpha1`, namespaced resources and short name `gss`. Its control-plane replica rule accepts one, three or five machines: [\[11\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/gitops/management/govstack-spoke-crd.yaml)

```yaml
# Replica rule inside the CRD's spec schema.
controlPlane:
  type: object
  required: [replicas]
  properties:
    replicas:
      type: integer
      enum: [1, 3, 5]
```

The schema accepts zero to twenty workers. The lifecycle editor and Dashboard provide scale operations for one to twenty workers, so we use that operating range when changing worker capacity. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[11\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/gitops/management/govstack-spoke-crd.yaml)[\[12\]](https://git.vanillacore.net/govstack-apps/govstack-dashboard/src/commit/f2e6ff3a0b752a0708983407e1176d72faeae702)

The renderer creates this GovStackSpoke instance for the starting LoadBalancer environment:

```yaml
apiVersion: govstack.itu.int/v1alpha1
kind: GovStackSpoke
metadata:
  name: loadbalancer
  namespace: govstack-clusters
  labels:
    govstack.itu.int/managed: 'true'
    govstack.itu.int/spoke: loadbalancer
    govstack.itu.int/role: loadbalancer
spec:
  controlPlane:
    replicas: 1
  workers:
    replicas: 1
```

Its name identifies the environment and links it to the same-named Cluster API Cluster. **spec** carries the requested counts. The accompanying Cluster API declarations supply the image, version and network configuration. During operation, **status** reports the observed counts, cluster version, registration and foundation health. We use these observations to follow the environment from provisioning into service. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[11\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/gitops/management/govstack-spoke-crd.yaml)

<figure><img src="https://1406653965-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkZFMZ3jCMUwHtTN0sL4J%2Fuploads%2Fgit-blob-b59cbb5d6c76918c9f634f2457d0ebda5bb79dd9%2Ffinal.png?alt=media" alt="The CRD defines the GovStackSpoke API. Full cluster configuration produces Cluster API objects. A GovStackSpoke request for two workers passes through the bridge to Cluster API, and observed counts return to status."><figcaption><p>Figure 8. GovStackSpoke represents the managed environment. The illustrated two-worker request is a later capacity change from the one-worker starting configuration.</p></figcaption></figure>

## Follow creation

After the directory reaches the configured Git revision, Management Argo CD delivers the declarations. The bridge applies the requested lifecycle fields; CAPI and CAPO provision the machines and join them to the cluster. Once the bridge registers the Spoke, Management Argo CD delivers its foundations. We follow these steps through the GovStackSpoke conditions and the corresponding Argo CD Applications. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[13\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/templates/loadbalancer-foundation-apps.yaml.j2)

The bridge owns the supported replica and replacement fields, while the remaining cluster configuration is maintained through Git. Management Argo CD's synchronization settings respect that field ownership, allowing the lifecycle request to stay in effect. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)

Creation requires a project-scoped cloud identity for this Spoke. The lab's pinned source has an unresolved credential-preparation dependency, so the companion currently stops before live Spoke creation. Its [LoadBalancer walkthrough](https://git.vanillacore.net/giga/content/src/branch/main/chapter-5/lab/walkthroughs/03-loadbalancer.md) documents that dependency and the checks used after it is resolved. This limits the executable lab path at the reviewed revision. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)

Once a Spoke is running, we compare `metadata.generation` with `status.observedGeneration`. Matching values show that the observations refer to the current request. We then check the requested machine counts, ready counts, registration and foundation health. A `Degraded` condition points us to its reason and message, then to the affected Machine or Application. [\[9\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/docs/spoke-lifecycle.md)[\[11\]](https://git.vanillacore.net/govstack/govstack-bootstrap/src/commit/1195f539afe5a1018be07d2e1865824c225ee407/gitops/management/govstack-spoke-crd.yaml)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://experience-digital-transform.gitbook.io/experience-digital-transformation/cloud-for-dpi/chapter-5/3-create-the-loadbalancer-spoke.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
