Skip to content

Commit

Permalink
Merge pull request OpenMined#8780 from sp3nx0r/decouple-traefik-registry
Browse files Browse the repository at this point in the history
[helm] add config options for proxy/registry, and add an optional k8s ingress alternative to traefik
  • Loading branch information
rasswanth-s authored May 30, 2024
2 parents 94a345a + a10cf45 commit 00818ac
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 2 deletions.
35 changes: 35 additions & 0 deletions packages/grid/helm/syft/templates/global/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,55 @@ spec:
{{- end }}
defaultBackend:
service:
{{- if .Values.proxy.enabled }}
name: proxy
{{- else }}
name: frontend
{{- end }}
port:
number: 80
rules:
- host: {{ .Values.ingress.hostname | quote }}
http:
paths:
{{- if .Values.proxy.enabled }}
- backend:
service:
name: proxy
port:
number: 80
path: /
pathType: Prefix
{{- else }}
- backend:
service:
name: frontend
port:
number: 80
path: /
pathType: Prefix
- backend:
service:
name: backend
port:
number: 80
path: /()(api)(.*)
pathType: Prefix
- backend:
service:
name: backend
port:
number: 80
path: /()(docs|redoc)
pathType: Prefix
- backend:
service:
name: seaweedfs
port:
number: 8333
path: /(blob/)(.*)
pathType: ImplementationSpecific
{{- end }}
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/helm/syft/templates/proxy/proxy-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.proxy.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -72,4 +73,4 @@ data:
providers:
file:
filename: /etc/traefik/dynamic.yml
{{- end }}
2 changes: 2 additions & 0 deletions packages/grid/helm/syft/templates/proxy/proxy-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.proxy.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -59,3 +60,4 @@ spec:
- configMap:
name: proxy-config
name: traefik-conf
{{- end }}
2 changes: 2 additions & 0 deletions packages/grid/helm/syft/templates/proxy/proxy-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.proxy.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -18,3 +19,4 @@ spec:
protocol: TCP
port: 80
targetPort: 80
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.registry.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -15,3 +16,4 @@ spec:
protocol: TCP
port: 80
targetPort: 5000
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.registry.enabled }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -73,3 +74,4 @@ spec:
resources:
requests:
storage: {{ .Values.registry.storageSize | quote }}
{{- end }}
11 changes: 10 additions & 1 deletion packages/grid/helm/syft/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ seaweedfs:
# =================================================================================

proxy:
enabled: true
# Extra environment vars
env: null

Expand All @@ -132,6 +133,7 @@ proxy:
# =================================================================================

registry:
enabled: true
# Extra environment vars
env: null

Expand Down Expand Up @@ -201,6 +203,13 @@ node:

ingress:
hostname: null # do not make this localhost
annotations: null

# When using nginx ingress controller without internal proxy , re-enable this
# annotations:
# nginx.ingress.kubernetes.io/use-regex: "true"
# nginx.ingress.kubernetes.io/rewrite-target: /$2$3
# nginx.ingress.kubernetes.io/upstream-vhost: "$service_name:$service_port"

tls:
enabled: false
Expand Down Expand Up @@ -236,4 +245,4 @@ attestation:

# =================================================================================

extraResources: []
extraResources: []

0 comments on commit 00818ac

Please sign in to comment.