<p>I have tried defining <code>LoadBalancer</code> in my service type and creating a deployment for it with 3 replicas:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: springboot-postgres-k8s
  labels:
    name: springboot-postgres-k8s
spec:
  ports: # ...
  selector: # type: ...
  type: LoadBalancer # &lt;=====

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: springboot-postgres-k8s
spec:
  selector:
    matchLabels:
      app: springboot-postgres-k8s
  replicas: 3 # &lt;=====
  template: # ...
</code></pre>
<p>This starts up three pod and a load balancer which successfully load balances request among these three pods.</p>
<p>I want to know if k8s allows to manually autoscale the pods. That is if my cluster with 3 replicas + a load balancer is up and running, how can I manually increase replicas and still make the existing load balancer to scale across all 4 replicas (3 old and one newly created)?</p>
<p>Do I have to run (<a href="https://www.containiq.com/post/kubectl-scale#2" rel="nofollow noreferrer">ref1</a> <a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_scale/" rel="nofollow noreferrer">ref2</a>):</p>
<pre><code>kubectl scale --current-replicas=3 --replicas=4 deployment/springboot-postgres-k8s
</code></pre>
<p><strong>Q1.</strong> Will above command notify existing load balancer of newly created pod?</p>
<p>or I have to run following (as specified in ref2)</p>
<pre><code>kubectl scale --replicas=4 -f foo.yaml
</code></pre>
<p><strong>Q2.</strong> Will above command notify existing load balancer of newly created pod?<br />
<strong>Q3.</strong> What if my foo.yaml contains both service and deployment definition?</p>

MsA
<p>Yes its allows manual autoscale.</p>
<p>When you create a service in Kubernetes, k8s automatically creates <strong>kind: Endpoints</strong> type resource(s) for your pods with a matching label selector. This resource referenced by a Service to define which Pods the traffic can be sent to and periodically updated by the k8s when pods are created or deleted.</p>
<p>So regardless of the creation time of resources, k8s will handle the update and pods will be able to receive traffic from loadbalancer.</p>
