<p>I've created Hyper-V machine and tried to deploy Sawtooth on Minikube using Sawtooth YAML file :
<a href="https://sawtooth.hyperledger.org/docs/core/nightly/master/app_developers_guide/sawtooth-kubernetes-default.yaml" rel="noreferrer">https://sawtooth.hyperledger.org/docs/core/nightly/master/app_developers_guide/sawtooth-kubernetes-default.yaml</a></p>

<p>I changed the apiVersion i.e. <code>apiVersion: extensions/v1beta1</code> to  <code>apiVersion: apps/v1</code>, though I have launched Minikube in Kubernetes v1.17.0 using this command </p>

<blockquote>
  <p>minikube start --kubernetes-version v1.17.0</p>
</blockquote>

<p>After that I can't deploy the server. Command is </p>

<blockquote>
  <p>kubectl apply -f sawtooth-kubernetes-default.yaml --validate=false</p>
</blockquote>

<p>It shows an error with "sawtooth-0" is invalid.</p>

<p><a href="https://i.stack.imgur.com/cHCaV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cHCaV.png" alt="enter image description here"></a></p>

<pre><code>---
apiVersion: v1
kind: List

items:

- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: sawtooth-0
  spec:
    replicas: 1
    selector:
      matchLabels:
        name: sawtooth-0
    template:
      metadata:
        labels:
          name: sawtooth-0
      spec:
        containers:
          - name: sawtooth-devmode-engine
            image: hyperledger/sawtooth-devmode-engine-rust:chime
            command:
              - bash
            args:
              - -c
              - "devmode-engine-rust -C tcp://$HOSTNAME:5050"

          - name: sawtooth-settings-tp
            image: hyperledger/sawtooth-settings-tp:chime
            command:
              - bash
            args:
              - -c
              - "settings-tp -vv -C tcp://$HOSTNAME:4004"

          - name: sawtooth-intkey-tp-python
            image: hyperledger/sawtooth-intkey-tp-python:chime
            command:
              - bash
            args:
              - -c
              - "intkey-tp-python -vv -C tcp://$HOSTNAME:4004"

          - name: sawtooth-xo-tp-python
            image: hyperledger/sawtooth-xo-tp-python:chime
            command:
              - bash
            args:
              - -c
              - "xo-tp-python -vv -C tcp://$HOSTNAME:4004"

          - name: sawtooth-validator
            image: hyperledger/sawtooth-validator:chime
            ports:
              - name: tp
                containerPort: 4004
              - name: consensus
                containerPort: 5050
              - name: validators
                containerPort: 8800
            command:
              - bash
            args:
              - -c
              - "sawadm keygen \
              &amp;&amp; sawtooth keygen my_key \
              &amp;&amp; sawset genesis -k /root/.sawtooth/keys/my_key.priv \
              &amp;&amp; sawset proposal create \
                -k /root/.sawtooth/keys/my_key.priv \
                sawtooth.consensus.algorithm.name=Devmode \
                sawtooth.consensus.algorithm.version=0.1 \
                -o config.batch \
              &amp;&amp; sawadm genesis config-genesis.batch config.batch \
              &amp;&amp; sawtooth-validator -vv \
                  --endpoint tcp://$SAWTOOTH_0_SERVICE_HOST:8800 \
                  --bind component:tcp://eth0:4004 \
                  --bind consensus:tcp://eth0:5050 \
                  --bind network:tcp://eth0:8800"

          - name: sawtooth-rest-api
            image: hyperledger/sawtooth-rest-api:chime
            ports:
              - name: api
                containerPort: 8008
            command:
              - bash
            args:
              - -c
              - "sawtooth-rest-api -C tcp://$HOSTNAME:4004"

          - name: sawtooth-shell
            image: hyperledger/sawtooth-shell:chime
            command:
              - bash
            args:
              - -c
              - "sawtooth keygen &amp;&amp; tail -f /dev/null"

- apiVersion: apps/v1
  kind: Service
  metadata:
    name: sawtooth-0
  spec:
    type: ClusterIP
    selector:
      name: sawtooth-0
    ports:
      - name: "4004"
        protocol: TCP
        port: 4004
        targetPort: 4004
      - name: "5050"
        protocol: TCP
        port: 5050
        targetPort: 5050
      - name: "8008"
        protocol: TCP
        port: 8008
        targetPort: 8008
      - name: "8800"
        protocol: TCP
        port: 8800
        targetPort: 8800
</code></pre>

debo karmakar
<p>You need to fix your deployment <code>yaml</code> file. As you can see from your error message, the <code>Deployment.spec.selector</code> field can't be empty.</p>
<p>Update the <code>yaml</code> (i.e. add <code>spec.selector</code>) as shown in below:</p>
<pre class="lang-yaml prettyprint-override"><code>  spec:
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: sawtooth-0
    template:
      metadata:
        labels:
          app.kubernetes.io/name: sawtooth-0
</code></pre>
<ul>
<li>Why <code>selector</code> field is important?</li>
</ul>
<p>The <code>selector</code> field defines how the Deployment finds which Pods to manage. In this case, you simply select a label that is defined in the Pod template (<code>app.kubernetes.io/name: sawtooth-0</code>). However, more sophisticated selection rules are possible, as long as the Pod template itself satisfies the rule.</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="noreferrer"> Reference </a></li>
</ul>
<p><strong>Update:</strong></p>
<p>The <code>apiVersion</code> for k8s service is <code>v1</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>- apiVersion: v1 # Update here
  kind: Service
  metadata:
    app.kubernetes.io/name: sawtooth-0
  spec:
    type: ClusterIP
    selector:
      app.kubernetes.io/name: sawtooth-0
    ... ... ...
</code></pre>
