Local Development Environment Setup
Local Development Environment Setup
This guide provides instructions for setting up a local development environment using kind (Kubernetes in Docker). This setup is ideal for developing, testing, and exploring Porch functionalities.
Table of Contents
Prerequisites
Before you begin, ensure you have the following tools installed on your system:
-
Docker: For running containers, including the
kindcluster. - kubectl: The Kubernetes command-line tool for interacting with your cluster.
- kind: A tool for running local Kubernetes clusters using Docker container “nodes”.
The setup scripts provided in the Porch repository will handle the installation of Porch itself and its CLI, porchctl.
Local Environment Setup
Follow these steps from the root directory of your cloned Porch repository to set up your local environment.
-
Bring up the
kindcluster:This script creates a local Kubernetes cluster with the necessary configuration for Porch.
./scripts/setup-dev-env.sh -
Build and load Porch images:
Choose one of the following options to build the Porch container images and load them into your
kindcluster.-
CR-CACHE (Default): Uses a cache backed by a Custom Resource (CR).
make run-in-kind -
DB-CACHE: Uses a PostgreSQL database as the cache backend.
make run-in-kind-db-cache
-
Verifying the Setup
After the setup scripts complete, verify that all components are running correctly.
-
Check Pod Status:
Ensure all pods in the
porch-systemnamespace are in theREADYstate.kubectl get pods -n porch-system -
Verify CRD Availability:
Confirm that the
PackageRevisionCustom Resource Definition (CRD) has been successfully registered.kubectl api-resources | grep packagerevisions -
Configure
porchctl(Optional):The
porchctlbinary is built into the.build/directory. For convenient access, add it to your system’sPATH.# You can copy the binary to a directory in your PATH, for example: sudo cp ./.build/porchctl /usr/local/bin/porchctl # Alternatively, you can add the build directory to your PATH: export PATH="$(pwd)/.build:$PATH" -
Access Gitea UI (Optional):
The local environment includes a Gitea instance for Git repository hosting. You can access it at http://localhost:3000.
- Username:
nephio - Password:
secret
- Username: