Skip to content

Commit c422841

Browse files
authored
fix: route minio requests through ambassador (#7)
1 parent 8491040 commit c422841

File tree

5 files changed

+60
-111
lines changed

5 files changed

+60
-111
lines changed

helm-chart/templates/emissary-ingress/mappings.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -531,3 +531,63 @@ spec:
531531
service: self-hosted-hub-public-api.{{ .Release.Namespace }}:8000
532532
timeout_ms: 30000
533533
precedence: 100
534+
{{- if .Values.global.artifacts.local.enabled }}
535+
---
536+
apiVersion: getambassador.io/v3alpha1
537+
kind: Mapping
538+
metadata:
539+
name: minio-artifacts-mapping
540+
namespace: {{ .Release.Namespace }}
541+
spec:
542+
host: "^artifacts\\..*"
543+
host_regex: true
544+
prefix: /
545+
rewrite: ""
546+
service: minio-artifacts.{{ .Release.Namespace }}:9000
547+
timeout_ms: 30000
548+
bypass_auth: true
549+
envoy_override:
550+
retry_policy:
551+
retry_on: connect-failure
552+
num_retries: 3
553+
{{- end }}
554+
{{- if .Values.global.cache.local.enabled }}
555+
---
556+
apiVersion: getambassador.io/v3alpha1
557+
kind: Mapping
558+
metadata:
559+
name: minio-cache-mapping
560+
namespace: {{ .Release.Namespace }}
561+
spec:
562+
host: "^cache\\..*"
563+
host_regex: true
564+
prefix: /
565+
rewrite: ""
566+
service: minio-cache.{{ .Release.Namespace }}:9000
567+
timeout_ms: 30000
568+
bypass_auth: true
569+
envoy_override:
570+
retry_policy:
571+
retry_on: connect-failure
572+
num_retries: 3
573+
{{- end }}
574+
{{- if .Values.global.logs.local.enabled }}
575+
---
576+
apiVersion: getambassador.io/v3alpha1
577+
kind: Mapping
578+
metadata:
579+
name: minio-logs-mapping
580+
namespace: {{ .Release.Namespace }}
581+
spec:
582+
host: "^logs\\..*"
583+
host_regex: true
584+
prefix: /
585+
rewrite: ""
586+
service: minio-logs.{{ .Release.Namespace }}:9000
587+
timeout_ms: 30000
588+
bypass_auth: true
589+
envoy_override:
590+
retry_policy:
591+
retry_on: connect-failure
592+
num_retries: 3
593+
{{- end }}

helm-chart/templates/ingress.yaml

-30
Original file line numberDiff line numberDiff line change
@@ -48,36 +48,6 @@ spec:
4848
port:
4949
number: 8080
5050
rules:
51-
- host: "artifacts.{{ $domainName }}"
52-
http:
53-
paths:
54-
- backend:
55-
service:
56-
name: minio-artifacts
57-
port:
58-
number: 9000
59-
path: /
60-
pathType: Prefix
61-
- host: "cache.{{ $domainName }}"
62-
http:
63-
paths:
64-
- backend:
65-
service:
66-
name: minio-cache
67-
port:
68-
number: 9000
69-
path: /
70-
pathType: Prefix
71-
- host: "logs.{{ $domainName }}"
72-
http:
73-
paths:
74-
- backend:
75-
service:
76-
name: minio-logs
77-
port:
78-
number: 9000
79-
path: /
80-
pathType: Prefix
8151
- host: "*.{{ $domainName }}"
8252
http:
8353
paths:

helm-chart/templates/minio/artifacts.yaml

-27
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ metadata:
2020
labels:
2121
app: minio-artifacts
2222
product: semaphoreci
23-
{{- if eq .Values.ingress.className "gce" }}
24-
annotations:
25-
cloud.google.com/backend-config: '{"ports": {"9000":"minio-artifacts-backend-config"}}'
26-
cloud.google.com/neg: '{"ingress": true}'
27-
{{- end }}
2823
spec:
2924
type: ClusterIP
3025
ports:
@@ -87,26 +82,4 @@ spec:
8782
resources:
8883
requests:
8984
storage: {{ .Values.global.artifacts.local.size }}
90-
---
91-
{{- if .Values.ingress.enabled }}
92-
{{- if eq .Values.ingress.className "gce" }}
93-
apiVersion: cloud.google.com/v1
94-
kind: BackendConfig
95-
metadata:
96-
name: minio-artifacts-backend-config
97-
namespace: {{ .Release.Namespace }}
98-
spec:
99-
timeoutSec: 30
100-
connectionDraining:
101-
drainingTimeoutSec: 30
102-
logging:
103-
enable: true
104-
healthCheck:
105-
checkIntervalSec: 10
106-
timeoutSec: 10
107-
port: 9000
108-
type: HTTP
109-
requestPath: /minio/health/live
110-
{{- end }}
111-
{{- end }}
11285
{{- end }}

helm-chart/templates/minio/cache.yaml

-27
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ metadata:
77
labels:
88
app: minio-cache
99
product: semaphoreci
10-
{{- if eq .Values.ingress.className "gce" }}
11-
annotations:
12-
cloud.google.com/backend-config: '{"ports": {"9000":"minio-cache-backend-config"}}'
13-
cloud.google.com/neg: '{"ingress": true}'
14-
{{- end }}
1510
spec:
1611
type: ClusterIP
1712
ports:
@@ -74,26 +69,4 @@ spec:
7469
resources:
7570
requests:
7671
storage: {{ .Values.global.cache.local.size }}
77-
---
78-
{{- if .Values.ingress.enabled }}
79-
{{- if eq .Values.ingress.className "gce" }}
80-
apiVersion: cloud.google.com/v1
81-
kind: BackendConfig
82-
metadata:
83-
name: minio-cache-backend-config
84-
namespace: {{ .Release.Namespace }}
85-
spec:
86-
timeoutSec: 30
87-
connectionDraining:
88-
drainingTimeoutSec: 30
89-
logging:
90-
enable: true
91-
healthCheck:
92-
checkIntervalSec: 10
93-
timeoutSec: 10
94-
port: 9000
95-
type: HTTP
96-
requestPath: /minio/health/live
97-
{{- end }}
98-
{{- end }}
9972
{{- end }}

helm-chart/templates/minio/logs.yaml

-27
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ metadata:
2020
labels:
2121
app: minio-logs
2222
product: semaphoreci
23-
{{- if eq .Values.ingress.className "gce" }}
24-
annotations:
25-
cloud.google.com/backend-config: '{"ports": {"9000":"minio-logs-backend-config"}}'
26-
cloud.google.com/neg: '{"ingress": true}'
27-
{{- end }}
2823
spec:
2924
type: ClusterIP
3025
ports:
@@ -87,26 +82,4 @@ spec:
8782
resources:
8883
requests:
8984
storage: {{ .Values.global.logs.local.size }}
90-
---
91-
{{- if .Values.ingress.enabled }}
92-
{{- if eq .Values.ingress.className "gce" }}
93-
apiVersion: cloud.google.com/v1
94-
kind: BackendConfig
95-
metadata:
96-
name: minio-logs-backend-config
97-
namespace: {{ .Release.Namespace }}
98-
spec:
99-
timeoutSec: 30
100-
connectionDraining:
101-
drainingTimeoutSec: 30
102-
logging:
103-
enable: true
104-
healthCheck:
105-
checkIntervalSec: 10
106-
timeoutSec: 10
107-
port: 9000
108-
type: HTTP
109-
requestPath: /minio/health/live
110-
{{- end }}
111-
{{- end }}
11285
{{- end }}

0 commit comments

Comments
 (0)