Skip to content

Commit bcd7d4d

Browse files
committed
fix: update README.md for installtion add Dockerfile version and labels
Signed-off-by: Kevin Klopfenstein <kk@sudo-i.net>
1 parent a109496 commit bcd7d4d

2 files changed

Lines changed: 79 additions & 7 deletions

File tree

Dockerfile

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
FROM scratch
1+
# renovate: datasource=docker depName=stagex/core-busybox versioning=loose
2+
ARG BUSYBOX_IMAGE=stagex/core-busybox:sx2026.03.0@sha256:4f3e3849acb54972e7c4f1d08c320526e0f8b314130bda68f83f821b02b4890b
23

3-
COPY --from=stagex/core-busybox /bin/mkdir /bin/mkdir
4-
COPY --from=stagex/core-busybox /usr/bin/mkdir /usr/bin/mkdir
4+
# Import the pinned image so we can COPY from it (workaround for --from + ARG).
5+
FROM ${BUSYBOX_IMAGE} AS busybox
56

6-
COPY --from=stagex/core-busybox /bin/cp /bin/cp
7-
COPY --from=stagex/core-busybox /usr/bin/cp /usr/bin/cp
7+
# Layout stage: temporarily bring in mkdir to create the directory tree.
8+
# This stage's tools are discarded; only the resulting /plugins tree is used.
9+
FROM scratch AS layout
810

11+
COPY --from=busybox /bin/mkdir /bin/mkdir
12+
COPY --from=busybox /usr/bin/mkdir /usr/bin/mkdir
913

1014
RUN ["/bin/mkdir", "-p", "/plugins/capsule"]
11-
1215
COPY dist/main.js /plugins/capsule/main.js
1316
COPY package.json /plugins/capsule/package.json
17+
18+
# Final image: minimal for use as an initContainer volume image.
19+
FROM scratch
20+
21+
# cp is needed at runtime to support the documented pattern:
22+
# command: ['cp', '-r', '/plugins/capsule', '/plugins']
23+
# mkdir is build-time only and not included here.
24+
COPY --from=busybox /bin/cp /bin/cp
25+
COPY --from=busybox /usr/bin/cp /usr/bin/cp
26+
27+
COPY --from=layout /plugins /plugins
28+
29+
# OCI image labels (annotations / tags)
30+
LABEL org.opencontainers.image.source="https://github.com/projectcapsule/headlamp-plugin"
31+
LABEL org.opencontainers.image.description="Capsule multi-tenancy plugin for Headlamp"
32+
LABEL org.opencontainers.image.licenses="Apache-2.0"

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,64 @@ The plugin brings first-class multi-tenancy awareness to the Headlamp UI, includ
2626

2727
### Using a Release (recommended)
2828

29-
1. Download the latest `capsule-plugin-*.tar.gz` from the [Releases](https://github.com/projectcapsule/headlamp-plugin/releases) page.
29+
1. Download the latest `capsule-*.tar.gz` from the [Releases](https://github.com/projectcapsule/headlamp-plugin/releases) page.
3030
2. Open Headlamp.
3131
3. Go to **Settings → Plugins → Load plugin from file** and select the downloaded archive.
3232
4. The **Capsule** section will appear in the sidebar.
3333

34+
### In-cluster
35+
36+
#### Via init container (using our Docker image)
37+
38+
Example patch for the Headlamp Deployment (our image includes `cp`):
39+
40+
```yaml
41+
spec:
42+
template:
43+
spec:
44+
initContainers:
45+
- name: install-capsule-plugin
46+
image: ghcr.io/projectcapsule/headlamp-plugin:vX.Y.Z
47+
command: ['/bin/cp', '-r', '/plugins/capsule', '/target/plugins']
48+
volumeMounts:
49+
- name: plugins
50+
mountPath: /target/plugins
51+
containers:
52+
- name: headlamp
53+
volumeMounts:
54+
- name: plugins
55+
mountPath: /plugins
56+
containers:
57+
- name: headlamp
58+
volumeMounts:
59+
- name: plugins
60+
mountPath: /plugins
61+
volumes:
62+
- name: plugins
63+
emptyDir: {}
64+
```
65+
66+
#### Using an image volume (Kubernetes 1.31+)
67+
68+
69+
```yaml
70+
spec:
71+
template:
72+
spec:
73+
containers:
74+
- name: headlamp
75+
volumeMounts:
76+
- name: plugins
77+
mountPath: /plugins
78+
volumes:
79+
- name: plugins
80+
image:
81+
reference: ghcr.io/projectcapsule/headlamp-plugin:vX.Y.Z
82+
pullPolicy: IfNotPresent
83+
```
84+
85+
The image filesystem (containing `/plugins/capsule`) is mounted read-only at `/plugins`. This is the recommended approach when using a custom-built plugin image.
86+
3487
### Development / Hot Reload
3588

3689
See the [Development](#development) section below.

0 commit comments

Comments
 (0)