我无法使用 Minikube 在 Kubernetes 集群上本地部署 Mattermost

I can’t deploy Mattermost locally on a Kubernetes cluster using Minikube

一句话总结

我想使用 Minikube 在 Kubernetes 集群上本地部署 Mattermost。我正在使用 Minikube v1.23.2 和 Kubernetes v1.22.2

重现步骤

我使用了本教程和 Github 文档:

  1. 启动 minikube:minikube start
  2. 开始进入; minikube addons enable ingress
  3. 在 Github 文档中,他们声明您需要通过 运行 安装自定义资源:kubectl apply -f ./config/crd/bases
  4. 然后我按照上面提到的第一个教程的第 4 步到第 9 步(没有第 8 步)

观察到的行为

不幸的是,我在 mattermost-operator 中不断收到以下错误:no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\

请参阅下面的 mattermost-operator 日志:

time="2021-10-13T15:56:47Z" level=info msg="[opr] Go Version: go1.16.3"
time="2021-10-13T15:56:47Z" level=info msg="[opr] Go OS/Arch: linux/amd64"
time="2021-10-13T15:56:47Z" level=info msg="[opr.controller-runtime.metrics] metrics server is starting to listen" addr="0.0.0.0:8383"
time="2021-10-13T15:56:47Z" level=info msg="[opr] Registering Components"
time="2021-10-13T15:56:47Z" level=info msg="[opr] Starting manager"
I1013 15:56:47.972667       1 leaderelection.go:243] attempting to acquire leader lease mattermost-operator/b78a986e.mattermost.com...
time="2021-10-13T15:56:47Z" level=info msg="[opr.controller-runtime.manager] starting metrics server" path=/metrics
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.events] Normal" message="mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088 became leader" object="{ConfigMap mattermost-operator b78a986e.mattermost.com c7462714-0cda-4e03-9765-a2e8599fdbcf v1 11389 }" reason=LeaderElection
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.events] Normal" message="mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088 became leader" object="{Lease mattermost-operator b78a986e.mattermost.com ffe4104b-efa9-42da-8d16-5a85766366e3 coordination.k8s.io/v1 11390 }" reason=LeaderElection
I1013 15:57:05.433562       1 leaderelection.go:253] successfully acquired lease mattermost-operator/b78a986e.mattermost.com
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermost] Starting EventSource" reconciler group=installation.mattermost.com reconciler kind=Mattermost source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting EventSource" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.clusterinstallation] Starting EventSource" reconciler group=mattermost.com reconciler kind=ClusterInstallation source="kind source: /, Kind="
E1013 15:57:05.460380       1 event.go:264] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"b78a986e.mattermost.com.16ada23da3ddb598", GenerateName:"", Namespace:"mattermost-operator", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"ConfigMap", Namespace:"mattermost-operator", Name:"b78a986e.mattermost.com", UID:"c7462714-0cda-4e03-9765-a2e8599fdbcf", APIVersion:"v1", ResourceVersion:"11389", FieldPath:""}, Reason:"LeaderElection", Message:"mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088 became leader", Source:v1.EventSource{Component:"mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088", Host:""}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc051de5459b4cb98, ext:17770579701, loc:(*time.Location)(0x2333fe0)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc051de5459b4cb98, ext:17770579701, loc:(*time.Location)(0x2333fe0)}}, Count:1, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'events is forbidden: User "system:serviceaccount:mattermost-operator:mattermost-operator" cannot create resource "events" in API group "" in the namespace "mattermost-operator"' (will not retry!)
E1013 15:57:05.469732       1 event.go:264] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"b78a986e.mattermost.com.16ada23da3fa25ac", GenerateName:"", Namespace:"mattermost-operator", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"Lease", Namespace:"mattermost-operator", Name:"b78a986e.mattermost.com", UID:"ffe4104b-efa9-42da-8d16-5a85766366e3", APIVersion:"coordination.k8s.io/v1", ResourceVersion:"11390", FieldPath:""}, Reason:"LeaderElection", Message:"mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088 became leader", Source:v1.EventSource{Component:"mattermost-operator-74bc664c46-866xd_4b3f7a90-923b-4b0a-ab01-4a1ebe955088", Host:""}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc051de5459d13bac, ext:17772215701, loc:(*time.Location)(0x2333fe0)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc051de5459d13bac, ext:17772215701, loc:(*time.Location)(0x2333fe0)}}, Count:1, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'events is forbidden: User "system:serviceaccount:mattermost-operator:mattermost-operator" cannot create resource "events" in API group "" in the namespace "mattermost-operator"' (will not retry!)
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermost] Starting EventSource" reconciler group=installation.mattermost.com reconciler kind=Mattermost source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting Controller" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.clusterinstallation] Starting EventSource" reconciler group=mattermost.com reconciler kind=ClusterInstallation source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermost] Starting EventSource" reconciler group=installation.mattermost.com reconciler kind=Mattermost source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.clusterinstallation] Starting EventSource" reconciler group=mattermost.com reconciler kind=ClusterInstallation source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting workers" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB worker count=1
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermost] Starting EventSource" reconciler group=installation.mattermost.com reconciler kind=Mattermost source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.clusterinstallation] Starting EventSource" reconciler group=mattermost.com reconciler kind=ClusterInstallation source="kind source: /, Kind="
time="2021-10-13T15:57:05Z" level=error msg="[opr.controller-runtime.source] if kind is a CRD, it should be installed before calling Start" error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\"" kind=Ingress.networking.k8s.io
time="2021-10-13T15:57:05Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Stopping workers" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB
I1013 15:57:07.096906       1 request.go:655] Throttling request took 1.0466297s, request: GET:https://10.96.0.1:443/apis/events.k8s.io/v1?timeout=32s
time="2021-10-13T15:57:07Z" level=error msg="[opr.controller-runtime.source] if kind is a CRD, it should be installed before calling Start" error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\"" kind=Ingress.networking.k8s.io
time="2021-10-13T15:57:07Z" level=error msg="[opr.controller-runtime.manager] error received after stop sequence was engaged" error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\""
time="2021-10-13T15:57:07Z" level=error msg="[opr.controller-runtime.manager] error received after stop sequence was engaged" error="leader election lost"
time="2021-10-13T15:57:07Z" level=error msg="[opr] Problem running manager" error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\""

确实尝试了多种实现方式并更改了 yml 文件,但似乎没有任何效果。有人有想法吗?

networking.k8s.io/v1beta1 从 Kubernetes v1.22 开始被弃用,根据这个 link,如果 Mattermost 安装定义并使用 v1beta1 配置,这是一个问题。

如果不尝试更改现有的 Mattermost 安装配置,将 Minikube 降级到 v1.21.5 可能更幸运。

minikube start --kubernetes-version=v1.21.5