LoginSignup
3
0

More than 5 years have passed since last update.

GKEでロードバランサのIPを指定するとき、グローバルに属するIPアドレスリソースは使用できないので注意

Last updated at Posted at 2018-01-20

GKEでKubernetesを使用する時、よくtype: LoadBalancerを使用すると思います。
以下のようにloadBalancerIPを使用する場合、注意が必要です。

service.yaml
apiVersion: v1
kind: Service
metadata:
  name: hoge
  labels:
    app: hoge
spec:
  ports:
    - port: 80
  selector:
    app: hoge
    tier: frontend
    environment : stage
  type: LoadBalancer
  loadBalancerIP: xxx.xxx.xxx.xxx

xxx.xxx.xxx.xxxは事前に取得した静的アドレスである必要がありますが、静的アドレスのタイプが「グローバル」の場合は以下のエラーが出力されます。

Error creating load balancer (will retry): Failed to create load balancer for service default/eccube: requested ip xxx.xxx.xxx.xxx is neither static nor assigned to LB xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(default/hoge)

リージョン指定するタイプの静的IPを確保しましょう。
なお、Serviceで作成されるTCPロードバランサではなく、Ingressで作成されるHTTP(S)ロードバランサはグローバルに属するIPアドレスが使用できます。

3
0
1

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
0