Skip to content

Commit a52cc91

Browse files
Add SupportAssist uploads and authenticated archive access
1 parent 88bb2ff commit a52cc91

8 files changed

Lines changed: 177 additions & 6 deletions

File tree

‎charts/argocd-understack/templates/application-cdn.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spec:
2525
repoURL: {{ include "understack.understack_url" $ }}
2626
targetRevision: {{ include "understack.understack_ref" $ }}
2727
- ref: deploy
28+
path: {{ include "understack.deploy_path" $ }}/understack-cdn
2829
repoURL: {{ include "understack.deploy_url" $ }}
2930
targetRevision: {{ include "understack.deploy_ref" $ }}
3031
syncPolicy:

‎components/understack-cdn/README.md‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,76 @@ Images are stored in Object Store
55
Caching reverse-proxies at each fabric will fetch the images from Object Store
66
and make them available via HTTPS.
77

8+
When enabled, the same pod also accepts SupportAssist HTTP uploads into a
9+
dedicated `supportassist` PVC.
10+
811
This allows a device to access firmware images via an HTTPS request to a
912
cluster-local tendot IP address.
1013

14+
## SupportAssist uploads
15+
16+
Enable `supportassist.enabled` in the site's CDN values to provision a dedicated
17+
`supportassist` PVC. It defaults to `40Gi` on `openebs-lvm`; set
18+
`supportassist.storageSize` and `supportassist.storageClassName` for the site.
19+
Diagnostic archives are separate from the firmware cache and object bucket.
20+
21+
Route `/supportassist/` to Service `cdn-edge`, port **8081**, using an HTTPRoute
22+
attached only to the internal gateway. The existing firmware Service port 80
23+
does not expose uploads. Sites own this route; the CDN chart does not choose
24+
a gateway or address. For iad3-dev, the share URL is
25+
`http://10.46.100.83/supportassist/`. The IP-based route supports iDRACs without
26+
DNS servers configured. Use the IP URL: the existing CDN hostname routes to
27+
the firmware listener.
28+
29+
iDRAC appends the collection filename and sends a PUT with Content-Length and
30+
the raw ZIP body. NGINX WebDAV writes the body to a temporary file on the same
31+
PVC, then renames it into `/var/lib/nginx/supportassist/`. Only PUT beneath
32+
`/supportassist/` is allowed; query strings are rejected. HTTP download,
33+
listing and deletion are not exposed on this listener. Clients that can reach this
34+
credential-free internal listener can upload or overwrite archives.
35+
36+
### Authenticated archive reads
37+
38+
Set `supportassist.downloadSecretName` to an existing Secret in the CDN namespace
39+
with an `htpasswd` key containing an NGINX-compatible password file. With
40+
SupportAssist enabled, this exposes `/supportassist-archives/` on the existing
41+
firmware listener (Service port 80). Use the existing HTTPS gateway hostname;
42+
do not expose this password-protected endpoint over plain HTTP.
43+
44+
Authenticated GET/HEAD requests can list archives as JSON or read a ZIP. Other
45+
methods are denied, and responses carry `Cache-Control: private, no-store`.
46+
Without the Secret setting, this read location is not enabled. Uploads remain
47+
on the separate internal listener.
48+
49+
NodeDash can use a dedicated reader credential server-side, checking Ironic's
50+
vendor passthru policy and the selected node's inventory serial before returning
51+
metadata or streaming a file. The CDN credential itself grants read access to
52+
all archives; never give it to browser clients. There is no per-node policy in
53+
NGINX. Rotate the password file and NodeDash credential together.
54+
55+
### Retrieval and capacity
56+
57+
Without NodeDash downloads configured, use Kubernetes access to find the pod
58+
and copy a completed archive locally:
59+
60+
```sh
61+
kubectl -n understack-cdn get pods -l app=cdn-edge
62+
kubectl -n understack-cdn exec <pod-name> -c nginx -- ls -lh /var/lib/nginx/supportassist
63+
kubectl -n understack-cdn cp <pod-name>:/var/lib/nginx/supportassist/<filename>.zip ./<filename>.zip -c nginx
64+
```
65+
66+
Concurrent uploads share the PVC's available space; uploads fail when the
67+
volume fills. Monitor free space, for example with
68+
`kubectl -n understack-cdn exec <pod-name> -c nginx -- df -h /var/lib/nginx`.
69+
NGINX permits 300 seconds without upload progress; the iad3-dev internal route
70+
allows 15 minutes per request. Verify large collections against these limits
71+
on the target iDRAC firmware.
72+
73+
Archives are retained on the PVC. Operators manage retention, capacity and
74+
archiving. Archival storage after **90 days**
75+
requires an archive destination and transfer mechanism; verify retrieval
76+
before enabling it.
77+
1178
## Proxy configuration
1279

