1

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 Answers1

2

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.

Thanatos
  • 42,585
  • 14
  • 91
  • 146
Gari Singh
  • 11,418
  • 2
  • 18
  • 41
  • I tried doing that as well. In my load balancer spec, I tried adding it in the load balancer as well. Got an error showing it is not assigned. kind: Service apiVersion: v1 metadata: name: reddo-stream-server-rtmp spec: type: LoadBalancer externalTrafficPolicy: Cluster ipFamilyPolicy: PreferDualStack ipFamilies: - "IPv4" - "IPv6" ports: - name: rtmp port: 1935 targetPort: 1935 protocol: TCP selector: app: reddo-stream-server – Nabeegh Ahmed May 24 '22 at 07:55
  • Edited my answer - IPv6 with GKE works with Ingress but bot with Service type LoadBalancer – Gari Singh May 25 '22 at 08:20