diff --git a/ragstack/deploy/kubernetes/helm/langflow/.helmignore b/ragstack/deploy/kubernetes/helm/langflow/.helmignore new file mode 100644 index 000000000000..0e8a0eb36f4c --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ragstack/deploy/kubernetes/helm/langflow/Chart.yaml b/ragstack/deploy/kubernetes/helm/langflow/Chart.yaml new file mode 100644 index 000000000000..be932c64a5ee --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/Chart.yaml @@ -0,0 +1,29 @@ +apiVersion: v2 +name: langflow +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.16.0 + +dependencies: + - name: postgresql + version: 12.1.0 + repository: https://charts.bitnami.com/bitnami + condition: postgresql.enabled diff --git a/ragstack/deploy/kubernetes/helm/langflow/README.md b/ragstack/deploy/kubernetes/helm/langflow/README.md new file mode 100644 index 000000000000..dcb62e25bc3b --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/README.md @@ -0,0 +1,19 @@ +# helm chart + +This is the helm chart for RAGStack LangFlow. Postgres is a dependent chart but optional. + +## how to install + +``` +cd ragstack/deploy/kubernetes/helm + +helm dependency update ./langflow + +kubectl create namespace langflow + +helm install --dry-run langflow ./langflow --values ./langflow/values.yaml + +helm install --namespace langflow --debug langflow ./langflow --values ./langflow/values.yaml + +helm upgrade langflow ./langflow --values ./langflow/values.yaml --namespace langflow --debug +``` diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/NOTES.txt b/ragstack/deploy/kubernetes/helm/langflow/templates/NOTES.txt new file mode 100644 index 000000000000..2087c008ab73 --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "langflow.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "langflow.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "langflow.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "langflow.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/_helpers.tpl b/ragstack/deploy/kubernetes/helm/langflow/templates/_helpers.tpl new file mode 100644 index 000000000000..fd3b228820f3 --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "langflow.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "langflow.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "langflow.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "langflow.labels" -}} +helm.sh/chart: {{ include "langflow.chart" . }} +{{ include "langflow.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "langflow.selectorLabels" -}} +app.kubernetes.io/name: {{ include "langflow.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "langflow.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "langflow.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/backend-statefulset.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/backend-statefulset.yaml new file mode 100644 index 000000000000..932e6f69ba2a --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/backend-statefulset.yaml @@ -0,0 +1,134 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "langflow.fullname" . }} + labels: + {{- include "langflow.labels" . | nindent 4 }} +spec: + serviceName: "{{ include "langflow.fullname" . }}-service" + replicas: {{ .Values.langflow.replicaCount }} + selector: + matchLabels: + {{- include "langflow.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.langflow.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "langflow.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "langflow.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.langflow.podSecurityContext | nindent 8 }} + volumes: + {{- if .Values.enableTls }} + - name: certs + secret: + secretName: "{{ .Values.tlsSecretName }}" + {{- end }} + {{- if .Values.secretProvider.enabled }} + - name: secrets-store-inline + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: "{{- .Values.secretProvider.name }}" + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.langflow.securityContext | nindent 12 }} + image: "{{ .Values.langflow.image.repository }}:{{ .Values.langflow.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.langflow.image.pullPolicy }} + {{- if .Values.langflow.command }} + command: + {{- toYaml .Values.langflow.command | nindent 12 }} + {{- end }} + {{- if .Values.langflow.args }} + args: + {{- toYaml .Values.langflow.args | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.langflow.backend.port | default 7860 }} + protocol: TCP + volumeMounts: + {{- if .Values.enableTls }} + - name: certs + readOnly: true + mountPath: /certs + {{- end }} + {{- if .Values.secretProvider.enabled }} + - name: secrets-store-inline + mountPath: "/mnt/secrets" + readOnly: true + {{- end }} + {{- if eq .Values.langflow.database.type "sqlite" }} + - name: data + mountPath: /data + {{- end }} + livenessProbe: + httpGet: + path: /health + port: {{ .Values.langflow.backend.port | default 7860 }} + initialDelaySeconds: {{ .Values.langflow.backend.initialDelaySeconds | default 60 }} + periodSeconds: {{ .Values.langflow.backend.periodSeconds | default 15 }} + timeoutSeconds: {{ .Values.langflow.backend.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.langflow.backend.failureThreshold | default 2 }} + readinessProbe: + httpGet: + path: /health + port: {{ .Values.langflow.backend.port | default 7860 }} + initialDelaySeconds: {{ .Values.langflow.backend.initialDelaySeconds | default 45 }} + periodSeconds: {{ .Values.langflow.backend.periodSeconds | default 15 }} + timeoutSeconds: {{ .Values.langflow.backend.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.langflow.backend.failureThreshold | default 2 }} + env: + - name: ENVIRONMENT + value: "{{ .Values.environment | default "dev" }}" + - name: DOMAIN + value: "{{ .Values.domain | default "localhost" }}" + {{- if and .Values.langflow.database .Values.langflow.database.secretsEnabled }} + - name: LANGFLOW_DATABASE_URL + valueFrom: + secretKeyRef: + name: db-sql-url + key: db-sql-url.txt + {{- else if and .Values.langflow.database .Values.langflow.database.url }} + value: "{{ .Values.langflow.database.url }}" + {{- end }} + - name: LANGFLOW_HOST + value: "{{ .Values.langflow.host | default "0.0.0.0" }}" + - name: LANGFLOW_BACKEND_ONLY + value: "{{ .Values.langflow.backend.backendOnly | default false }}" + resources: + {{- toYaml .Values.langflow.resources | nindent 12 }} + {{- with .Values.langflow.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.langflow.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.langflow.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if eq .Values.langflow.database.type "sqlite" }} + volumeClaimTemplates: + - metadata: + name: data + spec: + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: {{ .Values.langflow.database.size }} + storageClassName: "langflow-sqlite" + {{- end }} \ No newline at end of file diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/db-storageclass.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/db-storageclass.yaml new file mode 100644 index 000000000000..ddf2ed59e4aa --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/db-storageclass.yaml @@ -0,0 +1,42 @@ +{{- if .Values.langflow.database.type }} +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: "{{ template "langflow.fullname" . }}-{{ .Values.langflow.database.type }}" + namespace: {{ .Release.Namespace }} + labels: + app: {{ template "langflow.name" . }} + chart: {{ template "langflow.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: {{ .Values.langflow.database.type }} + cluster: {{ template "langflow.fullname" . }} +allowVolumeExpansion: true +reclaimPolicy: Retain +volumeBindingMode: WaitForFirstConsumer +{{- if .Values.langflow.database.volumes.storageClass }} +provisioner: {{ .Values.langflow.database.volumes.storageClass.provisioner }} +parameters: + {{- if .Values.langflow.database.volumes.storageClass.type }} + type: {{ .Values.langflow.database.volumes.storageClass.type }} + {{- end }} + {{- if .Values.langflow.database.volumes.storageClass.fsType }} + fsType: {{ .Values.langflow.database.volumes.storageClass.fsType }} + {{- end }} + {{- if .Values.langflow.database.volumes.storageClass.extraParams }} +{{ toYaml .Values.langflow.database.volumes.storageClass.extraParams | indent 2 }} + {{- end }} +{{- else if .Values.default_storage }} +provisioner: {{ .Values.default_storage.provisioner }} +parameters: + {{- if .Values.default_storage.type }} + type: {{ .Values.default_storage.type }} + {{- end }} + {{- if .Values.default_storage.fsType }} + fsType: {{ .Values.default_storage.fsType }} + {{- end }} + {{- if .Values.default_storage.extraParams }} +{{ toYaml .Values.default_storage.extraParams | indent 2 }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/frontend-deployment.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/frontend-deployment.yaml new file mode 100644 index 000000000000..4decc3fe508c --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/frontend-deployment.yaml @@ -0,0 +1,107 @@ +{{- if .Values.langflow.frontend.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "langflow.fullname" . }}-frontend + labels: + {{- include "langflow.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.langflow.frontend.replicaCount }} + selector: + matchLabels: + {{- include "langflow.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.langflow.frontend.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "langflow.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "langflow.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.langflow.podSecurityContext | nindent 8 }} + volumes: + {{- if .Values.enableTls }} + - name: certs + secret: + secretName: "{{ .Values.tlsSecretName }}" + {{- end }} + {{- if .Values.secretProvider.enabled }} + - name: secrets-store-inline + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: "{{- .Values.secretProvider.name }}" + {{- end }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.langflow.securityContext | nindent 12 }} + image: "{{ .Values.langflow.frontend.image.repository }}:{{ .Values.langflow.frontend.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.langflow.frontend.image.pullPolicy }} + {{- if .Values.langflow.frontend.command }} + command: + {{- toYaml .Values.langflow.frontend.command | nindent 12 }} + {{- end }} + {{- if .Values.langflow.frontend.args }} + args: + {{- toYaml .Values.langflow.frontend.args | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.langflow.frontend.port | default 8080 }} + protocol: TCP + volumeMounts: + {{- if .Values.enableTls }} + - name: certs + readOnly: true + mountPath: /certs + {{- end }} + {{- if .Values.secretProvider.enabled }} + - name: secrets-store-inline + mountPath: "/mnt/secrets" + readOnly: true + {{- end }} + livenessProbe: + httpGet: + path: /index + port: {{ .Values.langflow.frontend.port | default 8080 }} + initialDelaySeconds: {{ .Values.langflow.frontend.initialDelaySeconds | default 60 }} + periodSeconds: {{ .Values.langflow.frontend.periodSeconds | default 15 }} + timeoutSeconds: {{ .Values.langflow.frontend.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.langflow.frontend.failureThreshold | default 2 }} + readinessProbe: + httpGet: + path: /index + port: {{ .Values.langflow.frontend.port | default 8080 }} + initialDelaySeconds: {{ .Values.langflow.frontend.initialDelaySeconds | default 45 }} + periodSeconds: {{ .Values.langflow.frontend.periodSeconds | default 15 }} + timeoutSeconds: {{ .Values.langflow.frontend.timeoutSeconds | default 5 }} + failureThreshold: {{ .Values.langflow.frontend.failureThreshold | default 2 }} + env: + - name: ENVIRONMENT + value: "{{ .Values.environment | default "dev" }}" + - name: BACKEND_URL + value: "http://{{ template "langflow.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.langflow.backend.port | default 7860 }}" + resources: + {{- toYaml .Values.langflow.frontend.resources | nindent 12 }} + {{- with .Values.langflow.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.langflow.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.langflow.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/hpa.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/hpa.yaml new file mode 100644 index 000000000000..56d23cc8af67 --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "langflow.fullname" . }} + labels: + {{- include "langflow.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "langflow.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/ingress.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/ingress.yaml new file mode 100644 index 000000000000..a09a5c04fc56 --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "langflow.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "langflow.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/service.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/service.yaml new file mode 100644 index 000000000000..ddc6fe82519a --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "langflow.fullname" . }} + labels: + {{- include "langflow.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "langflow.selectorLabels" . | nindent 4 }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/serviceaccount.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/serviceaccount.yaml new file mode 100644 index 000000000000..e45c47f5991e --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "langflow.serviceAccountName" . }} + labels: + {{- include "langflow.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/ragstack/deploy/kubernetes/helm/langflow/templates/tests/test-connection.yaml b/ragstack/deploy/kubernetes/helm/langflow/templates/tests/test-connection.yaml new file mode 100644 index 000000000000..e574fee42d4a --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "langflow.fullname" . }}-test-connection" + labels: + {{- include "langflow.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "langflow.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/ragstack/deploy/kubernetes/helm/langflow/values.yaml b/ragstack/deploy/kubernetes/helm/langflow/values.yaml new file mode 100644 index 000000000000..fd7ca8432da6 --- /dev/null +++ b/ragstack/deploy/kubernetes/helm/langflow/values.yaml @@ -0,0 +1,142 @@ +# Default values for langflow. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +postgresql: + enabled: false + +environment: "dev" +enableTls: false + +autoscaling: + enabled: false + +imagePullSecrets: [] +nameOverride: "langflow" +fullnameOverride: "langflow" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 7860 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +# Define the storage class for GCP storage +# default_storage: +# provisioner: "kubernetes.io/gce-pd" +# type: "pd-standard" +# fsType: "ext4" +# extraParams: {} +# Define the storage class for AWS storage +default_storage: + provisioner: "kubernetes.io/aws-ebs" + type: "gp2" + fsType: "ext4" + +backendSts: + enabled: false + +langflow: + replicaCount: 1 + command: + - langflow + args: + - run + - --host + - 0.0.0.0 + - --backend-only + - --log-level + - info + - --workers + - "1" + - --port + - "7860" + backend: + port: 7860 + database: + secretsEnabled: false + type: "sqlite" + size: "1Gi" + volumes: + storageClass: + provisioner: "kubernetes.io/aws-ebs" + type: "gp2" + fsType: "ext4" + extraParams: {} + image: + repository: ghcr.io/datastax/ragstack-ai-langflow-backend + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: latest + resources: + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + limits: + cpu: 1000m + memory: 1.5Gi + requests: + cpu: 250m + memory: 768Mi + + frontend: + enabled: true + port: 8080 + image: + repository: itestmycode/ragstack-ai-langflow-frontend + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: 0.0.8 + resources: + limits: + cpu: 1000m + memory: 1.5Gi + requests: + cpu: 250m + memory: 768Mi + + nodeSelector: {} + + tolerations: [] + + affinity: {} + podAnnotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9090" + prometheus.io/path: "/metrics" + + podSecurityContext: {} + # fsGroup: 2000 + + +secretProvider: + enabled: false diff --git a/ragstack/docker/docker-compose.yml b/ragstack/docker/docker-compose.yml index 99657fb77fae..e6257782ce50 100644 --- a/ragstack/docker/docker-compose.yml +++ b/ragstack/docker/docker-compose.yml @@ -31,7 +31,7 @@ services: environment: BACKEND_URL: http://backend:7860 ports: - - "80:80" + - "8080:8080" restart: on-failure networks: - langflow diff --git a/ragstack/docker/frontend/nginx.conf b/ragstack/docker/frontend/nginx.conf index dce094f8658b..de7966d4fba7 100644 --- a/ragstack/docker/frontend/nginx.conf +++ b/ragstack/docker/frontend/nginx.conf @@ -7,7 +7,7 @@ server { gzip_vary on; gzip_disable "MSIE [4-6] \."; - listen 80; + listen 8080; location / { root /usr/share/nginx/html;