<p>We are using RC to run our workload and want to migrate to Deployment. Is there a way to do that with out causing any impact to the running workload. I mean, can we move these running pods under Deployment? </p>

<p>Like, @matthew-l-daniel answered, the answer is yes. But I am more than 80% certain about it. Because I have tested it</p>

<p>Now whats the process we need to follow</p>

<p>Lets say I have a ReplicationController.</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx
spec:
  replicas: 3
  selector:
    app: nginx
  template:
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
</code></pre>

<p><strong>Question:</strong> can we move these running pods under Deployment?</p>

<p>Lets follow these step to see if we can.</p>

<p><strong>Step 1:</strong> 
Delete this RC with <code>--cascade=false</code>. This will leave Pods.</p>

<p><strong>Step 2:</strong>
Create ReplicaSet first, with same label as ReplicationController</p>

<pre><code>apiVersion: apps/v1beta2
kind: ReplicaSet
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      ---
</code></pre>

<p>So, now these Pods are under ReplicaSet.</p>

<p><strong>Step 3:</strong>
Create Deployment Now with same label.</p>

<pre><code>apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      ----
</code></pre>

<p>And Deployment will find one ReplicaSet already exists and our job is done.</p>

<p>Now we can check increasing <code>replicas</code> to see if it works.</p>

<p>And It works.</p>

<p><strong>Which way It doesn't work</strong></p>

<p>After deleting ReplicationController, do not create Deployment directly. This will <strong>not work</strong>. Because, Deployment will find no ReplicaSet, and will create new one with additional label which will not match with your existing Pods</p>
