<p>When I run <code>kubectl get svc -n kube-system</code> it tells me:</p>

<pre><code>NAME       TYPE        CLUSTER-IP   EXTERNAL-IP    PORT(S)        AGE
kube-dns   ClusterIP   xx.xx.xx.xx   &lt;none&gt;       53/UDP,53/TCP   13h
</code></pre>

<p>But when I try to <code>kubectl edit svc/kube-dns -n kube-system</code>:</p>

<blockquote>
  <p>error: services "kube-dns" is invalid</p>
  
  <p>A copy of your changes has been stored to "/tmp/kubectl-edit-4p5gn.yaml"</p>
  
  <p>error: Edit cancelled, no valid changes were saved.</p>
</blockquote>

<p>I am unable to change it to a LoadBalancer...any ideas?</p>

<p>I also tried to create a new kube-dns also but I am unable to get an external-ip; it stays stuck in pending state.</p>

<pre><code>kind: Service
metadata:
  name: kubedns-bkp
  namespace: kube-system
  labels:
    k8s-app: kube-dns
spec:
  type: LoadBalancer
  ports:
  - port: 53
    protocol: UDP
  selector:
    k8s-app: kube-dns
</code></pre>

<p><code>kubectl get svc -n kube-system</code> reports:</p>

<pre><code>NAME            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
kubedns-bkp     LoadBalancer   xx.xx.xx.xx     &lt;pending&gt;     53:32115/UDP    5h
</code></pre>

<p>Note: I have created k8s cluster with ELB integration, for other services I successfully get external IPs.</p>

Srinivasa Reddy
<p>So, two things here:</p>

<ol>
<li>As they advised you in the yaml validation errors that you chose not to share with us, one cannot change the <code>type:</code> of an existing <code>Service</code>; you have to create a new one, or delete the existing one and recreate it.</li>
<li>However, I would strongly, strongly, <em>strongly</em> advise against deleting the <code>kube-dns</code> <code>Service</code> -- you are more than welcome to create a new <code>Service</code> of <code>type: LoadBalancer</code> and point it at the same <code>selector:</code> as <code>kube-dns</code> is using. That way anyone who wishes to use the load balanced service can, but the things in the cluster who depend on <code>kube-dns</code> being a <code>ClusterIP</code> with (likely) that existing xx.xx.xx.xx value can continue as before.</li>
</ol>
