英文:
Not able to add ipv6 type Load Balancer IP in kubernetes service
问题
以下是您提供的内容的翻译:
我在使用GKE,并尝试使用IPv6地址公开一个应用程序。
这是我的service.yaml文件:
apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/neg: '{"ingress":true}'
  labels:
    run: ubuntu
  name: ubuntu
  namespace: default
spec:
  loadBalancerIP: "<ipv6-address>"
  ipFamilies:
  - IPv6
  ipFamilyPolicy: SingleStack
  ports:
  - nodePort: 30783
    port: 5000
    protocol: TCP
    targetPort: 5001
  selector:
    run: ubuntu
  sessionAffinity: None
  type: LoadBalancer
这是我的gcloud地址列表:
deletable-pzk-reg-ip2-6 <ipv6-address>/96 EXTERNAL us-central1 pzksubnet1 RESERVED
我遇到了以下错误:
Warning SyncLoadBalancerFailed 13s (x6 over 2m49s) service-controller Error syncing load balancer: failed to ensure load balancer: requested ip "<ipv6-address>" is neither static nor assigned to the LB
请帮助我进行调试。
英文:
I'm on GKE and I'm trying to expose one application using IPV6 address.
This is my service.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/neg: '{"ingress":true}'
  labels:
    run: ubuntu
  name: ubuntu
  namespace: default
spec:
  loadBalancerIP: "<ipv6-address>"
  ipFamilies:
  - IPv6
  ipFamilyPolicy: SingleStack
  ports:
  - nodePort: 30783
    port: 5000
    protocol: TCP
    targetPort: 5001
  selector:
    run: ubuntu
  sessionAffinity: None
  type: LoadBalancer
This is my gcloud address list
deletable-pzk-reg-ip2-6           <ipv6-address>/96  EXTERNAL                    us-central1  pzksubnet1  RESERVED
I'm getting this error
  Warning  SyncLoadBalancerFailed  13s (x6 over 2m49s)  service-controller  Error syncing load balancer: failed to ensure load balancer: requested ip "<ipv6-address>" is neither static nor assigned to the LB
Please help me in debugging this.
答案1
得分: 1
以下故障排除步骤可帮助您解决问题:
- 
IPv6仅适用于HTTP、SSL代理和TCP代理,请确保您正在使用其中之一。
 - 
以下文档描述了创建Ingress资源的过程。
 
- 
使用以下命令保留区域性外部IPv6地址。
- gcloud compute addresses create <your-ipv6-address-name> --global --ip-version=IPv6 - 
在YAML文件中使用注释指定全局IP地址:
kubernetes.io/ingress.global-static-ip-name: <your-ipv6-address-name> 
apiVersion: v1
kind: Servicemetadata:
  name: my-lb-service
spec:
  type: LoadBalancer
  loadBalancerIP: <ip>
附上一篇由John Hanley撰写的博客HTTP on Load Balancer and IPv6供您参考。
英文:
Below troubleshooting steps can help you to resolve your issue:
- 
IPv6 is only for HTTP, SSL Proxy and TCP proxy and make sure you are using one of them.
 - 
The following documentation describes creation of an Ingress resource.
 
- 
Using the following reserve a regional external IPv6 address.
- gcloud compute addresses create <your-ipv6-address-name> --global --ip-version=IPv6 - 
Specify the global ip address in the YAML file using the annotation:
kubernetes.io/ingress.global-static-ip-name: <your-ipv6-address-name> 
- If you want to use load balancer check the Load balancer parameters, example: After reserving the static IP use it as loadBalancedIP in yaml, the load balancer will be created.
 
apiVersion: v1
kind: Servicemetadata:
  name: my-lb-service
spec:
  type: LoadBalancer
  loadBalancerIP: <ip>
Attaching a blog HTTP on Load Balancer and IPv6 authored by John Hanley for your reference.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论