-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,99 @@ The approach most Cluster API projects is using [a `Makefile` that uses `sed` to | |
|
||
## Deployment | ||
|
||
### Cluster API | ||
|
||
Before you can deploy the infrastructure controller, you'll need to deploy Cluster API itself. | ||
|
||
You can clone `cluster-api` for the latest version, or just [use a precompiled manifest][install]. | ||
You can [use a precompiled manifest][install], or clone [`cluster-api`][capi] and apply its manifests using `kustomize`. | ||
|
||
``` shell | ||
cd cluster-api | ||
kustomize build config/default | kubectl apply -f- | ||
``` | ||
|
||
Check the status of the manager to make sure it's running properly | ||
|
||
```shell | ||
$ kubectl describe -n capi-system pod | grep -A 5 Conditions | ||
Conditions: | ||
Type Status | ||
Initialized True | ||
Ready True | ||
ContainersReady True | ||
PodScheduled True | ||
``` | ||
|
||
[install]: https://cluster-api.sigs.k8s.io/tasks/installation.html#install-cluster-api | ||
|
||
### Your provider | ||
|
||
Now you can apply your provider as well: | ||
|
||
``` | ||
$ cd cluster-api-provider-mailgun | ||
$ kustomize build config/default | envsubst | kubectl apply -f- | ||
$ kubectl describe -n cluster-api-provider-mailgun-system pod | grep -A 5 Conditions | ||
Conditions: | ||
Type Status | ||
Initialized True | ||
Ready True | ||
ContainersReady True | ||
PodScheduled True | ||
``` | ||
|
||
{% hint style="info" %} | ||
Tiltfile: Cluster API development requires a lot of iteration, and the "build, tag, push, update deployment" workflow can be very tedious. | ||
[Tilt](https://tilt.dev) makes this process much simpler by watching for updates, then automatically building and deploying them. | ||
|
||
You can visit [some example repositories][capidev], but you can get started by writing out a yaml manifest and using the following [`Tiltfile`][tiltfile] | ||
`kustomize build config/default | envsubst > capm.yaml` | ||
|
||
[capidev]: https://github.com/chuckha/capi-dev | ||
[tiltfile]: https://docs.tilt.dev/tiltfile_concepts.html | ||
|
||
```starlark | ||
allow_k8s_contexts('kubernetes-admin@luna') | ||
|
||
k8s_yaml('capm.yaml') | ||
|
||
docker_build('<your docke username or repository url>/cluster-api-controller-mailgun-amd64', '.') | ||
``` | ||
|
||
You can then use Tilt to watch the logs coming off your container | ||
{% endhint %} | ||
|
||
|
||
## Your first Cluster | ||
|
||
Let's try our cluster out. We'll make some simple YAML: | ||
|
||
```yaml | ||
apiVersion: cluster.x-k8s.io/v1alpha2 | ||
kind: Cluster | ||
metadata: | ||
name: hello-mailgun | ||
spec: | ||
clusterNetwork: | ||
pods: | ||
cidrBlocks: ["192.168.0.0/16"] | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 | ||
kind: MailgunCluster | ||
name: hello-mailgun | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 | ||
kind: MailgunCluster | ||
metadata: | ||
name: hello-mailgun | ||
spec: | ||
priority: "ExtremelyUrgent" | ||
request: "Please make me a cluster, with sugar on top?" | ||
requester: "[email protected]" | ||
``` | ||
We apply it as normal with `kubectl apply -f <filename>.yaml`. | ||
|
||
If all goes well, you should be getting an email to the address you configured when you set up your management cluster: | ||
|
||
![An email from mailgun urgently requesting a cluster](cluster-email.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters