Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/argocd-understack/templates/application-cdn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
repoURL: {{ include "understack.understack_url" $ }}
targetRevision: {{ include "understack.understack_ref" $ }}
- ref: deploy
path: {{ include "understack.deploy_path" $ }}/understack-cdn
repoURL: {{ include "understack.deploy_url" $ }}
targetRevision: {{ include "understack.deploy_ref" $ }}
syncPolicy:
Expand Down
67 changes: 67 additions & 0 deletions components/understack-cdn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,76 @@ Images are stored in Object Store
Caching reverse-proxies at each fabric will fetch the images from Object Store
and make them available via HTTPS.

When enabled, the same pod also accepts SupportAssist HTTP uploads into a
dedicated `supportassist` PVC.

This allows a device to access firmware images via an HTTPS request to a
cluster-local tendot IP address.

## SupportAssist uploads

Enable `supportassist.enabled` in the site's CDN values to provision a dedicated
`supportassist` PVC. It defaults to `40Gi` on `openebs-lvm`; set
`supportassist.storageSize` and `supportassist.storageClassName` for the site.
Diagnostic archives are separate from the firmware cache and object bucket.

Route `/supportassist/` to Service `cdn-edge`, port **8081**, using an HTTPRoute
attached only to the internal gateway. The existing firmware Service port 80
does not expose uploads. Sites own this route; the CDN chart does not choose
a gateway or address. For iad3-dev, the share URL is
`http://10.46.100.83/supportassist/`. The IP-based route supports iDRACs without
DNS servers configured. Use the IP URL: the existing CDN hostname routes to
the firmware listener.

iDRAC appends the collection filename and sends a PUT with Content-Length and
the raw ZIP body. NGINX WebDAV writes the body to a temporary file on the same
PVC, then renames it into `/var/lib/nginx/supportassist/`. Only PUT beneath
`/supportassist/` is allowed; query strings are rejected. HTTP download,
listing and deletion are not exposed on this listener. Clients that can reach this
credential-free internal listener can upload or overwrite archives.

### Authenticated archive reads

With SupportAssist enabled, the chart requires a Secret named
`supportassist-download-auth` in the CDN namespace, with an `htpasswd` key
containing an NGINX-compatible password file. The pod does not start until it
exists. This exposes `/supportassist-archives/` on the existing
firmware listener (Service port 80). Use the existing HTTPS gateway hostname;
do not expose this password-protected endpoint over plain HTTP.

Authenticated GET/HEAD requests can list archives as JSON or read a ZIP. Other
methods are denied, and responses carry `Cache-Control: private, no-store`.
Uploads remain on the separate internal listener.

NodeDash can use a dedicated reader credential server-side, checking Ironic's
vendor passthru policy and reading only the selected node's UUID directory before returning
metadata or streaming a file. The CDN credential itself grants read access to
all archives; never give it to browser clients. There is no per-node policy in
NGINX. Rotate the password file and NodeDash credential together.

### Retrieval and capacity

Without NodeDash downloads configured, use Kubernetes access to find the pod
and copy a completed archive locally:

```sh
kubectl -n understack-cdn get pods -l app=cdn-edge
kubectl -n understack-cdn exec <pod-name> -c nginx -- ls -lh /var/lib/nginx/supportassist
kubectl -n understack-cdn cp <pod-name>:/var/lib/nginx/supportassist/<filename>.zip ./<filename>.zip -c nginx
```

Concurrent uploads share the PVC's available space; uploads fail when the
volume fills. Monitor free space, for example with
`kubectl -n understack-cdn exec <pod-name> -c nginx -- df -h /var/lib/nginx`.
NGINX permits 300 seconds without upload progress; the iad3-dev internal route
allows 15 minutes per request. Verify large collections against these limits
on the target iDRAC firmware.

Archives are retained on the PVC. Operators manage retention, capacity and
archiving. Archival storage after **90 days**
requires an archive destination and transfer mechanism; verify retrieval
before enabling it.

## Proxy configuration

The proxy edge service caches files locally on a persistent volume.
Expand Down
35 changes: 31 additions & 4 deletions components/understack-cdn/templates/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ spec:
matchLabels:
app: cdn-edge
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
# Avoid overlapping pods using the same persistent storage during upgrades.
type: Recreate
# Clear existing rolling-update settings so Argo CD can apply Recreate.
rollingUpdate: null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows overlapping CDN pods sharing both PVCs. While testing in dev It blocked dev rollout. ReadWriteOnce permits multiple pods on the same node, so it does not automatically mean the rollout will fail. Kubernetes documentation

template:
metadata:
labels:
Expand All @@ -27,13 +27,25 @@ spec:
volumeMounts:
- name: nginx-cache
mountPath: /var/cache/nginx
{{- if .Values.supportassist.enabled }}
- name: supportassist-dir-init
image: busybox:1.36
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"]
volumeMounts:
- name: supportassist
mountPath: /var/lib/nginx
{{- end }}

