这里的版本比较旧了,但我们可以下载helm改成最新的v0.44
- 修改value.yaml
image:
repository: metabase/metabase
tag: v0.44.6
pullPolicy: IfNotPresent
...
# Backend database
database:
# Database type (h2 / mysql / postgres), default: h2
type: mysql
# encryptionKey: << YOUR ENCRYPTION KEY >>
## Only need when you use mysql / postgres
host: ""
port: 3306
dbname: ""
username: ""
password: ""
...
# Ingress
ingress:
enabled: true
# Used to create Ingress record (should used with service.type: ClusterIP).
hosts:
- <host>
# The ingress path. Useful to host metabase on a subpath, such as `/metabase`.
path: /
labels:
# Used to add custom labels to the Ingress
# Useful if for example you have multiple Ingress controllers and want your Ingress controllers to bind to specific Ingresses
# traffic: internal
annotations: {}
kubernetes.io/ingress.class: nginx
...
- 修改ingress.yaml
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "metabase.fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "metabase.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "metabase.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- range $key, $value := .Values.ingress.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
ingressClassName: nginx
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: {{ $ingressPath }}
pathType: Prefix
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
- 部署
helm install meta -f values.yaml . -n meta
- 配置并登录