Skip to content

Commit 0aa6767

Browse files
Merge pull request #6 from Kong/fix/fixing-bulk-item-selection-including-red-state-items
fix(ui): extend toggle logic to include additional ingress states
2 parents 7b79236 + 18cba5e commit 0aa6767

2 files changed

Lines changed: 95 additions & 64 deletions

File tree

README.md

Lines changed: 94 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,99 @@ This tool automates the migration of Kubernetes Ingress resources from **NGINX I
99
- **Full Coverage Testing**: Includes an End-to-End (E2E) test suite validating the migration against a live cluster.
1010
- **Safe Defaults**: Generates standard configuration while warning about incompatible or manual-intervention items.
1111

12+
## UI Dashboard
13+
14+
The migration tool includes a web-based dashboard that connects to your cluster and lets you browse, analyse, and migrate Ingress resources interactively.
15+
16+
### Run locally with binary
17+
18+
Download the binary from [the releases page](https://github.com/Kong/nginx-kong-migrator/releases), then start the dashboard:
19+
20+
```bash
21+
./migrator ui
22+
```
23+
24+
Optional flags:
25+
- `-port <int>` — port to listen on (default: `8080`)
26+
- `-namespace <string>` — restrict to a single namespace (default: all namespaces)
27+
- `-kubeconfig <string>` — path to kubeconfig (falls back to `$KUBECONFIG` or `~/.kube/config`)
28+
29+
Example:
30+
```bash
31+
./migrator ui -port 9090 -namespace kong
32+
```
33+
34+
Open [http://localhost:8080](http://localhost:8080) in your browser. The dashboard reads Ingress resources from your currently active cluster context and colour-codes each one:
35+
36+
- **Green** — already migrated (non-NGINX ingress)
37+
- **Yellow** — ready to migrate, may have followup notes
38+
- **Red** — has unmigrated annotations that require manual intervention
39+
40+
From the dashboard you can:
41+
- **Migrate Selected / Migrate Single** — applies the migration in-cluster: sets `ingressClassName: kong`, creates `KongPlugin` and `KongUpstreamPolicy` CRDs
42+
- **Copy to Namespace** — copies one or more ingresses (with their Kong resources) to a target namespace
43+
- **Download as Kong Ingress YAML / Gateway API YAML** — export the migrated manifests without applying them
44+
- **Refresh** — reload the ingress list from the cluster
45+
46+
### Run locally with Docker (out-of-cluster)
47+
48+
You can run the dashboard as a Docker container outside the cluster by mounting your kubeconfig:
49+
50+
```bash
51+
docker run --rm \
52+
-p 8080:8080 \
53+
-e KUBECONFIG=/kubeconfig \
54+
-v "${KUBECONFIG:-$HOME/.kube/config}:/kubeconfig:ro" \
55+
kong/nginx-kong-migrator:latest ui
56+
```
57+
58+
Then open [http://localhost:8080](http://localhost:8080). The container reads the mounted kubeconfig to connect to whichever cluster context is currently active.
59+
60+
To target a specific context, set it before running:
61+
62+
```bash
63+
kubectl config use-context <your-context>
64+
docker run --rm \
65+
-p 8080:8080 \
66+
-e KUBECONFIG=/kubeconfig \
67+
-v "${KUBECONFIG:-$HOME/.kube/config}:/kubeconfig:ro" \
68+
kong/nginx-kong-migrator:latest ui
69+
```
70+
71+
### Deploy to Kubernetes
72+
73+
The `deploy/kubernetes.yaml` manifest creates a dedicated `kong-migrator` namespace and installs all required resources (ServiceAccount, ClusterRole, ClusterRoleBinding, Deployment, Service):
74+
75+
```bash
76+
kubectl apply -f deploy/kubernetes.yaml
77+
```
78+
79+
Wait for the pod to become ready:
80+
81+
```bash
82+
kubectl -n kong-migrator rollout status deployment/kong-migrator
83+
```
84+
85+
#### Access the Dashboard
86+
87+
Port-forward the service to your local machine:
88+
89+
```bash
90+
kubectl -n kong-migrator port-forward svc/kong-migrator 8080:8080
91+
```
92+
93+
Then open [http://localhost:8080](http://localhost:8080) in your browser. The dashboard reads Ingress resources across all namespaces using the pod's service account — no kubeconfig or extra credentials required.
94+
95+
To restrict the dashboard to a single namespace, edit the Deployment and add `--namespace <your-namespace>` to the `args` list.
96+
97+
### Uninstall
98+
99+
```bash
100+
kubectl delete -f deploy/kubernetes.yaml
101+
```
102+
103+
This removes all resources created by the manifest, including the `kong-migrator` namespace.
104+
12105
## Supported Annotations
13106

14107
The tool supports **25+ NGINX Ingress annotations** across multiple categories:
@@ -86,7 +179,7 @@ The following annotations are detected but not automatically migrated:
86179
- `configuration-snippet` (non-header) - Complex snippets not supported
87180
- `modsecurity-*` - Third-party WAF integration required
88181

89-
## Usage
182+
## CLI Usage
90183

91184
### Build
92185
```bash
@@ -209,68 +302,6 @@ spec:
209302
weight: 20
210303
```
211304
212-
## UI Dashboard
213-
214-
The migration tool includes a web-based dashboard that connects to your cluster and lets you browse, analyse, and migrate Ingress resources interactively.
215-
216-
### Deploy to Kubernetes
217-
218-
The `deploy/kubernetes.yaml` manifest creates a dedicated `kong-migrator` namespace and installs all required resources (ServiceAccount, ClusterRole, ClusterRoleBinding, Deployment, Service):
219-
220-
```bash
221-
kubectl apply -f deploy/kubernetes.yaml
222-
```
223-
224-
Wait for the pod to become ready:
225-
226-
```bash
227-
kubectl -n kong-migrator rollout status deployment/kong-migrator
228-
```
229-
230-
### Access the Dashboard
231-
232-
Port-forward the service to your local machine:
233-
234-
```bash
235-
kubectl -n kong-migrator port-forward svc/kong-migrator 8080:8080
236-
```
237-
238-
Then open [http://localhost:8080](http://localhost:8080) in your browser. The dashboard reads Ingress resources across all namespaces using the pod's service account — no kubeconfig or extra credentials required.
239-
240-
To restrict the dashboard to a single namespace, edit the Deployment and add `--namespace <your-namespace>` to the `args` list.
241-
242-
### Run locally with Docker (out-of-cluster)
243-
244-
You can run the dashboard as a Docker container outside the cluster by mounting your kubeconfig:
245-
246-
```bash
247-
docker run --rm \
248-
-p 8080:8080 \
249-
-e KUBECONFIG=/kubeconfig \
250-
-v "${KUBECONFIG:-$HOME/.kube/config}:/kubeconfig:ro" \
251-
kong/nginx-kong-migrator:latest ui
252-
```
253-
254-
Then open [http://localhost:8080](http://localhost:8080). The container reads the mounted kubeconfig to connect to whichever cluster context is currently active.
255-
256-
To target a specific context, set it before running:
257-
258-
```bash
259-
kubectl config use-context <your-context>
260-
docker run --rm \
261-
-p 8080:8080 \
262-
-e KUBECONFIG=/kubeconfig \
263-
-v "${KUBECONFIG:-$HOME/.kube/config}:/kubeconfig:ro" \
264-
kong/nginx-kong-migrator:latest ui
265-
```
266-
267-
### Uninstall
268-
269-
```bash
270-
kubectl delete -f deploy/kubernetes.yaml
271-
```
272-
273-
This removes all resources created by the manifest, including the `kong-migrator` namespace.
274305
275306
---
276307

pkg/ui/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ <h4 class="font-mono text-[10px] font-semibold uppercase tracking-[1px] text-tex
636636
},
637637

638638
toggleSelectAll() {
639-
const eligible = this.filteredIngresses.filter(i => i.status === 1);
639+
const eligible = this.filteredIngresses.filter(i => i.status === 1 || i.status === 2);
640640
const copy = { ...this.selectedRows };
641641
if (this.allEligibleSelected) {
642642
eligible.forEach(i => delete copy[i.namespace + '/' + i.name]);

0 commit comments

Comments
 (0)