<p>I have CRD definition in Kubernetes. When I try to send a request with <code>kubectl proxy</code> by this link:</p>
<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/
</code></pre>
<p>I get created custom object information. However, when I try to get the status of this custom object with:</p>
<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/status
</code></pre>
<p>I get an error:</p>
<pre><code> {
  &quot;kind&quot;: &quot;Status&quot;,
  &quot;apiVersion&quot;: &quot;v1&quot;,
  &quot;metadata&quot;: {
    
  },
  &quot;status&quot;: &quot;Failure&quot;,
  &quot;message&quot;: &quot;sparkapplications.sparkoperator.k8s.io \&quot;status\&quot; not found&quot;,
  &quot;reason&quot;: &quot;NotFound&quot;,
  &quot;details&quot;: {
    &quot;name&quot;: &quot;status&quot;,
    &quot;group&quot;: &quot;sparkoperator.k8s.io&quot;,
    &quot;kind&quot;: &quot;sparkapplications&quot;
  },
  &quot;code&quot;: 404
</code></pre>
<p>Why there is no status for the custom object? Is there something wrong with CRD definition?</p>
<p>I use Minikube version v0.32.0 which I start this way:</p>
<pre><code>minikube start --kubernetes-version v1.13.0 --memory 8048 --cpus 3 --feature-gates=CustomResourceSubresources=true
</code></pre>
<p>CRD definition looks like this:</p>
<pre><code>apiVersion: sparkoperator.k8s.io/v1alpha1
kind: SparkApplication
metadata:
  name: spark-example
  namespace: default
spec:
  type: Scala
  image: gcr.io/ynli-k8s/spark:v2.4.0-SNAPSHOT
  mainClass: org.apache.spark.examples.SparkExample
  mainApplicationFile: http://localhost:8089/spark_k8s_airflow.jar
  mode: cluster
  deps: {}
  driver:
    coreLimit: 1000m
    cores: 0.1
    labels:
      version: 2.4.0
    memory: 1024m
    serviceAccount: default
  executor:
    cores: 1
    instances: 1
    labels:
      version: 2.4.0
    memory: 1024m
  imagePullPolicy: Always
  subresources:
    status: {}
</code></pre>
<p>UPDATE: I have called the object spark-example specifically, the object data is returned, but the status call returns error.</p>
<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/spark-example/status 
</code></pre>
<p>returns this message:</p>
<pre><code>the server could not find the requested resource
</code></pre>
<p>Although, there is subresources definition in the CRD definition.</p>

<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/
</code></pre>

<p>The above request will give you the list of <code>SparkApplication</code> kind objects in <code>default</code> namespaces.</p>

<p>To get specific object, you have to specify the object name:</p>

<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/&lt;object-name&gt;
</code></pre>

<p><code>status</code> is the part of the object, not <code>SparkApplication</code> kind. That's why you are getting that error. If you try for specific object, it will work.</p>

<pre><code>curl http://localhost:8090/apis/sparkoperator.k8s.io/v1alpha1/namespaces/default/sparkapplications/&lt;object-name&gt;/status
</code></pre>

<blockquote>
  <p>Note: I am assuming that you enabled <code>status</code> subresource for <code>SparkApplication</code> CRD. Otherwise it will give error.</p>
</blockquote>

<p>If <code>status</code> subresource is not enabled in CRD definition, then you can not get status in <code>/status</code> subpath. This is the feature of <strong>subresource</strong>.</p>

<p>How to know whether <code>status</code> subresource enabled or not:</p>

<p>Check CRD yaml:</p>

<pre><code>$ kubectl get crds/foos.try.com -o yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: foos.try.com
spec:
  group: try.com
  version: v1alpha1
  scope: Namespaced
  subresources:
    status: {}
  names:
    plural: foos
    singular: foo
    kind: Foo
</code></pre>

<p>If CRD has following field under <code>spec</code>, then <code>status</code> subresource is enabled.</p>

<pre><code>subresources:
  status: {}
</code></pre>
