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

What's the correct way to extend my crd & its controller without multiversion #63958

Closed
occia opened this issue May 17, 2018 · 3 comments
Closed
Assignees
Labels
kind/support Categorizes issue or PR as a support question. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.

Comments

@occia
Copy link

occia commented May 17, 2018

I'm developing on k8s v1.9.2. I've implemented a crd(let's call it A) and write a controller on it. The controller create deployments, services according to A's some fields. But I get stuck when I try to figure out the controller's future upgrade scheme.

I know in 1.9.2, crd can't have multiple versions, and assuming A's definition likes the following:

type A struct {

    metav1.TypeMeta   `json:",inline"`

    metav1.ObjectMeta `json:"metadata,omitempty"`

    Spec   ASpec   `json:"spec"`
}

type ASpec struct {

        Field1 int32
}

And assuming I have some A's instances running in the cluster, e.g. a1, a2, a3. And a* have their related resources running, e.g. some deployments.

Under my test, when I add a new field to A, recompile & restart my controller, the old running a* have a default value on the new field automatically. But I don't know the backend mechanism.

And the questions are:

  1. What's the best way to extend my A, e.g. add new field Field2 or change the Field1 from int32 to string and keep the already running instances (a1, a2, a3...) upgrade to the new A definition smoothly?
    Or, in another way, add/change/delete a field of A, which modifications are acceptable?

  2. Can you give me the recommend way to do the future upgrade of A without pulling all already running a* down?

@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 17, 2018
@k8s-ci-robot
Copy link
Contributor

@occia: There are no sig labels on this issue. Please add a sig label.

A sig label can be added by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list.
The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@shubheksha
Copy link
Contributor

/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label May 17, 2018
@jhorwit2
Copy link
Contributor

@occia Thanks for your questions; however, e are trying to consolidate the channels to which questions for help/support are posted so that we can improve our efficiency in responding to your requests, and to make it easier for you to find answers to frequently asked questions and
how to address common use cases.

Please follow along with the CRD versioning feature ticket to track support of this. You can also read this issue which asked the same question.

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants