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

Validation fails if componentSpecs.metadata.creationTimestamp is not specified #1061

Closed
kparaju opened this issue Nov 5, 2019 · 8 comments
Closed
Milestone

Comments

@kparaju
Copy link
Contributor

kparaju commented Nov 5, 2019

Seldon version: v0.5

If creationTimestamp is not in componentSpecs.metadata, validation fails and k8s fails to apply the changes.

kubectl failed exit status 1: The SeldonDeployment "exp-ta-sort-products" is invalid: []: Invalid value: map[string]interface  validation failure list:
(...........)
spec.predictors.componentSpecs.metadata.creationTimestamp in body must be of type string: "null"

To fix, we need to add metadata.creationTimestamp:

spec:
  name: exp-ta-sort-products
  predictors:
    - annotations:
        seldon.io/no-engine: "true"
      componentSpecs:
        - metadata:
            creationTimestamp: "2019-11-05T19:29:12Z"
          spec:
            containers:
              - env:
                  - name: API_TYPE
                    value: REST
                  - name: GUNICORN_WORKERS
                    value: "2"
@kparaju
Copy link
Contributor Author

kparaju commented Nov 5, 2019

@phsiao
Copy link

phsiao commented Nov 5, 2019

I think the cause is our CRD needs to be updated. The old one before the rewrite has this, and the new one likely is not defaulting

                            creationTimestamp:
                              format: date-time
                              type: string

but it is strange with this line

Metadata: metav1.ObjectMeta{CreationTimestamp: metav1.Now()},
that may be incorrectly used now for unnecessary defaulting.

@ukclivecox
Copy link
Contributor

The defaulting of the timestamp seems incorrect.

Do you have a simple example that recreates the issue?

@phsiao
Copy link

phsiao commented Nov 6, 2019

We were using a CRD with this line. https://github.com/SeldonIO/seldon-core/blob/v0.4.1/kustomize/seldon-core-operator/base/seldondeployments.machinelearning.seldon.io-crd.yaml#L196

So you can expect creationTime has to meet a specific format, and null does not seem to be a valid value, so I think the defaulting was the one making it work before.

New version of CRD does not have this problem, the entire MetatData is declared as an object with no specifics, so it does not have this problem.

@ukclivecox
Copy link
Contributor

Maybe connected to kubernetes/kubernetes#84880

@ukclivecox
Copy link
Contributor

if you could check if this works with the latest master 0.5.1-SNAPSHOT

@phsiao
Copy link

phsiao commented Nov 8, 2019

I don't think this one is related to the items (which might be relevant for #1072), rather, just older version of CRD has explicit schema for metadata, while newer version of CRD treats it as an object.

@ukclivecox
Copy link
Contributor

Please reopen if still an issue

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