Skip to content

Commit 3ea9e6b

Browse files
authored
Merge pull request #357 from rbitia/master
Updating getting started doc
2 parents 178e4ba + e2f7b18 commit 3ea9e6b

File tree

1 file changed

+41
-42
lines changed

1 file changed

+41
-42
lines changed

docs/getting-started.md

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
## Requirements
2828

2929
- Linux or MacOS (Windows isn't supported at the moment)
30-
- A set of Azure credentials sufficient to bootstrap the cluster (an Azure service principal with Collaborator rights).
30+
- A [Microsoft Azure account](https://azure.microsoft.com/en-us/)
31+
- Install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)
32+
- Install the [Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
3133
- [KIND]
32-
- [kubectl]
3334
- [kustomize]
3435
- make
35-
- [gettext](https://www.gnu.org/software/gettext/) (with `envsubst` in your PATH)
36+
- gettext (with `envsubst` in your PATH)
3637
- md5sum
37-
- [bazel](https://docs.bazel.build/versions/1.2.0/getting-started.html)
38+
- bazel
3839

3940
### Optional
4041

@@ -46,35 +47,49 @@
4647
[go]: https://golang.org/dl/
4748
[jq]: https://stedolan.github.io/jq/download/
4849
[kind]: https://sigs.k8s.io/kind
49-
[kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
5050
[kustomize]: https://github.com/kubernetes-sigs/kustomize
5151

5252
## Prerequisites
5353

54-
### Install release binaries
54+
### Building from master
5555

56-
Get the latest [release of `clusterctl`](https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases) and place them in your PATH.
56+
If you're interested in developing cluster-api-provider-azure and getting the latest version from `master`, please follow the [development guide][development].
5757

58-
#### Building from master
58+
### Deploying a cluster
5959

60-
If you're interested in developing cluster-api-provider-azure and getting the latest version from `master`, please follow the [development guide][development].
60+
#### Setting up your Azure environment
61+
62+
An Azure Service Principal is needed for populating the controller manifests. This utilizes [environment-based authentication](https://docs.microsoft.com/en-us/go/azure/azure-sdk-go-authorization#use-environment-based-authentication).
63+
64+
1. List your Azure subscriptions.
6165

62-
## Deploying a cluster
66+
```bash
67+
az account list -o table
68+
```
6369

64-
### Setting up the environment
70+
2. Save your Subscription ID in an enviroment variable.
6571

66-
An Azure Service Principal is needed for usage by the `clusterctl` tool and for populating the controller manifests. This utilizes [environment-based authentication](https://docs.microsoft.com/en-us/go/azure/azure-sdk-go-authorization#use-environment-based-authentication).
72+
```bash
73+
export AZURE_SUBSCRIPTION_ID="<SubscriptionId>"
74+
```
75+
76+
3. Create an Azure Service Principal by running the following command or skip this step and use a previously created Azure Service Principal.
6777

68-
The following environment variables should be set:
78+
```bash
79+
az ad sp create-for-rbac --name SPClusterAPI
80+
```
6981

70-
- `AZURE_SUBSCRIPTION_ID`
71-
- `AZURE_TENANT_ID`
72-
- `AZURE_CLIENT_ID`
73-
- `AZURE_CLIENT_SECRET`
82+
4. Save the output from the above command in enviroment variables.
7483

75-
An alternative is to install [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and have the project's script create the service principal automatically. _Note that the service principals created by the scripts will not be deleted automatically._
84+
```bash
85+
export AZURE_TENANT_ID=<Tenant>
86+
export AZURE_CLIENT_ID=<AppId>
87+
export AZURE_CLIENT_SECRET=<Password>
88+
export AZURE_LOCATION="eastus"
89+
```
90+
<!--An alternative is to install [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and have the project's script create the service principal automatically. _Note that the service principals created by the scripts will not be deleted automatically._ -->
7691

77-
### Generating cluster manifests and example cluster
92+
#### Generating cluster manifests and example cluster
7893

7994
Download the cluster-api-provider-azure-examples.tar file and unpack it.
8095

@@ -91,10 +106,10 @@ Here is a list of commonly overriden configuration parameters (the full list is
91106
```bash
92107
# Azure settings.
93108
export AZURE_LOCATION="eastus"
94-
export AZURE_RESOURCE_GROUP="kubecuddles"
109+
export AZURE_RESOURCE_GROUP="capz-rg"
95110

96111
# Cluster settings.
97-
export CLUSTER_NAME="pony-unicorns"
112+
export CLUSTER_NAME="capz-cluster"
98113

99114
# Machine settings.
100115
export CONTROL_PLANE_MACHINE_TYPE="Standard_B2ms"
@@ -112,7 +127,7 @@ You can also [build your own image](https://github.com/kubernetes-sigs/image-bui
112127
Now that the deployment has been customized, the next step is to generate the required manifests:
113128

114129
```bash
115-
./azure/generate-yaml.sh
130+
./examples/generate.sh
116131
```
117132

118133
**Please review `manifests.md` to understand which manifests to use for various cluster scenarios.**
@@ -126,16 +141,10 @@ Verify that the manifests reflect the expected settings before continuing.
126141
You can now start the Cluster API controllers and deploy a new cluster in Azure:
127142

128143
```bash
129-
clusterctl create cluster -v 4 \
130-
--bootstrap-type kind \
131-
--provider azure \
132-
-m ./azure/out/<machine-manifest> \
133-
-c ./azure/out/<cluster-manifest> \
134-
-p ./azure/out/provider-components.yaml \
135-
-a ./azure/out/addons.yaml
144+
make create-cluster
136145
```
137146

138-
Here is some example output from `clusterctl`:
147+
Here is some example output from `make`:
139148

140149
<details>
141150

@@ -240,19 +249,9 @@ I0324 23:54:00.260254 27739 kind.go:72] Ran: kind [delete cluster --name=clust
240249

241250
The created KIND cluster is ephemeral and is cleaned up automatically when done. During the cluster creation, the kubectl context is set to "kind-clusterapi" and can be retrieved using `kubectl cluster-info --context kind-clusterapi`.
242251

243-
For a more in-depth look into what `clusterctl` is doing during this create step, please see the [clusterctl document](/docs/clusterctl.md).
244-
245-
## Using the cluster
246-
247-
The kubeconfig for the new cluster is created in the directory from where the above `clusterctl create` was run.
248-
249-
Run the following command to point `kubectl` to the kubeconfig of the new cluster:
250-
251-
```bash
252-
export KUBECONFIG=$(pwd)/kubeconfig
253-
```
252+
## Next steps
254253

255-
Alternatively, move the kubeconfig file to a desired location and set the `KUBECONFIG` environment variable accordingly.
254+
You've just created an initial management cluster with kind. You are now ready to set up this management cluster and use it to create workload clusters. Follow the documentation in the [Cluster API Book](https://cluster-api.sigs.k8s.io/tasks/installation.html) to learn more.
256255

257256
## Troubleshooting
258257

0 commit comments

Comments
 (0)