Skip to content

Keep deployment and CRD manifests separate #76

@hasbro17

Description

@hasbro17

Currently we generate a single file deploy/operator.yaml that has the CRD and deployment manifests:

$ cat deploy/operator.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: appservices.app.example.com
spec:
  group: app.example.com
  names:
    kind: AppService
    listKind: AppServiceList
    plural: appservices
    singular: appservice
  scope: Namespaced
  version: v1alpha1
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: app-operator
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: app-operator
    spec:
      containers:
        - name: app-operator
          image: quay.io/coreos/operator-sdk-dev:app-operator
          command:
          - app-operator

The CRD is something that the user will only create once, but the operator Deployment is something the user might want to delete, edit and recreate multiple times.
For instance on my first run I forgot to specify the pull secret in the deployment manifest and had to edit the manifest and recreate it.

From a usability perspective it would be better to keep them as two separate files deploy/operator.yaml and deploy/<kind>-CRD.yaml and just specify in the README that the user should do the following:

$ kubectl create -f deploy/<kind>-CRD.yaml
$ kubectl -n <ns> -f deploy/operator.yaml

/cc @fanminshi @hongchaodeng

Metadata

Metadata

Assignees

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