• 文字サイズ変更
  • S
  • M
  • L
  • No : 812
  • 公開日時 : 2024/08/29 12:37
  • 印刷

インフィニットLBを利用したL4ロードバランサーを設定できますか?

回答

インフィニットLBを利用したL4ロードバランサーは、
コンテナコンソール上からは設定できません。YAMLでの設定が必要です。
 
■手順
1. 下記のsample.yamlを参考に、お客様任意のYAMLを準備してください。
2.準備したYAMLをコンテナコンソール上の
「YAMLをインポート(Import YAML)」からインポートするか、
別途作業用の環境から「kubectl apply -f $準備したYAML」を実行してください。

※下記のsampleでは、バックエンドとなるワークロードを "nginx"、
ロードバランサー名を "nginx-ilb"、labelを"app: nginx-ilb"としています。
 
sample.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx-ilb
  template:
    metadata:
      labels:
        app: nginx-ilb
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: ilb-nginx
  annotations:
    loadbalancer.idcfcloud.com/loadbalancer-class: "ilb"
spec:
  type: LoadBalancer
  selector:
    app: nginx-ilb
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: 80
annotationsで、 loadbalancer.idcfcloud.com/loadbalancer-class: "ilb" を
指定することで、ILBが利用されます。

アンケート:ご意見をお聞かせください

ご意見・ご感想をお寄せください お問い合わせを入力されましてもご返信はいたしかねます