From 17759815867762ad57c431d05ae9bcb5bd2bfc55 Mon Sep 17 00:00:00 2001 From: haseeb Date: Tue, 24 Nov 2026 05:09:22 +0530 Subject: [PATCH] Add SupportAssist uploads and authenticated archive access --- .../templates/application-cdn.yaml | 1 + components/understack-cdn/README.md | 67 +++++++++++++++++++ .../templates/deployment.yaml.tpl | 35 ++++++++-- .../templates/nginx-config.yaml.tpl | 36 ++++++++++ .../understack-cdn/templates/service.yaml.tpl | 5 ++ .../templates/supportassist-pvc.yaml.tpl | 13 ++++ components/understack-cdn/values.yaml | 7 ++ docs/deploy-guide/components/cdn.md | 19 +++++- 8 files changed, 177 insertions(+), 6 deletions(-) create mode 100644 components/understack-cdn/templates/supportassist-pvc.yaml.tpl diff --git a/charts/argocd-understack/templates/application-cdn.yaml b/charts/argocd-understack/templates/application-cdn.yaml index d9974f493..fb5d64ed0 100644 --- a/charts/argocd-understack/templates/application-cdn.yaml +++ b/charts/argocd-understack/templates/application-cdn.yaml @@ -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: diff --git a/components/understack-cdn/README.md b/components/understack-cdn/README.md index b34f7771a..073bef883 100644 --- a/components/understack-cdn/README.md +++ b/components/understack-cdn/README.md @@ -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 -c nginx -- ls -lh /var/lib/nginx/supportassist +kubectl -n understack-cdn cp :/var/lib/nginx/supportassist/.zip ./.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 -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. diff --git a/components/understack-cdn/templates/deployment.yaml.tpl b/components/understack-cdn/templates/deployment.yaml.tpl index bc62ce960..31bde8c88 100644 --- a/components/understack-cdn/templates/deployment.yaml.tpl +++ b/components/understack-cdn/templates/deployment.yaml.tpl @@ -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 template: metadata: labels: @@ -27,6 +27,14 @@ 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 @@ -34,6 +42,10 @@ spec: ports: - containerPort: 8080 name: http +{{- if .Values.supportassist.enabled }} + - containerPort: 8081 + name: supportassist +{{- end }} resources: requests: @@ -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: @@ -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 diff --git a/components/understack-cdn/templates/nginx-config.yaml.tpl b/components/understack-cdn/templates/nginx-config.yaml.tpl index 16fc244ee..a26b1afd5 100644 --- a/components/understack-cdn/templates/nginx-config.yaml.tpl +++ b/components/understack-cdn/templates/nginx-config.yaml.tpl @@ -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; @@ -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 }} diff --git a/components/understack-cdn/templates/service.yaml.tpl b/components/understack-cdn/templates/service.yaml.tpl index 8d221d050..97971c9e1 100644 --- a/components/understack-cdn/templates/service.yaml.tpl +++ b/components/understack-cdn/templates/service.yaml.tpl @@ -9,4 +9,9 @@ spec: - name: http port: 80 targetPort: 8080 +{{- if .Values.supportassist.enabled }} + - name: supportassist + port: 8081 + targetPort: supportassist +{{- end }} type: ClusterIP diff --git a/components/understack-cdn/templates/supportassist-pvc.yaml.tpl b/components/understack-cdn/templates/supportassist-pvc.yaml.tpl new file mode 100644 index 000000000..13214f08b --- /dev/null +++ b/components/understack-cdn/templates/supportassist-pvc.yaml.tpl @@ -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 }} diff --git a/components/understack-cdn/values.yaml b/components/understack-cdn/values.yaml index 04d5409ec..9cca8d5df 100644 --- a/components/understack-cdn/values.yaml +++ b/components/understack-cdn/values.yaml @@ -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. diff --git a/docs/deploy-guide/components/cdn.md b/docs/deploy-guide/components/cdn.md index e32a56584..fd4668843 100644 --- a/docs/deploy-guide/components/cdn.md +++ b/docs/deploy-guide/components/cdn.md @@ -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.