LoginSignup
3

More than 5 years have passed since last update.

GKEでEXTERNAL-IPがpendingのとき

Last updated at Posted at 2018-03-27

状態

54.65.10.114 は qiita さんのIpです。
auth-service54.65.10.114になってほしいが <pending>なってしまう。

$ kubectl get services

NAME                CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGE
kubernetes          10.31.240.1     <none>          443/TCP          96d
api-service    10.31.251.111   54.65.10.114   8080:32075/TCP   1h
auth-service   10.31.255.158   <pending>   8081:31613/TCP   16m

サービスの詳細を確認

pendingになっているサービスの確認

kubectl describe service api-service

Events:
  FirstSeen     LastSeen        Count   From                    SubObjectPath   Type            Reason                          Message
  ---------     --------        -----   ----                    -------------   --------        ------                          -------
  14m           5m              5       service-controller                      Warning         CreatingLoadBalancerFailed      Error creating load balancer (will retry): Failed to create load balancer for service default/api-service: failed to create forwarding rule <ruleのハッシュ>: googleapi: Error 400: Invalid value for field 'resource.IPAddress': 'your Ipアドレス'. Specified IP address is in-use and would result in a conflict., invali

(横長)

原因

転送ルールが同じもの存在し、設定できない状態。

解決策

既存の転送ルールを削除すればよいので

GCPのコンソール -> 外部 IP アドレス

該当のIPアドレスの転送で上のエラーが起きているルールと同じもを削除する。

$kubectl get services

NAME                CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGE
kubernetes          10.31.240.1     <none>          443/TCP          96d
api-service    10.31.251.111   54.65.10.114   8080:32075/TCP   1h
auth-service   10.31.255.158   54.65.10.114   8081:31613/TCP   16m

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3