Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AndreaNicola opened this issue Jul 16, 2020 · 3 comments

Comments

@AndreaNicola
Copy link
Contributor

AndreaNicola commented Jul 16, 2020

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

@vroyer
Copy link

vroyer commented Jul 16, 2020 via email

@AndreaNicola
Copy link
Contributor Author

Done!

keep up the good work Vincent!

@hhaslam11
Copy link

@vroyer Could we get that PR merged? I'm having the same issue, and the fix is just sitting there 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants