Skip to content

feat(helm-chart): add helm-chart - #584

Open
yod527 wants to merge 3 commits into
Unstructured-IO:mainfrom
yod527:feat/helm-chart
Open

feat(helm-chart): add helm-chart#584
yod527 wants to merge 3 commits into
Unstructured-IO:mainfrom
yod527:feat/helm-chart

Conversation

@yod527

@yod527 yod527 commented Aug 6, 2026

Copy link
Copy Markdown

A production-oriented Helm chart for the self-hosted API:

  • Deployment
  • Service
  • HPA
  • PDB
  • Ingress
  • API-key Secret
  • non-root securityContext
  • probes on /healthcheck,
  • well-tested resource defaults

#583

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 issues found across 14 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="charts/unstructured-api/templates/deployment.yaml">

<violation number="1" location="charts/unstructured-api/templates/deployment.yaml:43">
P1: Rolling updates can still kill in-flight requests instead of using the configured 120-second drain period: the image entrypoint does not forward Kubernetes termination signals from the shell to Uvicorn. Updating the entrypoint to `exec` Uvicorn or using a signal-forwarding init would make this grace period effective.</violation>

<violation number="2" location="charts/unstructured-api/templates/deployment.yaml:71">
P2: When `config.allowedOrigins` and `apiKey.enabled` are used together, browser clients cannot use the documented API-key header because the CORS preflight disallows `unstructured-api-key`. Including that header in the application’s CORS allow-list (or making the chart’s CORS configuration cover it) would keep these features compatible.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread charts/unstructured-api/templates/NOTES.txt
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: Rolling updates can still kill in-flight requests instead of using the configured 120-second drain period: the image entrypoint does not forward Kubernetes termination signals from the shell to Uvicorn. Updating the entrypoint to exec Uvicorn or using a signal-forwarding init would make this grace period effective.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At charts/unstructured-api/templates/deployment.yaml, line 43:

<comment>Rolling updates can still kill in-flight requests instead of using the configured 120-second drain period: the image entrypoint does not forward Kubernetes termination signals from the shell to Uvicorn. Updating the entrypoint to `exec` Uvicorn or using a signal-forwarding init would make this grace period effective.</comment>

<file context>
@@ -0,0 +1,160 @@
+      securityContext:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
+      containers:
+        - name: {{ .Chart.Name }}
</file context>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

out of helm chart scope, probably there is a need to consider something like tini on Docker-image level

Comment thread charts/unstructured-api/templates/_helpers.tpl
Comment thread charts/unstructured-api/templates/_helpers.tpl Outdated
{{- end }}
{{- if .Values.config.allowedOrigins }}
- name: ALLOWED_ORIGINS
value: {{ .Values.config.allowedOrigins | quote }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When config.allowedOrigins and apiKey.enabled are used together, browser clients cannot use the documented API-key header because the CORS preflight disallows unstructured-api-key. Including that header in the application’s CORS allow-list (or making the chart’s CORS configuration cover it) would keep these features compatible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At charts/unstructured-api/templates/deployment.yaml, line 71:

<comment>When `config.allowedOrigins` and `apiKey.enabled` are used together, browser clients cannot use the documented API-key header because the CORS preflight disallows `unstructured-api-key`. Including that header in the application’s CORS allow-list (or making the chart’s CORS configuration cover it) would keep these features compatible.</comment>

<file context>
@@ -0,0 +1,160 @@
+            {{- end }}
+            {{- if .Values.config.allowedOrigins }}
+            - name: ALLOWED_ORIGINS
+              value: {{ .Values.config.allowedOrigins | quote }}
+            {{- end }}
+            {{- if .Values.config.maxLifetimeSeconds }}
</file context>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

the cause is prepline_general/api/app.py: allow_headers=["Content-Type"] omits unstructured-api-key, so browser preflight probably rejects it.

Comment thread charts/unstructured-api/.helmignore
Comment thread charts/unstructured-api/templates/tests/test-connection.yaml
Comment thread charts/unstructured-api/values.yaml Outdated
Comment thread charts/unstructured-api/templates/hpa.yaml
Comment thread charts/unstructured-api/templates/deployment.yaml

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 14 files (changes from recent commits).

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread charts/unstructured-api/templates/tests/test-connection.yaml

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 2 unresolved issues from previous reviews.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant