Skip to content

Commit 7b52bab

Browse files
committed
add a quick to start section to README
Signed-off-by: olalekan odukoya <[email protected]>
1 parent 896e5e9 commit 7b52bab

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,74 @@ providers as well as enterprise IT departments offering APIs within their compan
2020

2121
**NB:** In May 2023, the kcp project was restructured and components related to workload scheduling (e.g. the syncer) and the transparent multi cluster (tmc) code were removed due to lack of interest/maintainers. Please refer to the [`main-pre-tmc-removal` branch](https://github.com/kcp-dev/kcp/tree/main-pre-tmc-removal) if you are interested in the related code.
2222

23+
## Quick Start for Development
24+
25+
### Prerequisites
26+
- Go
27+
- kubectl
28+
29+
### Running kcp locally
30+
31+
#### Basic setup
32+
```bash
33+
# Option 1: Run directly with go
34+
go run ./cmd/kcp.go start
35+
36+
# Option 2: Build binary first, then run
37+
make build
38+
./bin/kcp start
39+
40+
# In another terminal, set up kubectl to use kcp
41+
export KUBECONFIG=.kcp/admin.kubeconfig
42+
43+
# Verify it's working
44+
kubectl get workspaces
45+
46+
# Or you can combine the export and kubectl command in one line
47+
export KUBECONFIG=.kcp/admin.kubeconfig && kubectl get workspaces
48+
```
49+
50+
**Note:** When you run the `start` command for the first time, kcp automatically generates an admin kubeconfig file at `.kcp/admin.kubeconfig` and initializes the necessary data directory structure. The server listens on `https://localhost:6443` by default.
51+
52+
#### Sample commands and outputs
53+
54+
**Get workspaces:**
55+
```bash
56+
$ export KUBECONFIG=.kcp/admin.kubeconfig && kubectl get workspaces
57+
NAME TYPE REGION PHASE URL AGE
58+
test-workspace test-extended Initializing https://192.168.1.32:6443/clusters/root:test-workspace 35h
59+
```
60+
61+
**Get workspace types:**
62+
```bash
63+
$ export KUBECONFIG=.kcp/admin.kubeconfig && kubectl get workspacetypes
64+
NAME AGE
65+
home 35h
66+
organization 35h
67+
root 35h
68+
team 35h
69+
test-base 35h
70+
test-extended 35h
71+
universal 35h
72+
```
73+
74+
**Create and inspect a workspace:**
75+
```bash
76+
# Create a workspace
77+
$ kubectl create -f - <<EOF
78+
apiVersion: tenancy.kcp.io/v1alpha1
79+
kind: Workspace
80+
metadata:
81+
name: test-workspace
82+
spec:
83+
type:
84+
name: universal
85+
EOF
86+
87+
# Get workspace details
88+
$ kubectl get workspace test-workspace -o yaml
89+
```
90+
2391
## Documentation
2492

2593
Please visit [docs.kcp.io/kcp](https://docs.kcp.io/kcp/latest) for our documentation.

0 commit comments

Comments
 (0)