1380
The proxy edge service caches files locally on a persistent volume.

‎components/understack-cdn/templates/deployment.yaml.tpl‎

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ spec:
1010
matchLabels:
1111
app: cdn-edge
1212
strategy:
13-
type: RollingUpdate
14-
rollingUpdate:
15-
maxSurge: 1
16-
maxUnavailable: 0
13+
# Avoid overlapping pods using the same persistent storage during upgrades.
14+
type: Recreate
15+
# Clear existing rolling-update settings so Argo CD can apply Recreate.
16+
rollingUpdate: null
1717
template:
1818
metadata:
1919
labels:
@@ -27,13 +27,25 @@ spec:
2727
volumeMounts:
2828
- name: nginx-cache
2929
mountPath: /var/cache/nginx
30+
{{- if .Values.supportassist.enabled }}
31+
- name: supportassist-dir-init
32+
image: busybox:1.36
33+
command: ["sh", "-c", "mkdir -p /var/lib/nginx/supportassist /var/lib/nginx/client_temp && chown 101:101 /var/lib/nginx/supportassist /var/lib/nginx/client_temp"]
34+
volumeMounts:
35+
- name: supportassist
36+
mountPath: /var/lib/nginx
37+
{{- end }}
3038

3139
containers:
3240
- name: nginx
3341
image: nginx:1.27-alpine
3442
ports:
3543
- containerPort: 8080
3644
name: http
45+
{{- if .Values.supportassist.enabled }}
46+
- containerPort: 8081
47+
name: supportassist
48+
{{- end }}
3749

3850
resources:
3951
requests:
@@ -52,6 +64,15 @@ spec:
5264
subPath: default.conf
5365
- name: nginx-cache
5466
mountPath: /var/cache/nginx
67+
{{- if .Values.supportassist.enabled }}
68+
- name: supportassist
69+
mountPath: /var/lib/nginx
70+
{{- if .Values.supportassist.downloadSecretName }}
71+
- name: supportassist-auth
72+
mountPath: /etc/nginx/supportassist-auth
73+
readOnly: true
74+
{{- end }}
75+
{{- end }}
5576

5677
livenessProbe:
5778
httpGet:
@@ -86,5 +107,15 @@ spec:
86107
- name: nginx-cache
87108
persistentVolumeClaim:
88109
claimName: nginx-cache
110+
{{- if .Values.supportassist.enabled }}
111+
- name: supportassist
112+
persistentVolumeClaim:
113+
claimName: supportassist
114+
{{- if .Values.supportassist.downloadSecretName }}
115+
- name: supportassist-auth
116+
secret:
117+
secretName: {{ .Values.supportassist.downloadSecretName | quote }}
118+
{{- end }}
119+
{{- end }}
89120

90121
terminationGracePeriodSeconds: 30

