-
Notifications
You must be signed in to change notification settings - Fork 88
feat(helm): Add API server deployment. #1818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7636aee
62bd3ef
e5088bf
b31f5f7
6484c22
7b80cfd
8fd3c51
8d0a9af
9e2639e
88f6097
26b5055
a9a342b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| {{- if .Values.clpConfig.api_server }} | ||
| apiVersion: "apps/v1" | ||
| kind: "Deployment" | ||
| metadata: | ||
| name: {{ include "clp.fullname" . }}-api-server | ||
| labels: | ||
| {{- include "clp.labels" . | nindent 4 }} | ||
| app.kubernetes.io/component: "api-server" | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| {{- include "clp.selectorLabels" . | nindent 6 }} | ||
| app.kubernetes.io/component: "api-server" | ||
| template: | ||
| metadata: | ||
| labels: | ||
| {{- include "clp.labels" . | nindent 8 }} | ||
| app.kubernetes.io/component: "api-server" | ||
| spec: | ||
| serviceAccountName: {{ include "clp.fullname" . }}-job-watcher | ||
| terminationGracePeriodSeconds: 60 | ||
| securityContext: | ||
| runAsUser: {{ .Values.securityContext.firstParty.uid }} | ||
| runAsGroup: {{ .Values.securityContext.firstParty.gid }} | ||
| fsGroup: {{ .Values.securityContext.firstParty.gid }} | ||
| initContainers: | ||
| - {{- include "clp.waitFor" (dict | ||
| "root" . | ||
| "type" "job" | ||
| "name" "db-table-creator" | ||
| ) | nindent 10 }} | ||
| - {{- include "clp.waitFor" (dict | ||
| "root" . | ||
| "type" "job" | ||
| "name" "results-cache-indices-creator" | ||
| ) | nindent 10 }} | ||
| containers: | ||
| - name: "api-server" | ||
| image: "{{ include "clp.image.ref" . }}" | ||
| imagePullPolicy: "{{ .Values.image.clpPackage.pullPolicy }}" | ||
| env: | ||
| - name: "CLP_DB_PASS" | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ include "clp.fullname" . }}-database | ||
| key: "password" | ||
| - name: "CLP_DB_USER" | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ include "clp.fullname" . }}-database | ||
| key: "username" | ||
| - name: "CLP_LOGS_DIR" | ||
| value: "/var/log/api_server" | ||
| - name: "RUST_LOG" | ||
| value: "INFO" | ||
| ports: | ||
| - name: "api-server" | ||
| containerPort: 3001 | ||
|
Comment on lines
+38
to
+59
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Resource limits and requests remain unaddressed. The past review comment about adding resource requests and limits is still valid. Without these, the scheduler cannot make optimal placement decisions, and the pod could consume excessive cluster resources. Consider exposing resource configuration in 🧰 Tools🪛 YAMLlint (1.37.1)[error] 46-46: too many spaces inside braces (braces) [error] 46-46: too many spaces inside braces (braces) [error] 51-51: too many spaces inside braces (braces) [error] 51-51: too many spaces inside braces (braces) 🤖 Prompt for AI Agents |
||
| volumeMounts: | ||
| - name: {{ include "clp.volumeName" (dict | ||
| "component_category" "api-server" | ||
| "name" "logs" | ||
| ) | quote }} | ||
| mountPath: "/var/log/api_server" | ||
| - name: "config" | ||
| mountPath: "/etc/clp-config.yaml" | ||
| subPath: "clp-config.yaml" | ||
| readOnly: true | ||
| - name: {{ include "clp.volumeName" (dict | ||
| "component_category" "shared-data" | ||
| "name" "streams" | ||
| ) | quote }} | ||
| mountPath: "/var/data/streams" | ||
|
Comment on lines
+60
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking about this again: this volume mount probably won't work on a true cluster (not minikube/kind) right? They need to be PVs on a nfs? And even if the user specifies s3 in archive output, the pod would probably fail to start because this mount is unconditional?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good points. those are valid concerns and we do plan to address them:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xD It's probably almost impossible to configure seaweedfs on every node in a serious use case, but we could always ask them to use s3
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The concerns of the ability to deploy on a multi-node cluster are fairly valid. Some changes will be made in #1829 to address such concerns |
||
| command: [ | ||
| "/opt/clp/bin/api_server", | ||
| "--host", "0.0.0.0", | ||
| "--port", "3001", | ||
| "--config", "/etc/clp-config.yaml" | ||
| ] | ||
| readinessProbe: | ||
| {{- include "clp.readinessProbeTimings" . | nindent 12 }} | ||
| httpGet: &api-server-health-check | ||
| path: "/health" | ||
| port: "api-server" | ||
| livenessProbe: | ||
| {{- include "clp.livenessProbeTimings" . | nindent 12 }} | ||
| httpGet: *api-server-health-check | ||
| volumes: | ||
| - {{- include "clp.pvcVolume" (dict | ||
| "root" . | ||
| "component_category" "api-server" | ||
| "name" "logs" | ||
| ) | nindent 10 }} | ||
|
Comment on lines
+90
to
+94
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency with other helm files, can we move this below the config mount?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i suppose you mean listing the (non-templated) config mount as the last item, for consistency with other Helm files, and i made the change accordingly |
||
| - {{- include "clp.pvcVolume" (dict | ||
| "root" . | ||
| "component_category" "shared-data" | ||
| "name" "streams" | ||
| ) | nindent 10 }} | ||
| - name: "config" | ||
| configMap: | ||
| name: {{ include "clp.fullname" . }}-config | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {{- if .Values.clpConfig.api_server }} | ||
| {{- include "clp.createLocalPv" (dict | ||
| "root" . | ||
| "component_category" "api-server" | ||
| "name" "logs" | ||
| "nodeRole" "control-plane" | ||
| "capacity" "5Gi" | ||
| "accessModes" (list "ReadWriteOnce") | ||
| "hostPath" (printf "%s/api_server" .Values.clpConfig.logs_directory) | ||
| ) }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {{- if .Values.clpConfig.api_server }} | ||
| {{- include "clp.createPvc" (dict | ||
| "root" . | ||
| "component_category" "api-server" | ||
| "name" "logs" | ||
| "capacity" "5Gi" | ||
| "accessModes" (list "ReadWriteOnce") | ||
| ) }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {{- if .Values.clpConfig.api_server }} | ||
| apiVersion: "v1" | ||
| kind: "Service" | ||
| metadata: | ||
| name: {{ include "clp.fullname" . }}-api-server | ||
| labels: | ||
| {{- include "clp.labels" . | nindent 4 }} | ||
| app.kubernetes.io/component: "api-server" | ||
| spec: | ||
| type: "NodePort" | ||
| selector: | ||
| {{- include "clp.selectorLabels" . | nindent 4 }} | ||
| app.kubernetes.io/component: "api-server" | ||
| ports: | ||
| - port: 3001 | ||
| targetPort: "api-server" | ||
| nodePort: {{ .Values.clpConfig.api_server.port }} | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider making RUST_LOG configurable.
The
RUST_LOGenvironment variable is hardcoded to"INFO". For debugging or troubleshooting, operators may need to adjust the log level without modifying the chart.🔎 Suggested enhancement
In
values.yaml, add:Then update the template:
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 46-46: too many spaces inside braces
(braces)
[error] 46-46: too many spaces inside braces
(braces)
[error] 51-51: too many spaces inside braces
(braces)
[error] 51-51: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents