Skip to content

Commit

Permalink
Remove nginx reverse proxy from Helm chart (#2816)
Browse files Browse the repository at this point in the history
* remove nginx reveerse proxy from Helm

* delete obsolete template

* move nginx templates to services/reverse-proxy
  • Loading branch information
severo authored May 16, 2024
1 parent 1984941 commit 8396078
Show file tree
Hide file tree
Showing 21 changed files with 12 additions and 327 deletions.
22 changes: 1 addition & 21 deletions chart/env/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ global:
service:
ports:
datasetsServer:
proxy: 30931
admin: 32702
api: 31370
rows: 31371
Expand All @@ -18,11 +17,6 @@ global:
images:
pullPolicy: IfNotPresent
pullSecrets: []
reverseProxy:
useGlobalRegistry: false
registry: docker.io
repository: nginx
tag: "1.20"
jobs:
mongodbMigration:
registry: huggingface
Expand Down Expand Up @@ -252,21 +246,7 @@ cacheMetricsCollector:
cpu: 1
memory: "512Mi"

# --- reverse proxy ---

reverseProxy:
nodeSelector:
role-datasets-server: "true"
replicas: 2
resources:
requests:
cpu: 1
memory: "64Mi"
limits:
cpu: 1
memory: "256Mi"
service:
type: NodePort
# --- ALB ---

ingress:
tls:
Expand Down
19 changes: 1 addition & 18 deletions chart/env/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ global:
images:
pullPolicy: IfNotPresent
pullSecrets: []
reverseProxy:
useGlobalRegistry: false
registry: docker.io
repository: nginx
tag: "1.25.3"
jobs:
mongodbMigration:
registry: huggingface
Expand Down Expand Up @@ -179,19 +174,7 @@ queueMetricsCollector:
cpu: 1
memory: "512Mi"

# --- reverse proxy ---

reverseProxy:
replicas: 1
resources:
requests:
cpu: 100m
memory: "64Mi"
limits:
cpu: 1
memory: "256Mi"
service:
type: NodePort
# --- ALB ---

ingress:
tls:
Expand Down
81 changes: 0 additions & 81 deletions chart/templates/_common/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ Create chart name and version as used by the chart label.
{{/*
Docker image management
*/}}
{{- define "reverseproxy.image" -}}
{{ include "hf.common.images.image" (dict "imageRoot" .Values.images.reverseProxy "global" .Values.global.huggingface) }}
{{- end -}}

{{- define "jobs.mongodbMigration.image" -}}
{{ include "hf.common.images.image" (dict "imageRoot" .Values.images.jobs.mongodbMigration "global" .Values.global.huggingface) }}
{{- end -}}
Expand Down Expand Up @@ -70,11 +66,6 @@ Docker image management
{{/*
Common labels
*/}}
{{- define "labels.reverseProxy" -}}
{{ include "hf.labels.commons" . }}
app.kubernetes.io/component: "{{ include "name" . }}-reverse-proxy"
{{- end -}}

{{- define "labels.mongodbMigration" -}}
{{ include "hf.labels.commons" . }}
app.kubernetes.io/component: "{{ include "name" . }}-mongodb-migration"
Expand Down Expand Up @@ -135,13 +126,6 @@ app.kubernetes.io/component: "{{ include "name" . }}-sse-api"
app.kubernetes.io/component: "{{ include "name" . }}-worker-{{ .workerValues.deployName }}"
{{- end -}}

{{/*
Return the api ingress anotation
*/}}
{{- define "datasetsServer.ingress.annotations" -}}
{{ .Values.ingress.annotations | toYaml }}
{{- end -}}

{{/*
The dataset viewer API base url
*/}}
Expand Down Expand Up @@ -183,71 +167,6 @@ The parquet-metadata/ subpath in the EFS
{{- printf "%s/%s/%s/" .Chart.Name .Release.Name "parquet-metadata" }}
{{- end }}

{{/*
The duckdb-index/ subpath in EFS
- in a subdirectory named as the chart (dataset-viewer/), and below it,
- in a subdirectory named as the Release, so that Releases will not share the same dir
*/}}
{{- define "duckDBIndex.subpath" -}}
{{- printf "%s/%s/%s/" .Chart.Name .Release.Name "duckdb-index" }}
{{- end }}

{{/*
The URL to access the mongodb instance created if mongodb.enable is true
It's named using the Release name
*/}}
{{- define "mongodb.url" -}}
{{- printf "mongodb://%s-mongodb" .Release.Name }}
{{- end }}
{{/*
The URL to access the admin service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "admin.url" -}}
{{- printf "http://%s-admin.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
The URL to access the API service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "api.url" -}}
{{- printf "http://%s-api.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
The URL to access the rows service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "rows.url" -}}
{{- printf "http://%s-rows.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
The URL to access the search service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "search.url" -}}
{{- printf "http://%s-search.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
The URL to access the SSE API service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "sseApi.url" -}}
{{- printf "http://%s-sse-api.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
The URL to access the worker service from another container
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records
*/}}
{{- define "worker.url" -}}
{{- printf "http://%s-worker.%s.svc.cluster.local:80" ( include "name" . ) ( .Release.Namespace ) }}
{{- end }}
{{/*
Return the HUB url
*/}}
Expand Down
8 changes: 0 additions & 8 deletions chart/templates/_volumes/_volumeDuckDBIndex.tpl

This file was deleted.

23 changes: 0 additions & 23 deletions chart/templates/ingress.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions chart/templates/reverse-proxy/_container.tpl

This file was deleted.

14 changes: 0 additions & 14 deletions chart/templates/reverse-proxy/configMap.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions chart/templates/reverse-proxy/deployment.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions chart/templates/reverse-proxy/pdb.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions chart/templates/reverse-proxy/service.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion chart/templates/services/admin/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.

{{ $serviceType := .Values.reverseProxy.service.type | default .Values.global.huggingface.service.type }}
{{ $serviceType := .Values.global.huggingface.service.type }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/services/api/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.

{{ $serviceType := .Values.reverseProxy.service.type | default .Values.global.huggingface.service.type }}
{{ $serviceType := .Values.global.huggingface.service.type }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/services/rows/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The HuggingFace Authors.

{{ $serviceType := .Values.reverseProxy.service.type | default .Values.global.huggingface.service.type }}
{{ $serviceType := .Values.global.huggingface.service.type }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/services/search/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 The HuggingFace Authors.

{{ $serviceType := .Values.reverseProxy.service.type | default .Values.global.huggingface.service.type }}
{{ $serviceType := .Values.global.huggingface.service.type }}
apiVersion: v1
kind: Service
metadata:
Expand Down
Loading

0 comments on commit 8396078

Please sign in to comment.