Skip to content

Conversation

@amartin0
Copy link

@amartin0 amartin0 commented Nov 12, 2025

Description

Add helm to deploy helixdb on kubernetes

Related Issues

677

Closes #

Checklist when merging to main

  • No compiler warnings (if applicable)
  • Code is formatted with rustfmt
  • No useless or dead code (if applicable)
  • Code is easy to understand
  • Doc comments are used for all functions, enums, structs, and fields (where appropriate)
  • All tests pass
  • Performance has not regressed (assuming change was not to fix a bug)
  • Version number has been updated in helix-cli/Cargo.toml and helixdb/Cargo.toml

Additional Notes

  • These files are not Rust programs — they are YAML files used for deploying in Kubernetes.
  • The Helm chart has been tested on OpenShift and standard Kubernetes.
  • It is designed to deploy a ClusterIP service, which is then exposed through the cluster’s Ingress.
  • Only one replica is deployed per deployment to prevent simultaneous data writes by multiple processes.
  • The PVC can only be mounted by a single pod.

Greptile Summary

  • Adds complete Helm chart infrastructure for deploying HelixDB on Kubernetes with OpenShift compatibility
  • Implements single-replica deployment strategy with ReadWriteOncePod PVC to prevent concurrent writes
  • Includes health probes using /introspect endpoint and configurable resource limits

Important Files Changed

Filename Overview
k8s/helm/values.yaml Configuration values with populated defaults for image (example.com/helixdb:2.1.2), 10Gi storage, and enabled health probes - all previous syntax issues resolved.
k8s/helm/templates/deployment.yaml Deployment template with single replica, health probes to /introspect endpoint, volume mount to /data from PVC, and proper resource templating using nindent.
k8s/helm/templates/pvc.yaml PVC template using ReadWriteOncePod access mode with configurable storage size and optional storage class, properly commented with version requirements.

Sequence Diagram

sequenceDiagram
    participant User as "User/DevOps"
    participant Helm as "Helm CLI"
    participant K8s as "Kubernetes API"
    participant PVC as "PersistentVolumeClaim"
    participant Deploy as "Deployment"
    participant Pod as "HelixDB Pod"
    participant Service as "ClusterIP Service"
    
    User->>Helm: "helm install helixdb ./helm"
    Helm->>K8s: "Apply Chart.yaml metadata"
    Helm->>K8s: "Create namespace (if needed)"
    Helm->>K8s: "Create PVC (helixdb-data)"
    K8s->>PVC: "Provision storage with ReadWriteOncePod"
    PVC-->>K8s: "Storage ready"
    Helm->>K8s: "Create Service (helixdb-service)"
    K8s->>Service: "Expose port 6969 (ClusterIP)"
    Helm->>K8s: "Create Deployment (1 replica)"
    K8s->>Deploy: "Start deployment"
    Deploy->>Pod: "Create pod with helix-container image"
    Pod->>PVC: "Mount /data volume"
    Pod->>Pod: "Run helix-container as UID 1001"
    Pod->>Pod: "Initialize HELIX_DATA_DIR=/data"
    Pod-->>Deploy: "Pod running"
    Deploy-->>Service: "Register pod endpoint"
    Service-->>User: "helixdb-service:6969 ready"
Loading

@amartin0
Copy link
Author

Hi,

I’ve just created the pull request. Please don’t hesitate to let me know if you notice anything that doesn’t look right so I can fix it.

Regards.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 6 to 7
repository: ""
tag: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: required fields repository and tag are empty - deployment will fail without these values

Suggested change
repository: ""
tag: ""
repository: "your-registry/helixdb"
tag: "2.1.2"
Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/values.yaml
Line: 6:7

Comment:
**syntax:** required fields `repository` and `tag` are empty - deployment will fail without these values

```suggestion
  repository: "your-registry/helixdb" 
  tag: "2.1.2"
```

How can I resolve this? If you propose a fix, please make it concise.

# Optional storage class (default = cluster default)
storageClassName: ""
# Requested storage size
size: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: required field size is empty - PVC creation will fail without a storage size

Suggested change
size: ""
size: "10Gi"
Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/values.yaml
Line: 20:20

Comment:
**syntax:** required field `size` is empty - PVC creation will fail without a storage size

