zer0def
3 years ago
3 changed files with 91 additions and 45 deletions
-
90k8s/helm_charts2/templates/ingress.yaml
-
4k8s/helm_charts2/templates/service-account.yaml
-
40k8s/helm_charts2/values.yaml
@ -1,61 +1,67 @@ |
|||
{{- if .Values.filer.ingress.enabled }} |
|||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} |
|||
apiVersion: networking.k8s.io/v1 |
|||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }} |
|||
apiVersion: networking.k8s.io/v1beta1 |
|||
{{- else }} |
|||
apiVersion: extensions/v1beta1 |
|||
{{- end }} |
|||
kind: Ingress |
|||
metadata: |
|||
name: ingress-{{ template "seaweedfs.name" . }}-filer |
|||
namespace: {{ .Release.Namespace }} |
|||
annotations: |
|||
kubernetes.io/ingress.class: "nginx" |
|||
nginx.ingress.kubernetes.io/auth-type: "basic" |
|||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret" |
|||
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Filer' |
|||
nginx.ingress.kubernetes.io/service-upstream: "true" |
|||
nginx.ingress.kubernetes.io/rewrite-target: /$1 |
|||
nginx.ingress.kubernetes.io/use-regex: "true" |
|||
nginx.ingress.kubernetes.io/enable-rewrite-log: "true" |
|||
nginx.ingress.kubernetes.io/ssl-redirect: "false" |
|||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" |
|||
nginx.ingress.kubernetes.io/configuration-snippet: | |
|||
sub_filter '<head>' '<head> <base href="/sw-filer/">'; #add base url |
|||
sub_filter '="/' '="./'; #make absolute paths to relative |
|||
sub_filter '=/' '=./'; |
|||
sub_filter '/seaweedfsstatic' './seaweedfsstatic'; |
|||
sub_filter_once off; |
|||
name: ingress-{{ template "seaweedfs.name" . }}-filer |
|||
namespace: {{ .Release.Namespace }} |
|||
annotations: |
|||
{{ omit .Values.filer.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }} |
|||
spec: |
|||
rules: |
|||
- http: |
|||
paths: |
|||
- path: /sw-filer/?(.*) |
|||
backend: |
|||
serviceName: {{ template "seaweedfs.name" . }}-filer |
|||
servicePort: {{ .Values.filer.port }} |
|||
ingressClassName: {{ .Values.filer.ingress.className | quote }} |
|||
rules: |
|||
- http: |
|||
paths: |
|||
- path: /sw-filer/?(.*) |
|||
pathType: ImplementationSpecific |
|||
backend: |
|||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} |
|||
service: |
|||
name: {{ template "seaweedfs.name" . }}-filer |
|||
port: |
|||
number: {{ .Values.filer.port }} |
|||
#name: |
|||
{{- else }} |
|||
serviceName: {{ template "seaweedfs.name" . }}-filer |
|||
servicePort: {{ .Values.filer.port }} |
|||
{{- end }} |
|||
{{- end }} |
|||
--- |
|||
{{- if .Values.master.ingress.enabled }} |
|||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} |
|||
apiVersion: networking.k8s.io/v1 |
|||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }} |
|||
apiVersion: networking.k8s.io/v1beta1 |
|||
{{- else }} |
|||
apiVersion: extensions/v1beta1 |
|||
{{- end }} |
|||
kind: Ingress |
|||
metadata: |
|||
name: ingress-{{ template "seaweedfs.name" . }}-master |
|||
namespace: {{ .Release.Namespace }} |
|||
annotations: |
|||
kubernetes.io/ingress.class: "nginx" |
|||
nginx.ingress.kubernetes.io/auth-type: "basic" |
|||
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret" |
|||
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Master' |
|||
nginx.ingress.kubernetes.io/service-upstream: "true" |
|||
nginx.ingress.kubernetes.io/rewrite-target: /$1 |
|||
nginx.ingress.kubernetes.io/use-regex: "true" |
|||
nginx.ingress.kubernetes.io/enable-rewrite-log: "true" |
|||
nginx.ingress.kubernetes.io/ssl-redirect: "false" |
|||
nginx.ingress.kubernetes.io/force-ssl-redirect: "false" |
|||
nginx.ingress.kubernetes.io/configuration-snippet: | |
|||
sub_filter '<head>' '<head> <base href="/sw-master/">'; #add base url |
|||
sub_filter '="/' '="./'; #make absolute paths to relative |
|||
sub_filter '=/' '=./'; |
|||
sub_filter '/seaweedfsstatic' './seaweedfsstatic'; |
|||
sub_filter_once off; |
|||
{{ omit .Values.master.ingress.annotations "kubernetes.io/ingress.class" | toYaml | nindent 4 }} |
|||
spec: |
|||
ingressClassName: {{ .Values.master.ingress.className | quote }} |
|||
rules: |
|||
- http: |
|||
paths: |
|||
- path: /sw-master/?(.*) |
|||
pathType: ImplementationSpecific |
|||
backend: |
|||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} |
|||
service: |
|||
name: {{ template "seaweedfs.name" . }}-master |
|||
port: |
|||
number: {{ .Values.master.port }} |
|||
#name: |
|||
{{- else }} |
|||
serviceName: {{ template "seaweedfs.name" . }}-master |
|||
servicePort: {{ .Values.master.port }} |
|||
{{- end }} |
|||
{{- end }} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue