<p>I have deployed a Service into a kubernetes cluster and it looks like so:</p>

<pre><code>$ kubectl get svc my-service
NAME               CLUSTER_IP       EXTERNAL_IP   PORT(S)    SELECTOR                AGE
my-service         192.168.202.23   &lt;none&gt;        8080/TCP   name=my-service         38d
</code></pre>

<p>The spec part of YAML config looks like so:</p>

<pre><code>"spec": {
        "ports": [
            {
                "name": "http-port",
                "protocol": "TCP",
                "port": 8080,
                "targetPort": 8080
            }
        ],
        "selector": {
            "name": "my-service"
        },
        "clusterIP": "192.168.202.23",
        "type": "ClusterIP",
        "sessionAffinity": "None"
    },
    "status": {
        "loadBalancer": {}
    }
}
</code></pre>

<p>Now, I want to expose this service to be externally accessible using LoadBalancer. Using kubectl expose service gives an error like so:</p>

<pre><code>$ kubectl expose service my-service --type="LoadBalancer"
Error from server: services "my-service" already exists
</code></pre>

<p>Is it not possible to 'edit' existing deployed service and make it externally accessible?</p>

<p>The type of the service that you have created is <code>ClusterIP</code> which is not visible outside the cluster. If you edit the service and change the <code>type</code> field to either <code>NodePort</code>, or <code>LoadBalancer</code>, it would expose it.</p>

<p>Documentation on what those service types are and what they mean is at:
<a href="http://kubernetes.io/docs/user-guide/services/#publishing-services---service-types" rel="noreferrer">http://kubernetes.io/docs/user-guide/services/#publishing-services---service-types</a></p>