‎components/understack-cdn/templates/nginx-config.yaml.tpl‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,19 @@ data:
135135
proxy_buffering on;
136136
}
137137
138+
{{- if and .Values.supportassist.enabled .Values.supportassist.downloadSecretName }}
139+
location /supportassist-archives/ {
140+
limit_except GET { deny all; }
141+
auth_basic "SupportAssist archives";
142+
auth_basic_user_file /etc/nginx/supportassist-auth/htpasswd;
143+
alias /var/lib/nginx/supportassist/;
144+
autoindex on;
145+
autoindex_format json;
146+
add_header Cache-Control "private, no-store" always;
147+
add_header X-Content-Type-Options nosniff always;
148+
}
149+
{{- end }}
150+
138151
# Health check endpoint (used by k8s liveness/readiness probes)
139152
location /healthz {
140153
access_log off;
@@ -151,3 +164,26 @@ data:
151164
deny all;
152165
}
153166
}
167+
{{- if .Values.supportassist.enabled }}
168+
169+
# Only the internal SupportAssist route targets this listener.
170+
server {
171+
listen 8081;
172+
server_name supportassist;
173+
174+
location /supportassist/ {
175+
if ($request_method != PUT) { return 405; }
176+
if ($is_args != "") { return 400; }
177+
if ($content_length = "") { return 411; }
178+
179+
root /var/lib/nginx;
180+
client_body_temp_path /var/lib/nginx/client_temp;
181+
client_max_body_size 2g;
182+
client_body_timeout 300s;
183+
dav_methods PUT;
184+
create_full_put_path on;
185+
}
186+
187+
location / { return 404; }
188+
}
189+
{{- end }}

‎components/understack-cdn/templates/service.yaml.tpl‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,9 @@ spec:
99
- name: http
1010
port: 80
1111
targetPort: 8080
12+
{{- if .Values.supportassist.enabled }}
13+
- name: supportassist
14+
port: 8081
15+
targetPort: supportassist
16+
{{- end }}
1217
type: ClusterIP
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.supportassist.enabled }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: supportassist
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
storageClassName: {{ .Values.supportassist.storageClassName }}
10+
resources:
11+
requests:
12+
storage: {{ .Values.supportassist.storageSize }}
13+
{{- end }}

‎components/understack-cdn/values.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@ cdn:
1616
objectBucketIsLocal: false
1717
# If above is true, how much space to claim for this object bucket:
1818
bucketMaxSize: 40g
19+
20+
supportassist:
21+
enabled: false
22+
storageClassName: openebs-lvm
23+
storageSize: 40Gi
24+
# Secret with an htpasswd key; enables authenticated reads on the HTTPS CDN route.
25+
downloadSecretName: ""

‎docs/deploy-guide/components/cdn.md‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,19 @@ site:
4040
4141
Required or commonly required items:
4242
43-
- `values.yaml`: Provide CDN ingress, object-bucket, cache, and runtime settings in `$CLUSTER_NAME/understack-cdn/values.yaml`.
43+
- `values.yaml`: Provide CDN object-bucket and cache settings in `$CLUSTER_NAME/understack-cdn/values.yaml`.
4444

4545
Optional additions:
4646

47-
- `Object storage credential Secret`: If your values reference an authenticated backend instead of anonymous access, create the Secret name referenced by the chart and populate it with the key names that backend expects.
47+
- Enable `supportassist.enabled` to create a dedicated `supportassist` PVC
48+
for HTTP PUT uploads. Set `supportassist.storageSize` (default `40Gi`) and
49+
`supportassist.storageClassName` (default `openebs-lvm`) for the site.
50+
- Add a site HTTPRoute on the internal gateway for PUT `/supportassist/` to
51+
`understack-cdn/cdn-edge` port `8081`. The firmware listener uses port `80`.
52+
An IP-based URL works for iDRACs without DNS configured.
53+
54+
NGINX WebDAV stores uploaded archives on the PVC. Retrieve completed archives
55+
with `kubectl cp` and monitor available disk space. Operators manage archive
56+
retention and capacity; uploads fail when the volume fills.
57+
See the [CDN README](https://github.com/rackerlabs/understack/blob/main/components/understack-cdn/README.md#supportassist-uploads)
58+
for retrieval commands, timeouts and access behavior.

0 commit comments

Comments
 (0)