Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 2 additions & 6 deletions helm/templates/deployment-cache-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@ spec:
periodSeconds: {{ .Values.cacheserverSpec.livenessProbe.periodSeconds | default 10 }}
failureThreshold: {{ .Values.cacheserverSpec.livenessProbe.failureThreshold | default 3 }}
timeoutSeconds: {{ .Values.cacheserverSpec.livenessProbe.timeoutSeconds | default 5 }}
exec:
command:
- "/opt/venv/bin/python3"
- "/workspace/LMCache/examples/kubernetes/health_probe.py"
- "127.0.0.1"
- "{{ .Values.cacheserverSpec.containerPort }}"
tcpSocket:
port: {{ .Values.cacheserverSpec.containerPort }}

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.

medium

Using a named port (e.g., caserver-cport) instead of referencing the port number directly in the tcpSocket probe is a Kubernetes best practice. This decouples the probe configuration from the specific port number, making the chart more maintainable and robust if the port number changes in the future.

            tcpSocket:
              port: caserver-cport

{{- end }}
{{- with .Values.cacheserverSpec.containerSecurityContext }}
securityContext:
Expand Down
8 changes: 2 additions & 6 deletions helm/tests/cacheserver_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,8 @@ tests:
periodSeconds: 20
failureThreshold: 6
timeoutSeconds: 10
exec:
command:
- "/opt/venv/bin/python3"
- "/workspace/LMCache/examples/kubernetes/health_probe.py"
- "127.0.0.1"
- "8000"
tcpSocket:
port: 8000

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.

medium

Update the test assertion to expect the named port caserver-cport instead of the hardcoded port number 8000 to align with the template change.

          tcpSocket:
            port: caserver-cport

- equal:
path: spec.template.spec.containers[0].securityContext
value:
Expand Down