-
Notifications
You must be signed in to change notification settings - Fork 365
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
feat: added helm chart #4065
feat: added helm chart #4065
Changes from all commits
8494dda
a3bcc4a
cc31bb2
5ecad78
984d753
68b39aa
387e480
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,11 @@ | ||
# argilla-helm-chart | ||
|
||
1. Init helm chart | ||
``` | ||
helm create argilla | ||
``` | ||
|
||
2. Deploy the helm chart | ||
``` | ||
helm install argilla-chart argilla/ --values argilla/values.yaml --set enableOptionalResource=false | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: argilla | ||
description: A Helm chart for Argilla Kubernetes | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.16.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: argilla-server-deployment | ||
labels: | ||
app: argilla-server | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: argilla-server | ||
template: | ||
metadata: | ||
labels: | ||
app: argilla-server | ||
spec: | ||
{{- if .Values.enableOptionalResource }} | ||
initContainers: | ||
- name: wait-for-elasticsearch | ||
image: alpine/curl:latest | ||
command: [ "sh", "-c", | ||
"ELASTICSEARCH_URL={{ .Values.argilladeployment.elasticurl }}; status_code=$(curl -s -o /dev/null -w '%{http_code}' $ELASTICSEARCH_URL); | ||
while [ $status_code -ne 200 ]; do sleep 5; status_code=$(curl -s -o /dev/null -w '%{http_code}' $ELASTICSEARCH_URL); | ||
echo Sleeping...; done; echo Elasticsearch Connected " ] | ||
{{- end }} | ||
containers: | ||
- name: argilla-server | ||
image: argilla/argilla-server:latest | ||
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. Suggestion: swap 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. |
||
env: | ||
- name: {{ .Values.argilladeployment.name }} | ||
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. This env name is required by Argilla and wouln't change between deployments. Leaving it as 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. |
||
value: "http://elasticsearch:9200" | ||
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. This should also be 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. |
||
ports: | ||
- containerPort: 6900 | ||
resources: | ||
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. Suggestions: resources often vary among deployments, and so making these into 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. https://github.com/bikash119/argilla/blob/70059f21bfd977ee726978ba74f44a4d3d026767/examples/deployments/k8s/argilla-chart/templates/deployment.yaml#L61-L62 |
||
requests: | ||
cpu: "0.5" | ||
limits: | ||
cpu: "1" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: autoscaling/v2 | ||
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. Suggestion: wrap HPAs in something like 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. |
||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: argilla-server-hpa | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: argilla-server-deployment | ||
minReplicas: {{ .Values.replicas.min }} | ||
maxReplicas: {{ .Values.replicas.max }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 50 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: argilla-server-ingress | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: argilla-server | ||
port: | ||
number: 6900 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: argilla-server | ||
labels: | ||
app: argilla-server | ||
spec: | ||
selector: | ||
app: argilla-server | ||
ports: | ||
- name: http | ||
port: 6900 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{{- if .Values.enableOptionalResource }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: elasticsearch | ||
labels: | ||
app: elasticsearch | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: elasticsearch | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: elasticsearch | ||
spec: | ||
containers: | ||
- name: elasticsearch | ||
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 | ||
resources: | ||
requests: | ||
cpu: 0.25 | ||
memory: 1Gi | ||
limits: | ||
cpu: 1 | ||
memory: 2Gi | ||
ports: | ||
- containerPort: 9200 | ||
env: | ||
- name: discovery.type | ||
value: single-node | ||
- name: ES_JAVA_OPTS | ||
value: -Xms256m -Xmx256m | ||
- name: cluster.routing.allocation.disk.threshold_enabled | ||
value: "false" | ||
- name: xpack.security.enabled | ||
value: "false" | ||
volumeMounts: | ||
- mountPath: /usr/share/elasticsearch/data | ||
name: elasticsearch-data | ||
volumes: | ||
- name: elasticsearch-data | ||
persistentVolumeClaim: | ||
claimName: elasticsearch-pvc | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: elasticsearch-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 2Gi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: elasticsearch | ||
labels: | ||
app: elasticsearch | ||
spec: | ||
selector: | ||
app: elasticsearch | ||
ports: | ||
- name: http | ||
port: 9200 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
argilladeployment: | ||
elasticurl: http://elasticsearch:9200 | ||
name: ARGILLA_ELASTICSEARCH | ||
|
||
replicas: | ||
min: 1 | ||
max: 3 | ||
|
||
enableOptionalResource: true |
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.
Suggestion: I would consider adding a PVC for the Argilla deployment so that workspaces/users persist beyond restarts/redeployments and mount it to ARGILLA_HOME_PATH.
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.
https://github.com/bikash119/argilla/blob/70059f21bfd977ee726978ba74f44a4d3d026767/examples/deployments/k8s/argilla-chart/templates/deployment.yaml#L23-L28
https://github.com/bikash119/argilla/blob/70059f21bfd977ee726978ba74f44a4d3d026767/examples/deployments/k8s/argilla-chart/templates/deployment.yaml#L56-L59
https://github.com/bikash119/argilla/blob/70059f21bfd977ee726978ba74f44a4d3d026767/examples/deployments/k8s/argilla-chart/values.yaml#L15-L20