Kubeflow Mnist example - unable to recognize "STDIN": no matches for kind "TFJob" in version "kubeflow.org/v1beta2"

10/31/2019

Following the kubeflow mnist examples guide here here

When running kustomize build . | kubectl apply -f - configmap/mnist-map-training-45h47275m7 unchanged error: unable to recognize "STDIN": no matches for kind "TFJob" in version "kubeflow.org/v1beta2" I've been reading through a couple of threads on the on the github repo and I can't find a solution. Looking for any advice on what I can do

Most of the threads seem to be resolved by changing to kustomize version 2.03 which I am on

Version: {KustomizeVersion:2.0.3 GitCommit:a6f65144121d1955266b0cd836ce954c04122dc8 BuildDate:2019-03-05T20:37:42Z GoOs:linux GoArch:amd64}

I ran kubectl describe crd tfjobs.kubeflow.org and this is what returned

Name:         tfjobs.kubeflow.org
Namespace:    
Labels:       app.kubernetes.io/component=tfjob
              app.kubernetes.io/instance=tf-job-crds-v0.7.0
              app.kubernetes.io/managed-by=kfctl
              app.kubernetes.io/name=tf-job-crds
              app.kubernetes.io/part-of=kubeflow
              app.kubernetes.io/version=v0.7.0
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"labels":{"app.kubernetes.io/c...
API Version:  apiextensions.k8s.io/v1beta1
Kind:         CustomResourceDefinition
Metadata:
  Creation Timestamp:  2019-10-29T23:53:03Z
  Generation:          1
  Resource Version:    2620
  Self Link:           /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/tfjobs.kubeflow.org
  UID:                 3eb96b55-faa7-11e9-9ab9-42010a840fdc
Spec:
  Additional Printer Columns:
    JSON Path:  .status.conditions[-1:].type
    Name:       State
    Type:       string
    JSON Path:  .metadata.creationTimestamp
    Name:       Age
    Type:       date
  Conversion:
    Strategy:  None
  Group:       kubeflow.org
  Names:
    Kind:       TFJob
    List Kind:  TFJobList
    Plural:     tfjobs
    Singular:   tfjob
  Scope:        Namespaced
  Subresources:
    Status:
  Validation:
    openAPIV3Schema:
      Properties:
        Spec:
          Properties:
            Tf Replica Specs:
              Properties:
                Chief:
                  Properties:
                    Replicas:
                      Maximum:  1
                      Minimum:  1
                      Type:     integer
                PS:
                  Properties:
                    Replicas:
                      Minimum:  1
                      Type:     integer
                Worker:
                  Properties:
                    Replicas:
                      Minimum:  1
                      Type:     integer
  Version:                      v1
  Versions:
    Name:     v1
    Served:   true
    Storage:  true
Status:
  Accepted Names:
    Kind:       TFJob
    List Kind:  TFJobList
    Plural:     tfjobs
    Singular:   tfjob
  Conditions:
    Last Transition Time:  2019-10-29T23:53:03Z
    Message:               no conflicts found
    Reason:                NoConflicts
    Status:                True
    Type:                  NamesAccepted
    Last Transition Time:  <nil>
    Message:               the initial names have been accepted
    Reason:                InitialNamesAccepted
    Status:                True
    Type:                  Established
  Stored Versions:
    v1
Events:  <none>
-- FLennon
kubeflow
kubernetes
kustomize

1 Answer

11/12/2019

As described in TFJob documentation since kubeflow v0.7 apiVersion is kubeflow.org/v1

To fix given error run kubectl edit tfjob, hit i or Insert key and change apiVersion: to kubeflow.org/v1. Then hit ESC :wq to quit editing and TFJob object will be changed.

-- KFC_
Source: StackOverflow