Skip to content

Commit

Permalink
Minor improvements to Cluster Api book
Browse files Browse the repository at this point in the history
    1. Add a troubleshooting for CAPD when docker runs out of resources
    2. Document that `kubectl apply -f capi-quickstart.yaml` doesn't work (fix/debugging pending)
    3. Adds a tab in Tilt documentation for creating kind with docker settings (required for CAPD)
  • Loading branch information
rumshenoy committed May 27, 2021
1 parent 0e1629b commit 6bb567c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
27 changes: 26 additions & 1 deletion docs/book/src/developer/tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,35 @@ make envsubst

First, make sure you have a kind cluster and that your `KUBECONFIG` is set up correctly:

``` bash
{{#tabs name:"install-kind" tabs:">=v0.9.x, Docker infrastructure provider - CAPD"}}
{{#tab >=v0.9.x}}

```bash
kind create cluster
```

{{#/tab }}
{{#tab Docker infrastructure provider - CAPD}}

Run the following command to create a kind config file for allowing the Docker provider to access Docker on the host:

```bash
cat > kind-cluster-with-extramounts.yaml <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
EOF
```

Then follow the instruction for your kind version using `kind create cluster --config kind-cluster-with-extramounts.yaml`
to create the management cluster using the above file.

{{#/tab }}

### Create a tilt-settings.json file

Next, create a `tilt-settings.json` file and place it in your local copy of `cluster-api`. Here is an example:
Expand Down
7 changes: 6 additions & 1 deletion docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,12 @@ kubectl --kubeconfig=./capi-quickstart.kubeconfig get nodes
Delete workload cluster.
```bash
kubectl delete cluster capi-quickstart
```
```
<aside class="note warning">
Running `kubectl delete -f capi-quickstart.yaml` to delete clusters currently doesn't work and is being investigated.
</aside>
Delete management cluster
```bash
Expand Down
16 changes: 16 additions & 0 deletions docs/book/src/user/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,20 @@ For convenience, here is an example one-liner to do this post installation

```
kubectl get nodes --no-headers -l '!node-role.kubernetes.io/master' -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}' | xargs -I{} kubectl label node {} node-role.kubernetes.io/worker=''
```

## Cluster API with Docker

When provisioning workload clusters using Cluster API with Docker infrastructure,
the workload cluster might get stuck in a provisioning state if there are oprhaned Docker volumes or resources on your machine.
Docker volumes are not removed by default because they contain data, so if you stop a container sometimes the volume will hang around in your system.

The [docker system df](https://docs.docker.com/engine/reference/commandline/system_df/) command gives details about disk space consumed by Docker resources.
```
docker system df
```
The [docker volume prune](https://docs.docker.com/engine/reference/commandline/volume_prune/) command will remove all volumes that are not used by at least one container.
```
docker system prune --volumes
```

0 comments on commit 6bb567c

Please sign in to comment.