How to use NodePort with kind?

Kind cluster configuration needs to be like below

apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 30000
    hostPort: 30000
    listenAddress: "0.0.0.0" # Optional, defaults to "0.0.0.0"
    protocol: tcp # Optional, defaults to tcp
- role: worker

This file is then passed to your creation command as kind create cluster --config=config.yaml (according to docs).

Leave a Comment