|
| 1 | +--- |
| 2 | +see: |
| 3 | + - name: Docker |
| 4 | + link: /tools/docker |
| 5 | + - name: All Configuration Options |
| 6 | + link: https://kind.sigs.k8s.io/docs/user/configuration |
| 7 | +--- |
| 8 | + |
| 9 | +# Kind |
| 10 | + |
| 11 | +Kind *(Kubernetes IN Docker)* is a tool for running local Kubernetes clusters using |
| 12 | +Docker container as *nodes*. |
| 13 | +It is primarily used for testing Kubernetes itself, or for developing Kubernetes |
| 14 | +applications in a local environment. |
| 15 | + |
| 16 | +::: warn |
| 17 | +The documentation below assumes you are **not** using [`sysbox`][sysbox] as you Docker |
| 18 | +runtime. |
| 19 | +::: |
| 20 | + |
| 21 | +## Custom Configuration |
| 22 | + |
| 23 | +Custom configuration can be stored in a `yaml` file of your choice and used with |
| 24 | +the `kind create cluster --config my-config.yaml`. |
| 25 | + |
| 26 | +### Cluster IP |
| 27 | + |
| 28 | +For security reasons, a *kind* cluster is configured by default to be accessible at |
| 29 | +`127.0.0.1`. |
| 30 | +When using a remote Docker engine, it's necessary to adjust this setting, as the IP |
| 31 | +address resolves to the internal address of the current *workspace*. |
| 32 | + |
| 33 | +To make the cluster accessible on the network of the running host, change the listening |
| 34 | +address to `0.0.0.0` *(or to a specific host IP)*: |
| 35 | + |
| 36 | +```yaml |
| 37 | +kind: Cluster |
| 38 | +apiVersion: kind.x-k8s.io/v1alpha4 |
| 39 | +networking: |
| 40 | + apiServerAddress: 0.0.0.0 |
| 41 | +# ... more custom configurations follow |
| 42 | +``` |
| 43 | + |
| 44 | +Once deployed, you will need to update the `KUBECONFIG` to communicate with the API server |
| 45 | +using the host IP for the `cluster.server` address. |
| 46 | + |
| 47 | +```yaml |
| 48 | +apiVersion: v1 |
| 49 | +clusters: |
| 50 | +- cluster: |
| 51 | + server: https://192.168.1.120:6443 |
| 52 | + certificate-authority-data: DATA+OMITTED |
| 53 | + name: created-by-kind |
| 54 | +# ... more custom configurations follow |
| 55 | +``` |
| 56 | + |
| 57 | +[sysbox]: /tools/docker#_1-use-sysbox-suggested |
0 commit comments