- Create your kind cluster (suit yourself https://kind.sigs.k8s.io/docs/user/configuration/)
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
| cd $GOPATH/src/k8s.io/kubernetes | |
| make WHAT="test/e2e/e2e.test vendor/github.com/onsi/ginkgo/ginkgo" | |
| # export KUBECONFIG=${HOME}/kind.conf | |
| export GINKGO_PARALLEL=y | |
| export KUBERNETES_CONFORMANCE_TEST='y' | |
| export KUBE_CONTAINER_RUNTIME=remote |
cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
Deploy a service with endpoints using hostNetwork: true
kubectl apply -f https://gist.githubusercontent.com/aojea/ee37cc43f2513afbf5918c7ffddd807d/raw/b01b800b333539044d9c81eab232edab9fd5718a/svc-hostnet.yml
Create an UDP service too, using that deployment
Run a container to probe the service:
KIND runs Kubernetes cluster in Docker, and leverages Docker networking for all the network features: port mapping, IPv6, containers connectivity, etc.
KIND uses a docker user defined network.
It creates a bridge named kind
| # three node (two workers) cluster config | |
| kind: Cluster | |
| apiVersion: kind.x-k8s.io/v1alpha4 | |
| networking: | |
| serviceSubnet: 10.96.0.0/16 | |
| ipFamily: ipv4 | |
| nodes: | |
| - role: control-plane | |
| - role: worker | |
| - role: worker |
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| creationTimestamp: null | |
| labels: | |
| component: etcdclient | |
| tier: debug | |
| name: etcdclient | |
| namespace: default | |
| spec: |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: hostnet-deployment | |
| labels: | |
| app: MyApp | |
| spec: | |
| replicas: 3 | |
| selector: | |
| matchLabels: |
| ARG IMAGE=kindest/node | |
| ARG VERSION=1.19 | |
| ARG MINOR=1 | |
| ARG OS=xUbuntu_20.04 | |
| FROM ${IMAGE}:v${VERSION}.${MINOR} | |
| ARG VERSION | |
| ARG OS |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: server-deployment | |
| labels: | |
| app: MyApp | |
| spec: | |
| replicas: 2 | |
| selector: | |
| matchLabels: |