Skip to content

Commit 904a1c4

Browse files
committed
feat(pm): pin kcp front-proxy via hostAliases, IP set through kustomize
The wildwest-controller's endpoint watcher dials the APIExport virtual-workspace URL (https://root.kcp.localhost:8443/...) directly. Inside the pod that hostname resolves to 127.0.0.1, so the watch fails with connection refused. Enable common.hostAliases on the controller to pin *.kcp.localhost to the in-cluster front-proxy service. The ClusterIP is environment-specific, so it is exposed as the single editable field via a kustomize JSON patch in kustomization.yaml rather than hardcoded in the manifest. Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
1 parent 726fd64 commit 904a1c4

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: cache.kcp.io/v1alpha1
2+
kind: CachedResourceEndpointSlice
3+
metadata:
4+
name: armaments
5+
spec:
6+
cachedResource:
7+
name: armaments
8+
export:
9+
name: wildwest.platform-mesh.io

config/pm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ subroutines:
2020
| 2 | `ProviderResource`| Creates a kcp `Provider` (default path `root:providers:system`). The Provider controller provisions a dedicated provider **workspace** + a scoped admin kubeconfig `Secret`. |
2121
| 3 | `WaitProvider` | Waits for the `Provider` to reach `phase=Ready`. |
2222
| 4 | `KubeconfigCopy` | Copies that kubeconfig into the runtime namespace as `Secret/wildwest-provider-kubeconfig` (key `kubeconfig`). |
23-
| 5 | `Deploy` | For each `runtimeDeployments[].ocm` entry, creates a Flux `OCIRepository` (`oci://<registry>/<componentName>:<version>`, helm-chart layer) + a `HelmRelease` that installs the chart into the runtime namespace. |
23+
| 5 | `Deploy` | For each `runtimeDeployments[].flux` entry, creates a Flux `OCIRepository` (`oci://<registry>/<chart>:<version>`, helm-chart layer) + a `HelmRelease` that installs the chart into the runtime namespace. |
2424

2525
The provider workspace created in step 2 is **empty**. The `wildwest-controller`
2626
chart's **init container** (`init.enabled: true`) bootstraps the workspace content —
@@ -58,7 +58,7 @@ Published artifacts the manifest references:
5858
> on every `v*` tag (via `make helm-push`). CI versions all release artifacts from the git
5959
> tag (`VERSION = ${tag#v}`), so the chart version equals the release tag — latest is
6060
> `v0.0.7`. (The internal `deploy/helm/*/Chart.yaml` version is overridden at publish
61-
> time.) If you publish elsewhere, update `registry` / `componentName` / `version` in
61+
> time.) If you publish elsewhere, update `registry` / `chart` / `version` in
6262
> [`managedprovider.yaml`](./managedprovider.yaml) accordingly.
6363
6464
## Configure the front-proxy IP (required)

config/pm/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ patches:
2626
name: wildwest
2727
patch: |
2828
- op: replace
29-
path: /spec/runtimeDeployments/0/ocm/values/hostAliases/entries/0/ip
29+
path: /spec/runtimeDeployments/0/flux/values/hostAliases/entries/0/ip
3030
value: "10.96.188.4"
3131
- op: replace
32-
path: /spec/runtimeDeployments/2/ocm/values/hostAliases/entries/0/ip
32+
path: /spec/runtimeDeployments/2/flux/values/hostAliases/entries/0/ip
3333
value: "10.96.188.4"

config/pm/managedprovider.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# 3. WaitProvider - waits for the Provider to reach phase=Ready.
99
# 4. KubeconfigCopy - copies that kubeconfig into this runtime namespace as
1010
# Secret "<name>-provider-kubeconfig" (key: kubeconfig).
11-
# 5. Deploy - for every runtimeDeployments[].ocm entry it creates a Flux
12-
# OCIRepository (oci://<registry>/<componentName>:<version>,
11+
# 5. Deploy - for every runtimeDeployments[].flux entry it creates a Flux
12+
# OCIRepository (oci://<registry>/<chart>:<version>,
1313
# helm-chart layer) + a HelmRelease that installs the chart
1414
# into this namespace.
1515
#
@@ -31,13 +31,13 @@ spec:
3131
cleanupOnDelete: false
3232

3333
# Components installed into the runtime cluster. Each entry points Flux at an
34-
# OCI Helm chart artifact: oci://<registry>/<componentName>:<version>.
34+
# OCI Helm chart artifact: oci://<registry>/<chart>:<version>.
3535
runtimeDeployments:
3636
# ---- Wild West controller -------------------------------------------------
37-
- ocm:
38-
componentName: wildwest-controller
37+
- flux:
38+
chart: wildwest-controller
3939
registry: ghcr.io/platform-mesh/provider-quickstart/charts
40-
version: "0.0.7"
40+
version: "0.0.8"
4141
values:
4242
# Provider-workspace kubeconfig copied in by the operator
4343
# (defaults to <ManagedProvider.name>-provider-kubeconfig / key "kubeconfig").
@@ -75,10 +75,10 @@ spec:
7575
- localhost
7676

7777
# ---- Wild West portal (Angular UI) ---------------------------------------
78-
- ocm:
79-
componentName: wildwest-portal
78+
- flux:
79+
chart: wildwest-portal
8080
registry: ghcr.io/platform-mesh/provider-quickstart/charts
81-
version: "0.0.7"
81+
version: "0.0.8"
8282
# Portal needs no kubeconfig. Expose it through the platform Gateway.
8383
# These values are passed verbatim into the HelmRelease; the chart defaults
8484
# already match the platform-mesh-system Gateway / CORS setup, so enabling the
@@ -102,10 +102,10 @@ spec:
102102
# Armament CRs. Connects to kcp via the provider workspace kubeconfig
103103
# (KUBECONFIG=/etc/kcp/kubeconfig), so it needs the same kubeconfig + hostAliases
104104
# wiring as the controller.
105-
- ocm:
106-
componentName: wildwest-armament-sync
105+
- flux:
106+
chart: wildwest-armament-sync
107107
registry: ghcr.io/platform-mesh/provider-quickstart/charts
108-
version: "0.0.7"
108+
version: "0.0.8"
109109
values:
110110
# Chart default is wildwest-controller-kubeconfig; under ManagedProvider the
111111
# operator copies the provider kubeconfig as wildwest-provider-kubeconfig.

0 commit comments

Comments
 (0)