```suggestion
  size: "10Gi"
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +18 to +24
securityContext: {}
containers:
- name: helixdb
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/helix-container"]
securityContext: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: no health checks configured - Kubernetes won't know if the container is ready to accept traffic or needs to be restarted

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/templates/deployment.yaml
Line: 18:24

Comment:
**style:** no health checks configured - Kubernetes won't know if the container is ready to accept traffic or needs to be restarted

How can I resolve this? If you propose a fix, please make it concise.

k8s/README.md Outdated

## Docker Image

The container image runs the the `helix-container` binary which was compiled with the helix push tool previously.
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: typo: repeated "the"

Suggested change
The container image runs the the `helix-container` binary which was compiled with the helix push tool previously.
The container image runs the `helix-container` binary which was compiled with the helix push tool previously.
Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/README.md
Line: 11:11

Comment:
**syntax:** typo: repeated "the"

```suggestion
The container image runs the `helix-container` binary which was compiled with the helix push tool previously.
```

How can I resolve this? If you propose a fix, please make it concise.

k8s/README.md Outdated
Comment on lines 13 to 15
## Build and Push

The Helm chart is located in the helm/ directory and provides a configurable Kubernetes deployment, service, and persistent volume claim.
Copy link
Contributor

Choose a reason for hiding this comment

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

style: "Build and Push" section header has no content - either add content or remove the header

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/README.md
Line: 13:15

Comment:
**style:** "Build and Push" section header has no content - either add content or remove the header

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 30 to 51
{{- with .Values.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

syntax: incorrect indentation for resources block - should be 12 spaces but toYaml outputs at wrong level

Suggested change
{{- with .Values.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{ toYaml . | indent 12 }}
{{- end }}
Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/templates/deployment.yaml
Line: 30:33

Comment:
**syntax:** incorrect indentation for resources block - should be 12 spaces but `toYaml` outputs at wrong level

```suggestion
{{- with .Values.resources }}
          resources:
{{ toYaml . | indent 12 }}
{{- end }}
```

How can I resolve this? If you propose a fix, please make it concise.

@xav-db xav-db changed the base branch from main to dev November 12, 2025 22:25
@xav-db
Copy link
Member

xav-db commented Nov 12, 2025

@amartin0 thoughts on greptile recommendations?

@amartin0 amartin0 marked this pull request as draft November 13, 2025 04:50
@amartin0
Copy link
Author

Hi @xav-db ,

I’ve turned the PR into a draft for now. I’ll work on the greptile-apps comments over the weekend and re-activate it once it’s ready for your review.

Thanks!!

@amartin0 amartin0 marked this pull request as ready for review November 17, 2025 21:13
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

metadata:
name: helixdb-service
namespace: {{ .Values.namespace }}
spec:
Copy link
Contributor

Choose a reason for hiding this comment

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

style: missing explicit type: ClusterIP - while ClusterIP is the default, explicitly specifying it improves clarity and prevents confusion

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/templates/service.yaml
Line: 6:6

Comment:
**style:** missing explicit `type: ClusterIP` - while ClusterIP is the default, explicitly specifying it improves clarity and prevents confusion

How can I resolve this? If you propose a fix, please make it concise.


## Deploying to Kubernetes

helm install helixdb ./helm -n your-namespace --create-namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

style: missing code formatting for command - should be wrapped in code block for better readability

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/README.md
Line: 30:30

Comment:
**style:** missing code formatting for command - should be wrapped in code block for better readability

How can I resolve this? If you propose a fix, please make it concise.


image:
# Image repository and tag
repository: "your-registry/helixdb"
Copy link
Contributor

Choose a reason for hiding this comment

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

style: placeholder value your-registry/helixdb should be replaced with actual registry path before deployment

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/values.yaml
Line: 6:6

Comment:
**style:** placeholder value `your-registry/helixdb` should be replaced with actual registry path before deployment

How can I resolve this? If you propose a fix, please make it concise.

spec:
# Force ReadWriteOncePod mode
accessModes:
- ReadWriteOncePod
Copy link
Contributor

Choose a reason for hiding this comment

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

style: ReadWriteOncePod access mode requires Kubernetes 1.22+ - verify cluster version supports this feature

Prompt To Fix With AI
This is a comment left during a code review.
Path: k8s/helm/templates/pvc.yaml
Line: 9:9

Comment:
**style:** `ReadWriteOncePod` access mode requires Kubernetes 1.22+ - verify cluster version supports this feature

How can I resolve this? If you propose a fix, please make it concise.

@amartin0 amartin0 marked this pull request as draft November 17, 2025 21:16
@amartin0 amartin0 marked this pull request as ready for review November 17, 2025 21:55
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@amartin0
Copy link
Author

Hi @xav-db

The code has now passed the greptile-apps tests.

Please note that I consider the data can be written by a single process, which is why I am enforcing the ReadWriteOncePod access mode on the PVC.

Anything you consider needs to be modified, improved, or documented, please don’t hesitate to ask me.

Thanks.

@xav-db
Copy link
Member

xav-db commented Nov 19, 2025

this looks good to me. I will give it a proper review in the next day or so. @matthewsanetra probably a good idea to review this too!

@xav-db
Copy link
Member

xav-db commented Nov 23, 2025

im going to make this a draft as im unsure about having k8s deployments in main binary repo

@xav-db xav-db marked this pull request as draft November 23, 2025 03:22
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.

2 participants