-
Notifications
You must be signed in to change notification settings - Fork 1.4k
📖 Move clusterctl to book #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
kikisdeliveryservice:docs-clusterctl-to-book
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,72 @@ | ||
| # Clusterctl | ||
| <aside class="note warning"> | ||
| <h1>Deprecation Notice</h1> | ||
|
|
||
| This utility has been deprecated in v1alpha2 and will be removed in a future version. | ||
|
|
||
| </aside> | ||
|
|
||
| # Using `clusterctl` to create a cluster from scratch | ||
|
|
||
| This document provides an overview of how `clusterctl` works and explains how one can use `clusterctl` | ||
| to create a Kubernetes cluster from scratch. | ||
|
|
||
| ## What is `clusterctl`? | ||
|
|
||
| `clusterctl` is a CLI tool to create a Kubernetes cluster. `clusterctl` is provided by the [provider implementations](https://cluster-api.sigs.k8s.io/reference/providers). | ||
| It uses Cluster API provider implementations to provision resources needed by the Kubernetes cluster. | ||
|
|
||
| ## Creating a cluster | ||
|
|
||
| `clusterctl` needs 4 YAML files to start with: `provider-components.yaml`, `cluster.yaml`, `machines.yaml` , | ||
| `addons.yaml`. | ||
|
|
||
| * `provider-components.yaml` contains the *Custom Resource Definitions ([CRDs](https://Kubernetes.io/docs/concepts/extend-Kubernetes/api-extension/custom-resources/))* | ||
| of all the resources that are managed by Cluster API. Some examples of these resources | ||
| are: `Cluster`, `Machine`, `MachineSet`, etc. For more details about Cluster API resources | ||
| click [here](https://cluster-api.sigs.k8s.io/architecture/controllers). | ||
| * `cluster.yaml` defines an object of the resource type `Cluster`. | ||
| * `machines.yaml` defines an object of the resource type `Machine`. Generally creates the machine | ||
| that becomes the control-plane. | ||
| * `addons.yaml` contains the addons for the provider. | ||
|
|
||
| Many providers implementations come with helpful scripts to generate these YAMLS. Provider implementation | ||
| can be found [here](https://cluster-api.sigs.k8s.io/reference/providers). | ||
|
|
||
| `clusterctl` also comes with additional features. For example, `clusterctl` can also take in an optional | ||
| `bootstrap-only-components.yaml` to provide resources to the bootstrap cluster without also providing them | ||
| to the target cluster post-pivot. | ||
|
|
||
| For more details about all the supported options run: | ||
|
|
||
| ``` | ||
| clusterctl create cluster --help | ||
| ``` | ||
|
|
||
| After generating the YAML files run the following command: | ||
|
|
||
| ``` | ||
| clusterctl create cluster --bootstrap-type <BOOTSTRAP CLUSTER TYPE> -c cluster.yaml -m machines.yaml -p provider-components.yaml --addon-components addons.yaml | ||
| ``` | ||
|
|
||
| Example usage: | ||
|
|
||
| ``` | ||
| clusterctl create cluster --bootstrap-type kind -c cluster.yaml -m machines.yaml -p provider-components.yaml --addon-components addons.yaml | ||
| ``` | ||
|
|
||
| **What happens when we run the command?** | ||
| After running the command first it creates a local cluster. If `kind` was passed as the `--bootstrap-type` | ||
| it creates a local [kind](https://kind.sigs.k8s.io/) cluster. This cluster is generally referred to as the *bootstrap cluster*. | ||
| On this kind Kubernetes cluster the `provider-components.yaml` file is applied. This step loads the CRDs into | ||
| the cluster. It also creates two [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) | ||
| pods that run the cluster api controller manager and the provider specific controller manager. These pods register | ||
| the custom controllers that manage the newly defined resources (`Cluster`, `Machine`, `MachineSet`, `MachineDeployment`, | ||
| as well as provider-specific resources). | ||
|
|
||
| Next, `clusterctl` applies the `cluster.yaml` and `machines.yaml` to the local kind Kubernetes cluster. This | ||
| step creates a Kubernetes cluster with only a control-plane (as defined in `machines.yaml`) on the specified | ||
| provider. This newly created cluster is generally referred to as the *management cluster* or *pivot cluster* | ||
| or *initial target cluster*. The management cluster is responsible for creating and maintaining the workload cluster. | ||
|
|
||
| Lastly, `clusterctl` moves all the CRDs and the custom controllers from the bootstrap cluster to the | ||
| management cluster and deletes the locally created bootstrap cluster. This step is referred to as the *pivot*. | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.