Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 2.46 KB

BUILD.md

File metadata and controls

102 lines (70 loc) · 2.46 KB

Building and Running

This document describes how to build and iterate upon the Equinix Metal (formerly Packet) infrastructure provider.

This is not intended for regular users.

We recommend following the upstream Developing Cluster API with Tilt guide for iterative test and development of CAPP.

Example workflow

  1. git clone kubernetes-sigs/cluster-api-provider-packet

  2. git clone kubernetes-sigs/cluster-api

  3. Move to the cluster-api-provider-packet directory

    cd cluster-api-provider-packet
  4. git checkout "branch-you're-testing"

  5. Move to the cluster-api directory you checked out earlier:

    cd ../cluster-api
  6. Install tilt and kind

    brew install tilt
    brew install kind
  7. Create the tilt-settings.json file in the cluster-api folder.

    touch cluster-api/tilt-settings.json 
  8. Copy the following into that file, updating the <> sections with relevant info:

    {
        "default_registry": "ghcr.io/<your github username>",
        "provider_repos": ["../cluster-api-provider-packet"],
        "enable_providers": ["packet","kubeadm-bootstrap","kubeadm-control-plane"],
        "kustomize_substitutions": {
            "PACKET_API_KEY": "<API_KEY>",
            "EXP_CLUSTER_RESOURCE_SET": "true",
            "EXP_MACHINE_POOL": "true",
            "CLUSTER_TOPOLOGY": "true"
        }
    }
  9. Create a cluster.

    1. Change to the directory where you checked out both projects

      cd ~
    2. Run the kind install for capd script included in the cluster-api repository:

      cluster-api/hack/kind-install-for-capd.sh
    3. Navigate to the cluster-api directory and run:

      tilt up
    4. Get another terminal window

      cd cluster-api-provider-packet
  10. You now have a choice:

    • clusterctl

      clusterctl generate cluster my-cluster --kubernetes-version=1.23.6 --control-plane-machine-count=1 --worker-machine-count=1 --from templates/cluster-template-kube-vip.yaml > test-kube-vip.yaml
      1. Set your kubernetes context to the cluster created in kind

        kubectl apply -f test-kube-vip.yaml
    • e2e testing

      1. Run your e2e tests.

        make test-e2e-local