Appendix B. Advanced configurations for kind
This appendix shows you how to set up your kind cluster in a way that will allow you to follow along with some of the advanced configurations, such as with Gateway API, CRDs, and other networking configuration. The only prerequisites for these configuration are having Helm and Kustomize installed with your kubectl command-line tool.
B.1 Exposing a port in kind
As we have already created a kind cluster in Appendix A, I will assume you already know how to create a config file. The following example creates a single-node kind cluster with a label applied to a node as well as port 80 exposed. We’ll create a config2.yaml file, similar to how we created one in Appendix A, but we’ll add a few extra lines. Let’s create the cluster config file named config2.yaml by copying and pasting the following into your terminal (for macOS and Linux only):
cat <<EOF | tee config2.yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane extraPortMappings: - containerPort: 80 hostPort: 80 kubeadmConfigPatches: - | kind: InitConfiguration nodeRegistration: kubeletExtraArgs: node-labels: "ingress-ready=true" EOF
Note for Windows users: Use the following command instead: