<p>I am trying to run Replica Set.</p>
<p>I have this yaml file</p>
<pre><code>apiVersion: extensions/v1beta1
kind: ReplicaSet
metadata:
  name: nginxrs
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.12-alpine
        ports:
        - containerPort: 80   
</code></pre>
<p>This file is called <code>nginx-rs.yaml</code></p>
<p>Next, In terminal use command</p>
<pre><code> kubectl apply -f nginx-rs.yaml
</code></pre>
<p>And I have this error</p>
<pre><code>error: unable to recognize &quot;nginx-rs.yaml&quot;: no matches for kind &quot;ReplicaSet&quot; in version &quot;extensions/v1beta1&quot;
</code></pre>
<p>Thanks for pointing out where did I go wrong?</p>

merc-angel
<p>In <a href="https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/" rel="noreferrer">kubernetes 1.16</a> replicaset was moved to <code>apps/v1</code> <code>apiVersion</code> from <code>extensions/v1beta1</code>. Hence the yaml should be as below</p>
<pre><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: nginxrs
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.12-alpine
        ports:
        - containerPort: 80   
</code></pre>
