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

Keep deployment and CRD manifests separate #76

Closed
hasbro17 opened this issue Mar 1, 2018 · 3 comments · Fixed by #223
Closed

Keep deployment and CRD manifests separate #76

hasbro17 opened this issue Mar 1, 2018 · 3 comments · Fixed by #223
Assignees

Comments

@hasbro17
Copy link
Contributor

hasbro17 commented Mar 1, 2018

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

@fanminshi
Copy link
Contributor

fanminshi commented Mar 1, 2018

@hasbro17 I think the original idea make user's life easier by combining both manifests into one. However, you observation makes sense. We can have 2 manifests like you have suggested and probably just runkubectl -n <ns> create -f deploy/ to create both manifests in the readme section.

@adi658
Copy link

adi658 commented Jun 24, 2020

Can someone pls explain how is the deployment and the CRD linked? I dont see any names/groups/etc from CRDs mentioned in the deployment file. How are they connected??

@camilamacedo86
Copy link
Contributor

Hi @adi658.

it is closed. I'd like to suggest you check the blog, it might help you get a better idea. However, feel free to raise new issues with questions as well.

m1kola pushed a commit to m1kola/operator-sdk that referenced this issue Jun 7, 2024
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

Successfully merging a pull request may close this issue.

4 participants