Frontend Forge FE Operations
When to use
Use this skill for operational work around FrontendExtension resources:
- Create or update an FE manifest
- Trigger or inspect package generation
- Force a rebuild with the rebuild-token annotation
- Download the generated package artifact
- Publish, unpublish, or delete an extension
- Inspect FE status, conditions, labels, Jobs, artifact ConfigMaps, and publish targets
- Debug FE package phases such as
Packaging, Ready, and Failed, plus publish/unpublish phases such as Pending, Running, Succeeded, and Failed
If the task is about FrontendIntegration runtime JSBundle creation, use the FI operations skill instead. FE package/publish does not create a runtime JSBundle in the current cluster.
Quick Entry
- Create or update FE -> read
references/lifecycle.md
- Rebuild package -> read
references/lifecycle.md
- Publish, unpublish, delete-with-unpublish, list through API, or download -> read
references/api.md
- Inspect package Job, artifact ConfigMap, publish Job, labels, or conditions -> read
references/inspection.md
- Debug stuck or failed state -> read
references/inspection.md, then check controller logs
Preconditions
- The current Kubernetes context is pointed at the target cluster.
- The FE CRD exists:
frontendextensions.frontend-forge.kubesphere.io.
- The FE controller is installed, usually as the
extension-controller component.
- The FE API is installed when using download, publish, unpublish, or delete-with-unpublish HTTP operations.
- The build service configured by
BUILD_SERVICE_BASE_URL is reachable from package Jobs.
- Publish target data exists when publishing, normally
ConfigMap/ksbuilder-publish-config in extension-frontend-forge.
Source of truth
Prefer live cluster state for operations and repo docs for expected behavior:
kubectl get fe <name> -o yaml
kubectl get jobs -n <work-namespace> -l frontend-forge.kubesphere.io/fe-name=<name>
spec/frontend-extension-design.md
spec/crds.md
spec/k8s-resources.md
config/samples/frontendextension-inspecttask.yaml
crates/api/src/fe.rs
crates/frontend-extension-controller
crates/frontend-forge-extension-api
Resource Model
FrontendExtension
- cluster-scoped
- short name:
fe
- source object for package, artifact, download, publish, and unpublish state
- Package Job
- namespaced
- default namespace:
extension-frontend-forge
- typical name:
fe-<fe-name>-package-<artifact-key-12>-a<attempt>
- Artifact ConfigMap
- namespaced
- default namespace:
extension-frontend-forge
- referenced by
status.artifact.storage.ref
- contains
binaryData["package.tgz"], data["artifact.json"], and data["files.json"]
- Publish or unpublish Job
- namespaced
- default namespace:
extension-frontend-forge
- typical names:
fe-<fe-name>-publish-<request-id-hash-short>
fe-<fe-name>-unpublish-<request-id-hash-short>
- Publish target
ConfigMap or Secret
- default chart target is usually
ConfigMap/ksbuilder-publish-config in the release namespace
Default names and namespaces can change through Helm values and controller environment variables. Use FE status, Job labels, and controller deployment env vars before assuming defaults.
Common Commands
Inspect FE:
kubectl get fe <name> -o yaml
kubectl get fe <name> -o jsonpath='{.status}{"\n"}'
kubectl get fe <name> -o jsonpath='{.status.phase}{" "}{.status.publish.phase}{" "}{.status.unpublish.phase}{"\n"}'
kubectl get fe -l frontend-forge.kubesphere.io/package-state=ready
kubectl get fe -l frontend-forge.kubesphere.io/publish-state=published
Create or update:
kubectl apply -f <file.yaml>
kubectl apply -f config/samples/frontendextension-inspecttask.yaml
Find package Job and logs:
kubectl get fe <name> -o jsonpath='{.status.packageJob.namespace}{" "}{.status.packageJob.name}{"\n"}'
kubectl -n <job-namespace> get job <job-name> -o yaml
kubectl -n <job-namespace> logs job/<job-name>
Find artifact ConfigMap:
kubectl get fe <name> -o jsonpath='{.status.artifact.storage.ref.namespace}{" "}{.status.artifact.storage.ref.name}{" "}{.status.artifact.storage.key}{"\n"}'
kubectl -n <artifact-namespace> get cm <artifact-configmap-name> -o yaml
Force a rebuild:
kubectl annotate fe <name> frontend-forge.kubesphere.io/rebuild-token="$(date +%s)" --overwrite
Inspect publish or unpublish Jobs:
kubectl get jobs -n extension-frontend-forge -l frontend-forge.kubesphere.io/fe-name=<name>
kubectl get fe <name> -o jsonpath='{.status.publish.jobRef.namespace}{" "}{.status.publish.jobRef.name}{"\n"}'
kubectl get fe <name> -o jsonpath='{.status.unpublish.jobRef.namespace}{" "}{.status.unpublish.jobRef.name}{"\n"}'
kubectl -n <job-namespace> logs job/<job-name>
FE API operations:
KS_API=https://<kubesphere-host>
FE_API="$KS_API/kapis/frontend-forge-api.kubesphere.io/v1alpha1/frontendextensions"
curl -fS "$FE_API/<name>"
curl -fS -u "user:password" "$FE_API/<name>" # user runs this if /kapis returns 401/403
curl -fS "$FE_API/<name>/publish" # read publish status only
curl -fS -X POST -H 'Content-Type: application/json' --data '{"requestId":"manual-1","expectedArtifactDigest":"sha256:<digest>"}' "$FE_API/<name>/publish"
curl -fS "$FE_API/<name>/unpublish" # read unpublish status only
curl -fS -X POST -H 'Content-Type: application/json' --data '{"requestId":"manual-unpublish-1"}' "$FE_API/<name>/unpublish"
curl -fS -X POST -H 'Content-Type: application/json' --data '{"unpublish":true}' "$FE_API/<name>/delete"
curl -fS -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"unpublish":true}' "$FE_API/<name>/delete"
curl -fL "$FE_API/<name>/download" -o <name>.tgz
Operating Rules
- Do not use
-n with kubectl get fe; FrontendExtension is cluster-scoped.
- Use the FE HTTP API for publish, unpublish, download, and delete-with-unpublish when available. It validates artifact readiness, publish target, digest expectations, and idempotency.
- For KubeSphere users, prefer
/kapis/frontend-forge-api.kubesphere.io/v1alpha1/frontendextensions; use direct service port-forwarding mainly for local debugging.
- If
/kapis returns 401 or 403, guide the user to run curl -u "user:password" ... or use their normal KubeSphere authenticated session. Do not ask them to paste credentials into the conversation.
- Treat publish and unpublish annotations as implementation details written by the FE API. Inspect them for debugging, but do not make raw annotation patches the default workflow.
- Directly patch publish/unpublish annotations only as a last-resort recovery step when the API is unavailable and the operator explicitly accepts the risk. Missing or stale generation, source hash, artifact digest, or target annotations can produce failed publish status.
- Do not expect package creation to publish the extension. Packaging and publishing are separate flows.
- Do not expect direct
kubectl delete fe <name> to unpublish first. Use the FE API delete endpoint with {"unpublish":true} for that behavior.
- Treat
status.artifact.artifactKey as build cache identity, not package content digest. Use status.artifact.digest for the generated package digest.
- Treat artifact ConfigMaps as controller-owned outputs. Read them for inspection, but do not edit or delete the ConfigMap referenced by
status.artifact.storage.ref unless the user has explicitly requested artifact cleanup and you have confirmed it is not the current artifact.
Safety Rules
Destructive operations:
- Before deleting an FE, check
.status.publish.phase, .status.publish.active, and .status.publish.artifactDigest.
- If a published extension should be removed, use the FE API delete endpoint with
{"unpublish":true} so the controller can unpublish before deleting.
- Avoid
kubectl delete fe <name> for published extensions unless the user explicitly wants to skip unpublish.
- Before deleting Jobs or artifact ConfigMaps, verify owner refs, labels, and whether FE status still references them.
Rebuild:
- Rebuild changes artifact cache identity and can make a previously published artifact stale. Before setting
frontend-forge.kubesphere.io/rebuild-token, record current .status.observedSourceHash, .status.artifact.digest, .status.artifact.artifactKey, .status.publish, and frontend-forge.kubesphere.io/publish-fresh.
- Prefer a unique rebuild token, such as a timestamp or incident id, and use
--overwrite.
- After rebuild, verify the new package reaches
Ready; republish only after confirming the new status.artifact.digest.
Artifact ConfigMap:
- Use the FE API download endpoint for package bytes when possible; it checks phase, download readiness, source hash, storage kind, and digest.
- Do not mutate
binaryData["package.tgz"], data["artifact.json"], or data["files.json"] in place. A manual edit can make status, annotations, and digest disagree.
- Do not delete the ConfigMap named by
.status.artifact.storage.ref during normal troubleshooting. If cleanup is requested, first confirm the current FE artifact points somewhere else or the FE itself is being deleted.
Status Fields To Check
FE package state:
.status.phase
.status.observedGeneration
.status.observedSourceHash
.status.observedRebuildToken
.status.conditions
.status.packageJob
.status.artifact
.status.download
Publish state:
.status.publish.phase
.status.publish.active
.status.publish.requestId
.status.publish.artifactDigest
.status.publish.jobRef
.status.publish.lastError
.status.unpublish.phase
.status.unpublish.requestId
.status.unpublish.extensionName
.status.unpublish.jobRef
.status.unpublish.lastError
Labels used for filtering:
frontend-forge.kubesphere.io/package-state: packaging, ready, failed
frontend-forge.kubesphere.io/publish-state: not-published, publishing, published, failed
frontend-forge.kubesphere.io/publish-fresh: true, false
Status consistency with implementation:
- FE package phase is only
Pending, Packaging, Ready, or Failed.
- Package Job phase is
Pending, Running, Succeeded, or Failed.
- Publish phase is
NotRequested, Pending, Running, Succeeded, or Failed.
- Unpublish phase is
NotRequested, Pending, Running, Succeeded, or Failed.
- Controller condition types are
SourceValid, ArtifactReady, DownloadReady, and PublishSucceeded.
PublishFailed appears as a PublishSucceeded condition reason when status.publish.phase=Failed; it is not a top-level FE phase.
Troubleshooting Order
- Inspect the FE object and status first.
- If package state is not
Ready, inspect status.conditions, status.packageJob, package Job logs, build-service reachability, and artifact ConfigMap state.
- If package state is
Ready but download fails, inspect status.download, status.artifact.storage, the artifact ConfigMap key, and digest consistency.
- If publish or unpublish fails, inspect
status.publish or status.unpublish, publisher Job logs, target ConfigMap or Secret contents, and API responses. Use annotations as diagnostic evidence, not as the primary operation path.
- If live behavior differs from expected defaults, inspect controller deployment env vars and Helm values before changing the FE.
Controller Logs
When status and Job logs are insufficient:
kubectl -n extension-frontend-forge logs deploy/frontend-forge-extension-controller --tail=200
kubectl -n extension-frontend-forge logs deploy/frontend-forge-extension-api --tail=200
Deployment names can vary by Helm release name. If those commands fail, list deployments with:
kubectl -n extension-frontend-forge get deploy -l app.kubernetes.io/component=extension-controller
kubectl -n extension-frontend-forge get deploy -l app.kubernetes.io/component=extension-api
1---2name: frontend-forge-fe-operations3description: Operate FrontendExtension (FE) resources in frontend-forge: create, update, rebuild, inspect package artifacts, download packages, publish, unpublish, delete, and debug package/publish controller behavior. Use this skill whenever the user mentions FE operations, FrontendExtension lifecycle, extension package/download/publish/unpublish, artifact ConfigMaps, package Jobs, publisher Jobs, publish target ConfigMaps or Secrets, rebuild-token, package-state/publish-state labels, or troubleshooting FE status in a Kubernetes cluster.4---5
6# Frontend Forge FE Operations
7
8## When to use
9
10Use this skill for operational work around `FrontendExtension` resources:
11
12- Create or update an FE manifest
13- Trigger or inspect package generation
14- Force a rebuild with the rebuild-token annotation
15- Download the generated package artifact
16- Publish, unpublish, or delete an extension
17- Inspect FE status, conditions, labels, Jobs, artifact ConfigMaps, and publish targets
18- Debug FE package phases such as `Packaging`, `Ready`, and `Failed`, plus publish/unpublish phases such as `Pending`, `Running`, `Succeeded`, and `Failed`
19
20If the task is about `FrontendIntegration` runtime `JSBundle` creation, use the FI operations skill instead. FE package/publish does not create a runtime `JSBundle` in the current cluster.
21
22## Quick Entry
23
24- Create or update FE -> read `references/lifecycle.md`
25- Rebuild package -> read `references/lifecycle.md`
26- Publish, unpublish, delete-with-unpublish, list through API, or download -> read `references/api.md`
27- Inspect package Job, artifact ConfigMap, publish Job, labels, or conditions -> read `references/inspection.md`
28- Debug stuck or failed state -> read `references/inspection.md`, then check controller logs
29
30## Preconditions
31
32- The current Kubernetes context is pointed at the target cluster.
33- The FE CRD exists: `frontendextensions.frontend-forge.kubesphere.io`.
34- The FE controller is installed, usually as the `extension-controller` component.
35- The FE API is installed when using download, publish, unpublish, or delete-with-unpublish HTTP operations.
36- The build service configured by `BUILD_SERVICE_BASE_URL` is reachable from package Jobs.
37- Publish target data exists when publishing, normally `ConfigMap/ksbuilder-publish-config` in `extension-frontend-forge`.
38
39## Source of truth
40
41Prefer live cluster state for operations and repo docs for expected behavior:
42
43- `kubectl get fe <name> -o yaml`
44- `kubectl get jobs -n <work-namespace> -l frontend-forge.kubesphere.io/fe-name=<name>`
45- `spec/frontend-extension-design.md`
46- `spec/crds.md`
47- `spec/k8s-resources.md`
48- `config/samples/frontendextension-inspecttask.yaml`
49- `crates/api/src/fe.rs`
50- `crates/frontend-extension-controller`
51- `crates/frontend-forge-extension-api`
52
53## Resource Model
54
55- `FrontendExtension`
56 - cluster-scoped
57 - short name: `fe`
58 - source object for package, artifact, download, publish, and unpublish state
59- Package Job
60 - namespaced
61 - default namespace: `extension-frontend-forge`
62 - typical name: `fe-<fe-name>-package-<artifact-key-12>-a<attempt>`
63- Artifact ConfigMap
64 - namespaced
65 - default namespace: `extension-frontend-forge`
66 - referenced by `status.artifact.storage.ref`
67 - contains `binaryData["package.tgz"]`, `data["artifact.json"]`, and `data["files.json"]`
68- Publish or unpublish Job
69 - namespaced
70 - default namespace: `extension-frontend-forge`
71 - typical names:
72 - `fe-<fe-name>-publish-<request-id-hash-short>`
73 - `fe-<fe-name>-unpublish-<request-id-hash-short>`
74- Publish target
75 - `ConfigMap` or `Secret`
76 - default chart target is usually `ConfigMap/ksbuilder-publish-config` in the release namespace
77
78Default names and namespaces can change through Helm values and controller environment variables. Use FE status, Job labels, and controller deployment env vars before assuming defaults.
79
80## Common Commands
81
82Inspect FE:
83
84```bash
85kubectl get fe <name> -o yaml
86kubectl get fe <name> -o jsonpath='{.status}{"\n"}'
87kubectl get fe <name> -o jsonpath='{.status.phase}{" "}{.status.publish.phase}{" "}{.status.unpublish.phase}{"\n"}'
88kubectl get fe -l frontend-forge.kubesphere.io/package-state=ready
89kubectl get fe -l frontend-forge.kubesphere.io/publish-state=published
90```
91
92Create or update:
93
94```bash
95kubectl apply -f <file.yaml>
96kubectl apply -f config/samples/frontendextension-inspecttask.yaml
97```
98
99Find package Job and logs:
100
101```bash
102kubectl get fe <name> -o jsonpath='{.status.packageJob.namespace}{" "}{.status.packageJob.name}{"\n"}'
103kubectl -n <job-namespace> get job <job-name> -o yaml
104kubectl -n <job-namespace> logs job/<job-name>
105```
106
107Find artifact ConfigMap:
108
109```bash
110kubectl get fe <name> -o jsonpath='{.status.artifact.storage.ref.namespace}{" "}{.status.artifact.storage.ref.name}{" "}{.status.artifact.storage.key}{"\n"}'
111kubectl -n <artifact-namespace> get cm <artifact-configmap-name> -o yaml
112```
113
114Force a rebuild:
115
116```bash
117kubectl annotate fe <name> frontend-forge.kubesphere.io/rebuild-token="$(date +%s)" --overwrite
118```
119
120Inspect publish or unpublish Jobs:
121
122```bash
123kubectl get jobs -n extension-frontend-forge -l frontend-forge.kubesphere.io/fe-name=<name>
124kubectl get fe <name> -o jsonpath='{.status.publish.jobRef.namespace}{" "}{.status.publish.jobRef.name}{"\n"}'
125kubectl get fe <name> -o jsonpath='{.status.unpublish.jobRef.namespace}{" "}{.status.unpublish.jobRef.name}{"\n"}'
126kubectl -n <job-namespace> logs job/<job-name>
127```
128
129FE API operations:
130
131```bash
132KS_API=https://<kubesphere-host>
133FE_API="$KS_API/kapis/frontend-forge-api.kubesphere.io/v1alpha1/frontendextensions"
134curl -fS "$FE_API/<name>"
135curl -fS -u "user:password" "$FE_API/<name>" # user runs this if /kapis returns 401/403
136curl -fS "$FE_API/<name>/publish" # read publish status only
137curl -fS -X POST -H 'Content-Type: application/json' --data '{"requestId":"manual-1","expectedArtifactDigest":"sha256:<digest>"}' "$FE_API/<name>/publish"
138curl -fS "$FE_API/<name>/unpublish" # read unpublish status only
139curl -fS -X POST -H 'Content-Type: application/json' --data '{"requestId":"manual-unpublish-1"}' "$FE_API/<name>/unpublish"
140curl -fS -X POST -H 'Content-Type: application/json' --data '{"unpublish":true}' "$FE_API/<name>/delete"
141curl -fS -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"unpublish":true}' "$FE_API/<name>/delete"
142curl -fL "$FE_API/<name>/download" -o <name>.tgz
143```
144
145## Operating Rules
146
147- Do not use `-n` with `kubectl get fe`; `FrontendExtension` is cluster-scoped.
148- Use the FE HTTP API for publish, unpublish, download, and delete-with-unpublish when available. It validates artifact readiness, publish target, digest expectations, and idempotency.
149- For KubeSphere users, prefer `/kapis/frontend-forge-api.kubesphere.io/v1alpha1/frontendextensions`; use direct service port-forwarding mainly for local debugging.
150- If `/kapis` returns `401` or `403`, guide the user to run `curl -u "user:password" ...` or use their normal KubeSphere authenticated session. Do not ask them to paste credentials into the conversation.
151- Treat publish and unpublish annotations as implementation details written by the FE API. Inspect them for debugging, but do not make raw annotation patches the default workflow.
152- Directly patch publish/unpublish annotations only as a last-resort recovery step when the API is unavailable and the operator explicitly accepts the risk. Missing or stale generation, source hash, artifact digest, or target annotations can produce failed publish status.
153- Do not expect package creation to publish the extension. Packaging and publishing are separate flows.
154- Do not expect direct `kubectl delete fe <name>` to unpublish first. Use the FE API delete endpoint with `{"unpublish":true}` for that behavior.
155- Treat `status.artifact.artifactKey` as build cache identity, not package content digest. Use `status.artifact.digest` for the generated package digest.
156- Treat artifact ConfigMaps as controller-owned outputs. Read them for inspection, but do not edit or delete the ConfigMap referenced by `status.artifact.storage.ref` unless the user has explicitly requested artifact cleanup and you have confirmed it is not the current artifact.
157
158## Safety Rules
159
160Destructive operations:
161
162- Before deleting an FE, check `.status.publish.phase`, `.status.publish.active`, and `.status.publish.artifactDigest`.
163- If a published extension should be removed, use the FE API delete endpoint with `{"unpublish":true}` so the controller can unpublish before deleting.
164- Avoid `kubectl delete fe <name>` for published extensions unless the user explicitly wants to skip unpublish.
165- Before deleting Jobs or artifact ConfigMaps, verify owner refs, labels, and whether FE status still references them.
166
167Rebuild:
168
169- Rebuild changes artifact cache identity and can make a previously published artifact stale. Before setting `frontend-forge.kubesphere.io/rebuild-token`, record current `.status.observedSourceHash`, `.status.artifact.digest`, `.status.artifact.artifactKey`, `.status.publish`, and `frontend-forge.kubesphere.io/publish-fresh`.
170- Prefer a unique rebuild token, such as a timestamp or incident id, and use `--overwrite`.
171- After rebuild, verify the new package reaches `Ready`; republish only after confirming the new `status.artifact.digest`.
172
173Artifact ConfigMap:
174
175- Use the FE API download endpoint for package bytes when possible; it checks phase, download readiness, source hash, storage kind, and digest.
176- Do not mutate `binaryData["package.tgz"]`, `data["artifact.json"]`, or `data["files.json"]` in place. A manual edit can make status, annotations, and digest disagree.
177- Do not delete the ConfigMap named by `.status.artifact.storage.ref` during normal troubleshooting. If cleanup is requested, first confirm the current FE artifact points somewhere else or the FE itself is being deleted.
178
179## Status Fields To Check
180
181FE package state:
182
183- `.status.phase`
184- `.status.observedGeneration`
185- `.status.observedSourceHash`
186- `.status.observedRebuildToken`
187- `.status.conditions`
188- `.status.packageJob`
189- `.status.artifact`
190- `.status.download`
191
192Publish state:
193
194- `.status.publish.phase`
195- `.status.publish.active`
196- `.status.publish.requestId`
197- `.status.publish.artifactDigest`
198- `.status.publish.jobRef`
199- `.status.publish.lastError`
200- `.status.unpublish.phase`
201- `.status.unpublish.requestId`
202- `.status.unpublish.extensionName`
203- `.status.unpublish.jobRef`
204- `.status.unpublish.lastError`
205
206Labels used for filtering:
207
208- `frontend-forge.kubesphere.io/package-state`: `packaging`, `ready`, `failed`
209- `frontend-forge.kubesphere.io/publish-state`: `not-published`, `publishing`, `published`, `failed`
210- `frontend-forge.kubesphere.io/publish-fresh`: `true`, `false`
211
212Status consistency with implementation:
213
214- FE package phase is only `Pending`, `Packaging`, `Ready`, or `Failed`.
215- Package Job phase is `Pending`, `Running`, `Succeeded`, or `Failed`.
216- Publish phase is `NotRequested`, `Pending`, `Running`, `Succeeded`, or `Failed`.
217- Unpublish phase is `NotRequested`, `Pending`, `Running`, `Succeeded`, or `Failed`.
218- Controller condition types are `SourceValid`, `ArtifactReady`, `DownloadReady`, and `PublishSucceeded`.
219- `PublishFailed` appears as a `PublishSucceeded` condition reason when `status.publish.phase=Failed`; it is not a top-level FE phase.
220
221## Troubleshooting Order
222
2231. Inspect the FE object and status first.
2242. If package state is not `Ready`, inspect `status.conditions`, `status.packageJob`, package Job logs, build-service reachability, and artifact ConfigMap state.
2253. If package state is `Ready` but download fails, inspect `status.download`, `status.artifact.storage`, the artifact ConfigMap key, and digest consistency.
2264. If publish or unpublish fails, inspect `status.publish` or `status.unpublish`, publisher Job logs, target ConfigMap or Secret contents, and API responses. Use annotations as diagnostic evidence, not as the primary operation path.
2275. If live behavior differs from expected defaults, inspect controller deployment env vars and Helm values before changing the FE.
228
229## Controller Logs
230
231When status and Job logs are insufficient:
232
233```bash
234kubectl -n extension-frontend-forge logs deploy/frontend-forge-extension-controller --tail=200
235kubectl -n extension-frontend-forge logs deploy/frontend-forge-extension-api --tail=200
236```
237
238Deployment names can vary by Helm release name. If those commands fail, list deployments with:
239
240```bash
241kubectl -n extension-frontend-forge get deploy -l app.kubernetes.io/component=extension-controller
242kubectl -n extension-frontend-forge get deploy -l app.kubernetes.io/component=extension-api
243```