<p>I have made a docker image which contains my application. (a very basic application, without any database or file storage).</p>

<p>I have created an yml file which describes a service and a deployment for this image.</p>

<p>When i want to create or update this application, i type this commands:</p>

<pre><code>kubectl apply -f myapp.yml
kubectl rollout restart deployment/myapp-deployment
</code></pre>

<p>Everything works fine, the image is pulled and the pod are created while previous are terminated.</p>

<p>But i have a question about this command:</p>

<p>$ kubectl get services</p>

<pre><code>NAME      TYPE           CLUSTER-IP     EXTERNAL-IP                         PORT(S)        AGE
myapp     LoadBalancer   x.y.z.z        abcd.a_subdomainofmyk8sprovider     80:32146/TCP   179m
</code></pre>

<p>I can access to my application by typing in my browser</p>

<p><a href="http://abcd.asubdomainofmyk8sprovider/" rel="nofollow noreferrer">http://abcd.asubdomainofmyk8sprovider/</a></p>

<p>Everything works.
But i am wondering if the external ip can change when i am updating my application with rollout restart ?</p>

<p>I have tried several times: The IP did not changed, except one time, but this time, i have changed something in myapp.yml file</p>

<p>Thanks</p>

Bob5421
<p><code>ClusterIP</code> can not be changed, but External IP can.</p>

<p>Depending on where is running your cluster, you might lose the external IP forever; with cloud providers, for example, if you haven't reserved it previously.</p>

<p>You can edit the service and change the external IP, or change the service type, in which case it will lose it automatically, and change it back to <code>LoadBalancer</code> type, later on, with different IP address.</p>

<p>But to change the <code>ClusterIP</code> you have to delete the service. </p>