containers:
- name: nginx
image: nginx:1.27-alpine
ports:
- containerPort: 8080
name: http
{{- if .Values.supportassist.enabled }}
- containerPort: 8081
name: supportassist
{{- end }}

resources:
requests:
Expand All @@ -52,6 +64,13 @@ spec:
subPath: default.conf
- name: nginx-cache
mountPath: /var/cache/nginx
{{- if .Values.supportassist.enabled }}
- name: supportassist
mountPath: /var/lib/nginx
- name: supportassist-auth
mountPath: /etc/nginx/supportassist-auth
readOnly: true
{{- end }}

livenessProbe:
httpGet:
Expand Down Expand Up @@ -86,5 +105,13 @@ spec:
- name: nginx-cache
persistentVolumeClaim:
claimName: nginx-cache
{{- if .Values.supportassist.enabled }}
- name: supportassist
persistentVolumeClaim:
claimName: supportassist
- name: supportassist-auth
secret:
secretName: supportassist-download-auth
{{- end }}

terminationGracePeriodSeconds: 30
36 changes: 36 additions & 0 deletions components/understack-cdn/templates/nginx-config.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ data:
proxy_buffering on;
}

{{- if .Values.supportassist.enabled }}
location /supportassist-archives/ {
limit_except GET { deny all; }
auth_basic "SupportAssist archives";
auth_basic_user_file /etc/nginx/supportassist-auth/htpasswd;
alias /var/lib/nginx/supportassist/;
autoindex on;
autoindex_format json;
add_header Cache-Control "private, no-store" always;
add_header X-Content-Type-Options nosniff always;
}
{{- end }}

# Health check endpoint (used by k8s liveness/readiness probes)
location /healthz {
access_log off;
Expand All @@ -151,3 +164,26 @@ data:
deny all;
}
}
{{- if .Values.supportassist.enabled }}

# Only the internal SupportAssist route targets this listener.
server {
listen 8081;
server_name supportassist;

location /supportassist/ {
if ($request_method != PUT) { return 405; }
if ($is_args != "") { return 400; }
if ($content_length = "") { return 411; }

root /var/lib/nginx;
client_body_temp_path /var/lib/nginx/client_temp;
client_max_body_size 2g;
client_body_timeout 300s;
dav_methods PUT;
create_full_put_path on;
}

location / { return 404; }
}
{{- end }}
5 changes: 5 additions & 0 deletions components/understack-cdn/templates/service.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ spec:
- name: http
port: 80
targetPort: 8080
{{- if .Values.supportassist.enabled }}
- name: supportassist
port: 8081
targetPort: supportassist
{{- end }}
type: ClusterIP
13 changes: 13 additions & 0 deletions components/understack-cdn/templates/supportassist-pvc.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.supportassist.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: supportassist
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.supportassist.storageClassName }}
resources:
requests:
storage: {{ .Values.supportassist.storageSize }}
{{- end }}
7 changes: 7 additions & 0 deletions components/understack-cdn/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ cdn:
objectBucketIsLocal: false
# If above is true, how much space to claim for this object bucket:
bucketMaxSize: 40g

supportassist:
enabled: false
storageClassName: openebs-lvm
storageSize: 40Gi
# Requires a Secret named supportassist-download-auth with an htpasswd key,
# used for authenticated archive reads on the HTTPS CDN route.
19 changes: 17 additions & 2 deletions docs/deploy-guide/components/cdn.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,23 @@ site:

Required or commonly required items:

- `values.yaml`: Provide CDN ingress, object-bucket, cache, and runtime settings in `$CLUSTER_NAME/understack-cdn/values.yaml`.
- `values.yaml`: Provide CDN object-bucket and cache settings in `$CLUSTER_NAME/understack-cdn/values.yaml`.

Optional additions:

- `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.
- Enable `supportassist.enabled` to create a dedicated `supportassist` PVC
for HTTP PUT uploads. Set `supportassist.storageSize` (default `40Gi`) and
`supportassist.storageClassName` (default `openebs-lvm`) for the site.
The site must also provide a Secret named `supportassist-download-auth` with
an `htpasswd` key for authenticated archive reads; the pod waits for it.
With SupportAssist enabled, `cdn-edge` upgrades use `Recreate`, so the CDN
is briefly unavailable while the pod restarts.
- Add a site HTTPRoute on the internal gateway for PUT `/supportassist/` to
`understack-cdn/cdn-edge` port `8081`. The firmware listener uses port `80`.
An IP-based URL works for iDRACs without DNS configured.

NGINX WebDAV stores uploaded archives on the PVC. Retrieve completed archives
with `kubectl cp` and monitor available disk space. Operators manage archive
retention and capacity; uploads fail when the volume fills.
See the [CDN README](https://github.com/rackerlabs/understack/blob/main/components/understack-cdn/README.md#supportassist-uploads)
for retrieval commands, timeouts and access behavior.
Loading