Skip to content

Commit

Permalink
Merge pull request #4385 from stmcginnis/tilt-dev
Browse files Browse the repository at this point in the history
📖  Update tilt development instructions
  • Loading branch information
k8s-ci-robot authored Mar 29, 2021
2 parents 96ab917 + 8d5fb93 commit b5f22fe
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 40 deletions.
21 changes: 18 additions & 3 deletions docs/book/src/developer/tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workflow that offers easy deployments and rapid iterative builds.
1. [kustomize](https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md)
standalone (`kubectl kustomize` does not work because it is missing
some features of kustomize v3)
1. [Tilt](https://docs.tilt.dev/install.html) v0.12.0 or newer
1. [Tilt](https://docs.tilt.dev/install.html) v0.16.0 or newer
1. [envsubst](https://github.com/drone/envsubst) or similar to handle
clusterctl var replacement. Note: drone/envsubst releases v1.0.2 and
earlier do not have the binary packaged under cmd/envsubst. It is
Expand Down Expand Up @@ -186,8 +186,23 @@ tilt up
This will open the command-line HUD as well as a web browser interface. You can monitor Tilt's status in either
location. After a brief amount of time, you should have a running development environment, and you should now be able to
create a cluster. Please see the [Usage section in the Quick
Start](https://cluster-api.sigs.k8s.io/user/quick-start.html#usage) for more information on creating workload clusters.
create a cluster. There are [example worker cluster
configs](https://github.com/kubernetes-sigs/cluster-api/tree/master/test/infrastructure/docker/examples) available.
These can be customized for your specific needs.
<aside class="note">
<h1>Use of clusterctl</h1>
When the worker cluster has been created using tilt, `clusterctl` should not be used for management
operations; this is because tilt doesn't initialize providers on the management cluster like clusterctl init does, so
some of the clusterctl commands like clusterctl config won't work.
This limitation is an acceptable trade-off while executing fast dev-test iterations on controllers logic. If instead
you are interested in testing clusterctl workflows, you should refer to the
[clusterctl developer instructions](https://cluster-api.sigs.k8s.io/clusterctl/developers.html).
</aside>
## Available providers
Expand Down
24 changes: 12 additions & 12 deletions test/infrastructure/docker/examples/machine-pool.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Creates a cluster with one control-plane node and one worker node
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: Cluster
metadata:
name: my-cluster
Expand All @@ -12,17 +12,17 @@ spec:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: cluster.local
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
name: controlplane
namespace: default
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
name: my-cluster
namespace: default
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
metadata:
name: controlplane
Expand All @@ -31,7 +31,7 @@ spec:
replicas: 1
version: v1.19.1
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
name: controlplane
namespace: default
Expand All @@ -45,13 +45,13 @@ spec:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
metadata:
name: my-cluster
namespace: default
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
metadata:
name: controlplane
Expand All @@ -60,7 +60,7 @@ spec:
template:
spec: {}
---
apiVersion: exp.cluster.x-k8s.io/v1alpha3
apiVersion: exp.cluster.x-k8s.io/v1alpha4
kind: MachinePool
metadata:
name: worker-mp-0
Expand All @@ -72,25 +72,25 @@ spec:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfig
name: worker-mp-0-config
namespace: default
clusterName: my-cluster
infrastructureRef:
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachinePool
name: worker-dmp-0
namespace: default
version: v1.19.1
---
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: exp.infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachinePool
metadata:
name: worker-dmp-0
namespace: default
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfig
metadata:
name: worker-mp-0-config
Expand Down
26 changes: 13 additions & 13 deletions test/infrastructure/docker/examples/simple-cluster-without-kcp.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Creates a cluster with one control-plane node and one worker node
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
metadata:
name: my-cluster
namespace: default
---
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: Cluster
metadata:
name: my-cluster
Expand All @@ -18,18 +18,18 @@ spec:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
name: my-cluster
namespace: default
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachine
metadata:
name: controlplane-0
namespace: default
---
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: Machine
metadata:
labels:
Expand All @@ -42,17 +42,17 @@ spec:
clusterName: my-cluster
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfig
name: controlplane-0-config
namespace: default
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachine
name: controlplane-0
namespace: default
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfig
metadata:
name: controlplane-0-config
Expand All @@ -67,7 +67,7 @@ spec:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
metadata:
name: worker
Expand All @@ -76,7 +76,7 @@ spec:
template:
spec: {}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
metadata:
name: worker
Expand All @@ -88,7 +88,7 @@ spec:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
---
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: MachineDeployment
metadata:
name: worker-md-0
Expand All @@ -104,10 +104,10 @@ spec:
clusterName: my-cluster
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
name: worker
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
name: worker
24 changes: 12 additions & 12 deletions test/infrastructure/docker/examples/simple-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Creates a cluster with one control-plane node and one worker node
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
metadata:
name: my-cluster
namespace: default
---
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: Cluster
metadata:
name: my-cluster
Expand All @@ -18,17 +18,17 @@ spec:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
name: controlplane
namespace: default
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerCluster
name: my-cluster
namespace: default
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
metadata:
name: controlplane
Expand All @@ -37,7 +37,7 @@ spec:
template:
spec: {}
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
metadata:
name: controlplane
Expand All @@ -46,7 +46,7 @@ spec:
replicas: 1
version: v1.19.1
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
name: controlplane
namespace: default
Expand All @@ -65,7 +65,7 @@ spec:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
metadata:
name: worker
Expand All @@ -74,7 +74,7 @@ spec:
template:
spec: {}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
metadata:
name: worker
Expand All @@ -86,7 +86,7 @@ spec:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
---
apiVersion: cluster.x-k8s.io/v1alpha3
apiVersion: cluster.x-k8s.io/v1alpha4
kind: MachineDeployment
metadata:
name: worker-md-0
Expand All @@ -102,10 +102,10 @@ spec:
clusterName: my-cluster
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
name: worker
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: DockerMachineTemplate
name: worker

0 comments on commit b5f22fe

Please sign in to comment.