cloudstateio / cloudstate

Distributed State Management for Serverless
https://cloudstate.io
Apache License 2.0
762 stars 97 forks source link

Cloudstate CRDs should probably use a sub-domain for API group #145

Open jsravn opened 5 years ago

jsravn commented 5 years ago

The current CRD is defined like this:

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: statefulstores.cloudstate.io
spec:
  group: cloudstate.io

This seems to break convention of defining a CRD group as a sub-domain of the owned domain. Examples are Istio which uses config.istio.io, Prometheus which uses monitoring.coreos.com.

I ran into this because kubebuilder expects the API group to be a sub-domain of the CRD's domain. So it thinks this CRD's domain is io. One common sub-domain used for group is crd, so we could consider changing it to crd.cloudstate.io.

I think technically this is allowed, but as convention seems to indicate using a sub-domain, we should consider changing it to prevent future incompatibilities with tools and changes to k8s itself.

jsravn commented 5 years ago

The Kubernetes API conventions also recommends this:

When choosing a group name, we recommend selecting a subdomain your group or organization owns, such as "widget.mycompany.com".

sleipnir commented 4 years ago

I agree