0

When I want to restart a deployment by the following command: kubectl rollout restart -n ind-iv -f mattermost-installation.yml it returns an error: unable to decode "mattermost-installation.yml": no kind "Mattermost" is registered for version "installation.mattermost.com/v1beta1" in scheme "k8s.io/kubectl/pkg/scheme/scheme.go:28"

The yml file looks like this:

apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
  name: mattermost-iv                                                         # Choose the desired name
spec:
  size: 1000users                                                             # Adjust to your requirements
  useServiceLoadBalancer: true                                                # Set to true to use AWS or Azure load balancers instead of an NGINX controller.
  ingressName: *************                                                  # Hostname used for Ingress, e.g. example.mattermost-example.com. Required when using an Ingress controller. Ignored if useServiceLoadBalancer is true.
  ingressAnnotations:
    kubernetes.io/ingress.class: nginx
  version: 6.0.0
  licenseSecret: ""                                                           # Name of a Kubernetes secret that contains Mattermost license. Required only for enterprise installation.
  database:
    external:
      secret: db-credentials                                                  # Name of a Kubernetes secret that contains connection string to external database.
  fileStore:
    external:
      url: **********                                                   # External File Storage URL.
      bucket: **********                                                # File Storage bucket name to use.
      secret: file-store-credentials
  mattermostEnv:
  - name: MM_FILESETTINGS_AMAZONS3SSE
    value: "false"
  - name: MM_FILESETTINGS_AMAZONS3SSL
    value: "false"

Anybody an idea?

Lucas Scheepers
  • 505
  • 6
  • 24
  • Which kubernetes version are you using? Just to discard a problem with an outdated k8s version. – Vicente Ayala Nov 10 '21 at 19:39
  • I'm using v1.21.5! My workaround is now: `kubectl delete -f file.yml` and then `kubectl apply -f file.yml` but not the greatest solution I think.. @VicenteAyala – Lucas Scheepers Nov 10 '21 at 21:32
  • You're getting this error because `kubectl rollout` works only with following resources: deployments, daemonsets and statefulsets. See [here](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#rollout). You're feeding kubernetes API with `kind: Mattermost` which is not appropriate with rollout. What you can try to do is `kubectl get deploy -n ind-iv` and then `kubectl rollout restart deploy %DEPLOY_NAME% -n ind-iv`. – moonkotte Nov 11 '21 at 10:33
  • 1
    I'm not able to try this solution in 2 or 3 weeks, because of other priorities at my internship. I'll update soon – Lucas Scheepers Nov 17 '21 at 10:10

0 Answers0