Kubectl expose --type = LoadBalancer not working

I ran into some problems when getting an external ip address after posting the following json object (excluding variables):

$json= '{ "kind": "Service", "apiVersion": "v1", "metadata": { "name": "" }, "spec": { "ports": [{ "port": 80, "targetPort": 80 }], "selector": { "app": "" }, "type": "LoadBalancer" } }'; 

The service is created, but no external ip is provided.

Unable to determine where the problem is located, I started installing a clean copy of the tunnels (and the cluster that it is defined for installation) using the following command provided in the documentation (V1 kubernetes / examples / simple-nginx.md)

 curl -sS https://get.k8s.io | bash 

This, of course, automatically sets things up. Then I ran the following commands to test the operation of the LoadBalancer function:

 kubectl run my-nginx --image=nginx --replicas=2 --port=80 

After running kubectl get pods to confirm that they were ready, I published a service:

 kubectl expose rc my-nginx --port=80 --type=LoadBalancer 

Then I started kubectl get service in the last few minutes and no public ip is provided.

Perhaps this is not so?

EDIT

 kubectl get services NAME LABELS SELECTOR IP(S) PORT(S) kubernetes component=apiserver,provider=kubernetes <none> 10.0.0.1 443/TCP my-nginx run=my-nginx run=my-nginx 10.0.136.163 80/TCP kubectl get service my-nginx -o yaml apiVersion: v1 kind: Service metadata: creationTimestamp: 2015-08-11T11:44:02Z labels: run: my-nginx name: my-nginx namespace: default resourceVersion: "1795" selfLink: /api/v1/namespaces/default/services/my-nginx uid: 434751be-401e-11e5-a219-42010af0da43 spec: clusterIP: 10.x.xxx.xxx ports: - nodePort: 31146 port: 80 protocol: TCP targetPort: 80 selector: run: my-nginx sessionAffinity: None type: LoadBalancer status: loadBalancer: {} 

After starting (thanks to GameScripting):

 kubectl describe service my-nginx 

I saw the following error:

 FirstSeen LastSeen Count From SubobjectPath Reason Message Tue, 11 Aug 2015 14:00:00 +0200 Tue, 11 Aug 2015 14:02:41 +0200 9 {service-controller } creating loadbalancer failed failed to create external load balancer for service default/my-nginx: googleapi: Error 403: Quota 'FORWARDING_RULES' exceeded. Limit: 15.0 
+4
source share
1 answer

After manually deleting the forwarding rules in the "Networking-> Load Balancing-> network load balancing" section (or you can use gcloud compute forwarding-rules delete ), I was able to get the public IP address again. Forwarders seem to be removed and have reached the limit. It is strange that when I ran Kubectl stop service , it deleted the forwarding rule for me.

+4
source

All Articles