We're Hiring!

Mattermost Discussion Forums

Deploying Mattermost on Minikube (mattermost-operator keeps crashing)

Summary
I’m new to this and currently doing an internship at a company to research alternative communication tools with multi-functional purposes. I want to deploy Mattermost locally on a Kubernetes cluster using Minikube before deploying in the test environment of the company. Mattermost-operator keeps crashing. It has something to do with Ingress…

Steps to reproduce
I’m using mattermost-operator v1.15.0
And mattermost v5.31.0

I used these two tutorials:

  1. How to get started with Mattermost on Kubernetes in just a few minutes
  2. Set up Ingress on Minikube with the NGINX Ingress Controller | Kubernetes

The stept I took:

  1. minikube start
  2. minikube addons enable ingress
  3. Step 4 to 6 from the first tutorial (mattermost)

Behavior
Error from mattermost-operator

Same error:

time="2021-10-08T10:31:18Z" level=info msg="[opr] Go Version: go1.16.3"
time="2021-10-08T10:31:18Z" level=info msg="[opr] Go OS/Arch: linux/amd64"
time="2021-10-08T10:31:18Z" level=info msg="[opr.controller-runtime.metrics] metrics server is starting to listen" addr="0.0.0.0:8383"
time="2021-10-08T10:31:18Z" level=info msg="[opr] Registering Components"
time="2021-10-08T10:31:18Z" level=info msg="[opr] Starting manager"
I1008 10:31:18.347106       1 leaderelection.go:243] attempting to acquire leader lease mattermost-operator/b78a986e.mattermost.com...
time="2021-10-08T10:31:18Z" level=info msg="[opr.controller-runtime.manager] starting metrics server" path=/metrics
I1008 10:31:35.806784       1 leaderelection.go:253] successfully acquired lease mattermost-operator/b78a986e.mattermost.com
time="2021-10-08T10:31:35Z" level=info msg="[opr.controller-runtime.manager.events] Normal" message="mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68 became leader" object="{ConfigMap mattermost-operator b78a986e.mattermost.com 7e4f23d4-3dd7-4f21-a46f-8c7b29e84c4f v1 3775 }" reason=LeaderElection
time="2021-10-08T10:31:35Z" level=info msg="[opr.controller-runtime.manager.events] Normal" message="mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68 became leader" object="{Lease mattermost-operator b78a986e.mattermost.com 144a9ac0-34bc-466a-9eca-b28b34adb346 coordination.k8s.io/v1 3776 }" reason=LeaderElection
time="2021-10-08T10:31:35Z" 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-08T10:31:35Z" 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-08T10:31:35Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting EventSource" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB source="kind source: /, Kind="
E1008 10:31:35.821829       1 event.go:264] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"b78a986e.mattermost.com.16ac0793b4fd2480", 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:"7e4f23d4-3dd7-4f21-a46f-8c7b29e84c4f", APIVersion:"v1", ResourceVersion:"3775", FieldPath:""}, Reason:"LeaderElection", Message:"mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68 became leader", Source:v1.EventSource{Component:"mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68", Host:""}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc0502561f0159e80, ext:17772305301, loc:(*time.Location)(0x2333fe0)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc0502561f0159e80, ext:17772305301, 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!)
E1008 10:31:35.830037       1 event.go:264] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"b78a986e.mattermost.com.16ac0793b4fdb6fc", 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:"144a9ac0-34bc-466a-9eca-b28b34adb346", APIVersion:"coordination.k8s.io/v1", ResourceVersion:"3776", FieldPath:""}, Reason:"LeaderElection", Message:"mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68 became leader", Source:v1.EventSource{Component:"mattermost-operator-74bc664c46-pdhtz_41d11f1d-e5ea-4f0a-b6a6-85bae856fe68", Host:""}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc0502561f01630fc, ext:17772342601, loc:(*time.Location)(0x2333fe0)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc0502561f01630fc, ext:17772342601, 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-08T10:31:35Z" 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-08T10:31:35Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting Controller" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB
time="2021-10-08T10:31:35Z" 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-08T10:31:36Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Starting workers" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB worker count=1
time="2021-10-08T10:31:36Z" 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-08T10:31:36Z" 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-08T10:31:36Z" 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-08T10:31:36Z" 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-08T10:31:36Z" 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-08T10:31:36Z" level=info msg="[opr.controller-runtime.manager.controller.mattermostrestoredb] Stopping workers" reconciler group=mattermost.com reconciler kind=MattermostRestoreDB
I1008 10:31:37.465477       1 request.go:655] Throttling request took 1.0453276s, request: GET:https://10.96.0.1:443/apis/admissionregistration.k8s.io/v1?timeout=32s
time="2021-10-08T10:31:38Z" 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-08T10:31:38Z" 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-08T10:31:38Z" level=error msg="[opr.controller-runtime.manager] error received after stop sequence was engaged" error="leader election lost"
time="2021-10-08T10:31:38Z" level=error msg="[opr] Problem running manager" error="no matches for kind \"Ingress\" in version \"networking.k8s.io/v1beta1\""

Anybody an idea?

Why did you choose v5.31 which is very old?

I just deployed v6.0 using the Helm chart a few days ago without issues.

Didn’t use v5.31 yet. Something goes wrong at deploying mattermost-operator. I’m now getting the error no matches for kind \"Mattermost\" in version \"installation.mattermost.com/v1beta1\

I want to try installing the operators using Helm now. I’m using this link for that. But at step 2 they refer to another dead link for the config.yml file. Does anybody have a example config.yml file? Or can you help me with that? @pat-s

I used this values.yml file → changed it to config.yml.

But now I’m getting the error INSTALLATION FAILED: failed to install CRD crds/crd-minioinstances.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"