Skip to content

no matches for kind "StatefulSet" in version "apps/v1beta1" on strapdata/elassandra chart #9

@AndreaNicola

Description

@AndreaNicola

Hi,

today i tried to install strapdata/elassandra chart on a kubernetes v 1.18 cluster.

Setup failed with error "no matches for kind "StatefulSet" in version "apps/v1beta1".

I dug into templates/statefulset.yaml to change apiVersion to v1 like suggested in similar issues with statefulsets and i faced a new error:

"Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(StatefulSet.spec): missing required field "selector" in io.k8s.api.apps.v1.StatefulSetSpec"

I added a selector object in spec duplicating the metadata labels and i receveid a new error:

Error: StatefulSet.apps "elassandra" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"elassandra", "release":"elassandra"}: selector does not match template labels

So I changed selector labels copying spec.template.metadata.labels section and the chart deployed correctly (or at least it seems to be!)

The resulting yaml looks like this:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: {{ template "elassandra.fullname" . }}
  labels:
    app: {{ template "elassandra.name" . }}
    chart: {{ template "elassandra.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  selector:
    matchLabels:
      app: {{ template "elassandra.name" . }}
      release: {{ .Release.Name }}
  serviceName: {{ template "elassandra.fullname" . }}
  replicas: {{ .Values.config.cluster_size }}
  podManagementPolicy: {{ .Values.podManagementPolicy }}
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: {{ template "elassandra.name" . }}
        release: {{ .Release.Name }}

...

statefulset.zip

I attach the full modified templates/statefulset.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions