Skip to content

Commit 7466c07

Browse files
paulovmrandyatmiami
authored andcommitted
chore: avoid double slashes in URL (#80)
Signed-off-by: Paulo Rego <[email protected]> Signed-off-by: Andy Stoneberg <[email protected]>
1 parent 98af650 commit 7466c07

File tree

11 files changed

+203
-113
lines changed

11 files changed

+203
-113
lines changed

developing/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
bin/*

workspaces/developing/DEVELOPMENT.md renamed to developing/DEVELOPMENT.md

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ node --version
4343
npm --version
4444
```
4545

46-
### Install Kind (Optional)
46+
### Install Kind
4747

48-
**Note**: Tilt will automatically create a Kind cluster named `tilt` if it doesn't exist. However, you still need to have `kind` installed.
48+
**Note**: The Makefile will automatically create a Kind cluster named `tilt` if it doesn't exist. However, you still need to have `kind` installed.
4949

5050
```bash
5151
# macOS
@@ -54,21 +54,38 @@ brew install kind
5454
# Or follow instructions at: https://kind.sigs.k8s.io/docs/user/quick-start/#installation
5555
```
5656

57-
**Alternative**: If you prefer to use a different Kubernetes cluster (Docker Desktop, Minikube, etc.), you can skip Kind installation. Just ensure your cluster is running and `kubectl` is configured to use it. Tilt will detect and use your current `kubectl` context.
57+
58+
### Using Kind Provider (Optional)
59+
60+
You can choose to set the `KIND_EXPERIMENTAL_PROVIDER` environment variable in your shell session:
61+
62+
```bash
63+
export KIND_EXPERIMENTAL_PROVIDER=podman
64+
```
65+
66+
The Makefile will honor this environment variable when creating the Kind cluster.
5867

5968
## Quick Start
6069

6170
1. **Navigate to the developing directory**:
6271
```bash
63-
cd workspaces/developing
72+
cd developing
6473
```
6574

66-
2. **Start Tilt**:
75+
2. **Start Tilt using the Makefile**:
6776
```bash
68-
tilt up
77+
make tilt
6978
```
7079

80+
**Important**: Always use `make tilt` instead of running `tilt up` directly. The Makefile ensures:
81+
- The Kind cluster exists and is properly configured
82+
- The Kubernetes context is switched to `kind-tilt`
83+
- Cert-manager is installed (required for webhooks)
84+
- All prerequisites are met before Tilt starts
85+
7186
This will:
87+
- Set up the Kind cluster (if it doesn't exist)
88+
- Install cert-manager
7289
- Open the Tilt UI in your browser (usually http://localhost:10350)
7390
- Build the controller and backend Docker images
7491
- Deploy them to your Kubernetes cluster
@@ -80,22 +97,20 @@ brew install kind
8097

8198
Watch the Tilt UI in your browser. You should see:
8299

83-
1. **Setup Resources** (one-time setup):
84-
- `setup-kind` - Creating/verifying Kind cluster (if using Kind)
85-
- `setup-cert-manager` - Installing cert-manager (required for webhooks)
86-
- `install-crds` - Installing CRDs
87-
88-
2. **Local Resources**:
100+
1. **Local Resources**:
89101
- `controller-generate` - Generating manifests and code
102+
- `install-crds` - Installing CRDs
90103
- `workspaces-frontend` - Running webpack dev server (if enabled)
91104

92-
3. **Docker Resources** (building images):
105+
2. **Docker Resources** (building images):
93106
- `workspaces-controller`
94107
- `workspaces-backend`
95108

96-
4. **Kubernetes Resources** (deploying):
109+
3. **Kubernetes Resources** (deploying):
97110
- Deployments, Services, etc.
98111

112+
**Note**: The Kind cluster and cert-manager setup are handled by the Makefile before Tilt starts, so you won't see those as Tilt resources.
113+
99114
Wait until all resources show green/healthy status.
100115

101116
5. **Access the componenets**:
@@ -107,6 +122,8 @@ brew install kind
107122
```bash
108123
# In the terminal where Tilt is running, press Ctrl+C
109124
# Or in another terminal:
125+
make tilt-down
126+
# Or:
110127
tilt down
111128
```
112129

@@ -128,12 +145,22 @@ kind delete cluster --name tilt
128145

129146
## Configuration
130147

148+
### Makefile Targets
149+
150+
The Makefile provides several targets for managing your development environment:
151+
152+
- `make tilt` or `make` - Set up Kind cluster, install cert-manager, and start Tilt
153+
- `make tilt-up` - Alias for `make tilt`
154+
- `make tilt-down` - Stop Tilt
155+
- `make setup-kind` - Set up the Kind cluster only (without starting Tilt)
156+
- `make setup-cert-manager` - Install cert-manager only (requires Kind cluster)
157+
131158
### Skipping Frontend
132159

133160
To run Tilt without the frontend (useful for backend/controller-only development):
134161

135162
```bash
136-
ENABLE_FRONTEND=false tilt up
163+
ENABLE_FRONTEND=false make tilt
137164
```
138165

139166
### Custom Ports
@@ -206,21 +233,32 @@ export DOCKER_BUILDKIT=0
206233

207234
### Kubernetes Connection Issues
208235

209-
Ensure:
210-
- `kubectl` is configured correctly (`kubectl cluster-info`)
211-
- Your cluster is running and accessible
212-
- You have permissions to create resources in the `kubeflow-workspaces` namespace
236+
The Makefile automatically handles context switching to `kind-tilt`. If you encounter issues:
213237

214-
```bash
215-
# Verify cluster is accessible
216-
kubectl cluster-info
238+
1. **Verify the Kind cluster exists**:
239+
```bash
240+
kind get clusters
241+
```
217242

218-
# Check current context
219-
kubectl config current-context
243+
2. **Check the current context**:
244+
```bash
245+
kubectl config current-context
246+
# Should be: kind-tilt
247+
```
220248

221-
# List available contexts
222-
kubectl config get-contexts
223-
```
249+
3. **If context is wrong, manually switch**:
250+
```bash
251+
kubectl config use-context kind-tilt
252+
```
253+
254+
4. **Verify cluster is accessible**:
255+
```bash
256+
kubectl cluster-info
257+
```
258+
259+
5. **Ensure you have permissions** to create resources in the `kubeflow-workspaces` namespace
260+
261+
**Note**: If you're running `tilt up` directly (not via `make tilt`), you may be on the wrong Kubernetes context. Always use `make tilt` to ensure the correct context is set.
224262

225263
### Port Already in Use
226264

@@ -262,5 +300,6 @@ Also check that you have cluster-admin permissions or appropriate RBAC.
262300
- Node modules: `npm ci` in frontend
263301

264302
3. **Clean up resources**:
265-
- Always run `tilt down` when done
303+
- Always run `make tilt-down` (or `tilt down`) when done
266304
- Optionally: `kubectl delete namespace kubeflow-workspaces`
305+
- Optionally: `kind delete cluster --name tilt` to remove the Kind cluster

developing/Makefile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
.PHONY: check-tilt tilt-up tilt-down setup-kind setup-cert-manager kustomize
2+
3+
# Variables
4+
CLUSTER_NAME := tilt
5+
KIND_CONTEXT := kind-$(CLUSTER_NAME)
6+
7+
# Location to install dependencies to
8+
LOCALBIN ?= $(shell pwd)/bin
9+
$(LOCALBIN):
10+
mkdir -p $(LOCALBIN)
11+
12+
# Tool Binaries
13+
KUSTOMIZE ?= $(LOCALBIN)/kustomize
14+
15+
# Tool Versions
16+
KUSTOMIZE_VERSION ?= v5.5.0
17+
18+
# Export KIND_EXPERIMENTAL_PROVIDER to honor it if set in user's environment
19+
# (e.g., KIND_EXPERIMENTAL_PROVIDER=podman for podman support)
20+
export KIND_EXPERIMENTAL_PROVIDER
21+
22+
# Check if tilt is installed
23+
.PHONY: check-tilt
24+
check-tilt:
25+
@if ! command -v tilt >/dev/null 2>&1; then \
26+
echo "ERROR: tilt is not installed. Please install tilt first:"; \
27+
echo " curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash"; \
28+
echo " or visit: https://docs.tilt.dev/install.html"; \
29+
exit 1; \
30+
fi
31+
32+
# Ensure kind cluster exists and context is set before running tilt
33+
setup-kind:
34+
@echo "Setting up Kind cluster..."
35+
@if [ -n "$$KIND_EXPERIMENTAL_PROVIDER" ]; then \
36+
echo "Using KIND_EXPERIMENTAL_PROVIDER=$$KIND_EXPERIMENTAL_PROVIDER"; \
37+
fi
38+
@./scripts/setup-kind.sh
39+
40+
# Install cert-manager (depends on kind cluster being set up)
41+
setup-cert-manager: setup-kind
42+
@echo "Setting up cert-manager..."
43+
@./scripts/setup-cert-manager.sh
44+
45+
46+
# Run tilt up with kind cluster and cert-manager setup
47+
tilt-up: check-tilt setup-cert-manager kustomize
48+
@echo "Starting Tilt..."
49+
@tilt up
50+
51+
52+
# Stop Tilt
53+
tilt-down: check-tilt kustomize
54+
@echo "Stopping Tilt..."
55+
@tilt down
56+
57+
# Install kustomize
58+
kustomize: $(KUSTOMIZE)
59+
$(KUSTOMIZE): $(LOCALBIN)
60+
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION))
61+
62+
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
63+
# $1 - target path with name of binary
64+
# $2 - package url which can be installed
65+
# $3 - specific version of package
66+
define go-install-tool
67+
@[ -f "$(1)-$(3)" ] || { \
68+
set -e; \
69+
package=$(2)@$(3) ;\
70+
echo "Downloading $${package}" ;\
71+
rm -f $(1) || true ;\
72+
GOBIN=$(LOCALBIN) go install $${package} ;\
73+
mv $(1) $(1)-$(3) ;\
74+
} ;\
75+
ln -sf $(1)-$(3) $(1)
76+
endef
77+
File renamed without changes.

0 commit comments

Comments
 (0)