How to set up an IPv6 address with Google Kubernetes Load Balancer

1k views Asked by At

I want to set up an IPv6 address to service on the GKE cluster. The main reason I want to do that is I am setting up a Google Managed Certificate and connecting the service to a Domain name. The certificate requires type A and type AAAA records to be configured. I reserved an IPv6 address on VPC Network, but there is no way to assign it. Even tried editing the YAML to support IPv6 family, but it just shows the error

The Service "made-up-name" is invalid: spec.ipFamilies[1]: Invalid value: []string(nil): ipfamily IPv6 is not configured on cluster

Here is my YAML file as of now

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-stream-server-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-stream-server
  template:
    metadata:
      labels:
        app: my-stream-server
    spec:
      containers:
        - name: my-stream-server
          image: gcr.io/reddo-346118/my-stream-server
---
apiVersion: v1
kind: Service
metadata:
  name: my-stream-server-srv
spec:
  ipFamilyPolicy: PreferDualStack
  ipFamilies:
  - IPv4
  - IPv6
  selector:
    app: my-stream-server
  ports:
    - name: http
      protocol: TCP
      port: 8000
      targetPort: 8000
    - name: rtmp
      protocol: TCP
      port: 1935
      targetPort: 1935
---
kind: Service
apiVersion: v1
metadata:
  name: my-stream-server-rtmp
spec:
  type: LoadBalancer 
  externalTrafficPolicy: Cluster  
  ports:
  - name: rtmp
    port: 1935
    targetPort: 1935
    protocol: TCP
  selector:
    app: my-stream-server
1

There are 1 answers

2
Gari Singh On

GKE does not currently support IPv6 for pods or services. You can, however, assign an IPv6 address to an external HTTP(S) load balancer. You won't be able to do this for Service of type LoadBalancer. You'll need to create an Ingress resource instead as Ingress creates an HTTP(S) load balancer which does support IPv6.

Support for dual stack on GKE is currently targeted for late 2Q 2022.