Skip to content

Commit f53efdb

Browse files
justaugustusk8s-ci-robot
authored andcommitted
fix: Release tooling and documentation for v0.1.0 (#151)
Signed-off-by: Stephen Augustus <[email protected]>
1 parent 2726189 commit f53efdb

File tree

8 files changed

+210
-76
lines changed

8 files changed

+210
-76
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ binaries-dev: ## Builds and installs all development binaries using go get
238238
go get -v ./...
239239

240240
.PHONY: create-cluster
241-
create-cluster: binaries-dev ## Create a development Kubernetes cluster on AWS using examples
241+
create-cluster: binaries-dev ## Create a development Kubernetes cluster on Azure using examples
242242
clusterctl create cluster -v 4 \
243243
--provider azure \
244244
--bootstrap-type kind \

cmd/clusterctl/examples/azure/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pkg_tar(
5050
"addons.yaml",
5151
"cluster.yaml.template",
5252
"cluster-network-spec.yaml.template",
53+
"credentials.yaml.template",
5354
"generate-yaml.sh",
5455
"machines.yaml.template",
5556
"provider-components-base.yaml",

cmd/clusterctl/examples/azure/generate-yaml.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export AZURE_CLIENT_SECRET_B64="$(echo -n "$AZURE_CLIENT_SECRET" | base64)"
4949
CLUSTER_TEMPLATE_FILE=${DIR}/cluster.yaml.template
5050
CLUSTER_NETWORKSPEC_TEMPLATE_FILE=${DIR}/cluster-network-spec.yaml.template
5151
CLUSTER_GENERATED_FILE=${OUTPUT_DIR}/cluster.yaml
52-
# TODO: Change the machine template once nodes are implemented
5352
MACHINES_TEMPLATE_FILE=${DIR}/machines.yaml.template
5453
MACHINES_GENERATED_FILE=${OUTPUT_DIR}/machines.yaml
5554
ADDONS_FILE=${OUTPUT_DIR}/addons.yaml

cmd/clusterctl/examples/azure/machines_no_node.yaml.template

Lines changed: 0 additions & 34 deletions
This file was deleted.

cmd/release/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ github token for modifying release
3737

3838
const (
3939
// TODO(chuckha): figure this out based on directory name
40-
repository = "cluster-api-provider-azure"
40+
repository = "k8s"
4141

4242
// TODO move these into config
4343
registry = "quay.io"

docs/getting-started.md

Lines changed: 190 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@
88

99
- [Requirements](#requirements)
1010
- [Optional](#optional)
11-
- [Install the project](#install-the-project)
12-
- [Release binaries](#release-binaries)
11+
- [Prerequisites](#prerequisites)
12+
- [Install release binaries](#install-release-binaries)
1313
- [Building from master](#building-from-master)
14-
- [Prepare your environment](#prepare-your-environment)
15-
- [Usage](#usage)
16-
- [Creating a Cluster](#creating-a-cluster)
14+
- [Deploying a cluster](#deploying-a-cluster)
15+
- [Setting up the environment](#setting-up-the-environment)
16+
- [Generating cluster manifests and example cluster](#generating-cluster-manifests-and-example-cluster)
17+
- [Customizing the cluster deployment](#customizing-the-cluster-deployment)
18+
- [Running the manifest generation script](#running-the-manifest-generation-script)
19+
- [Creating a cluster](#creating-a-cluster)
20+
- [Using the cluster](#using-the-cluster)
21+
- [Troubleshooting](#troubleshooting)
22+
- [Bootstrap running, but resources aren't being created](#bootstrap-running-but-resources-arent-being-created)
1723

1824
<!-- /TOC -->
1925

@@ -41,51 +47,203 @@
4147
[kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/
4248
[kustomize]: https://github.com/kubernetes-sigs/kustomize
4349

44-
### Install the project
50+
## Prerequisites
4551

46-
#### Release binaries
47-
TODO. Coming soon!
52+
### Install release binaries
53+
54+
Get the latest [release of `clusterctl`](https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases) and place them in your PATH.
4855

4956
#### Building from master
5057

5158
If you're interested in developing cluster-api-provider-azure and getting the latest version from `master`, please follow the [development guide][development].
5259

53-
### Prepare your environment
54-
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). The following environment variables should be set: `AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_ID` and `AZURE_CLIENT_SECRET`.
60+
## Deploying a cluster
61+
62+
### Setting up the environment
63+
64+
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).
65+
66+
The following environment variables should be set:
67+
- `AZURE_SUBSCRIPTION_ID`
68+
- `AZURE_TENANT_ID`
69+
- `AZURE_CLIENT_ID`
70+
- `AZURE_CLIENT_SECRET`
5571

5672
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._
5773

58-
### Usage
74+
### Generating cluster manifests and example cluster
75+
76+
Download the cluster-api-provider-azure-examples.tar file and unpack it.
77+
78+
```bash
79+
tar -xvf cluster-api-provider-azure-examples.tar
80+
```
81+
82+
#### Customizing the cluster deployment
5983

60-
#### Creating a Cluster
61-
1. Generate the `cluster.yaml`, `machines.yaml`, and `addons.yaml` files, and create the service principal if needed.
84+
A set of sane defaults are utilized when generating manifests via `./azure/generate-yaml.sh`, but these can be overridden by exporting environment variables.
6285

63-
```bash
64-
make clean # Clean up any previous manifests
86+
Here is a list of commonly overriden configuration parameters (the full list is available in `./azure/generate-yaml.sh`):
87+
```bash
88+
# Azure settings.
89+
export LOCATION="eastus2"
90+
export RESOURCE_GROUP="kubecuddles"
6591

66-
REGISTRY="<container-registry>" MANAGER_IMAGE_TAG="<image-tag>" RESOURCE_GROUP="<resource-group>" CLUSTER_NAME="<cluster-name>" make manifests # set CREATE_SP=TRUE if creating a new Service Principal is desired
67-
68-
# If CREATE_SP=TRUE
69-
source cmd/clusterctl/examples/azure/out/credentials.sh
70-
```
71-
2. Ensure kind has been reset:
72-
```bash
73-
make kind-reset
74-
```
75-
3. Create the cluster.
92+
# Cluster settings.
93+
export CLUSTER_NAME="pony-unicorns"
7694

77-
**NOTE:** Kubernetes Version >= 1.11 is required to enable CRD subresources without needing a feature gate.
95+
# Machine settings.
96+
export CONTROL_PLANE_MACHINE_TYPE="Standard_B2ms"
97+
export NODE_MACHINE_TYPE="Standard_B2ms"
98+
```
7899

79-
```bash
80-
make create-cluster
81-
```
100+
#### Running the manifest generation script
82101

83-
Once the cluster is created successfully, you can interact with the cluster using `kubectl` and the kubeconfig downloaded by the `clusterctl` tool.
102+
Now that the deployment has been customized, the next step is to generate the required manifests:
84103

104+
```bash
105+
./azure/generate-yaml.sh
85106
```
107+
108+
Manually editing the generated manifests should not be required, but this is the stage where final customizations can be done.
109+
110+
Verify that `./azure/out/cluster.yaml` and `./azure/out/machine.yaml` reflect the expected settings before continuing.
111+
112+
### Creating a cluster
113+
114+
You can now start the Cluster API controllers and deploy a new cluster in Azure:
115+
116+
```bash
117+
clusterctl create cluster -v 4 \
118+
--bootstrap-type kind \
119+
--provider azure \
120+
-m ./azure/out/machines.yaml \
121+
-c ./azure/out/cluster.yaml \
122+
-p ./azure/out/provider-components.yaml \
123+
-a ./azure/out/addons.yaml
124+
125+
I0324 23:19:37.110948 27739 decoder.go:224] decoding stream as YAML
126+
I0324 23:19:37.111615 27739 decoder.go:224] decoding stream as YAML
127+
I0324 23:19:37.115835 27739 createbootstrapcluster.go:27] Creating bootstrap cluster
128+
I0324 23:19:37.115883 27739 kind.go:69] Running: kind [create cluster --name=clusterapi]
129+
130+
I0324 23:23:58.081879 27739 kind.go:72] Ran: kind [create cluster --name=clusterapi] Output: Creating cluster "clusterapi" ...
131+
• Ensuring node image (kindest/node:v1.13.3) 🖼 ...
132+
✓ Ensuring node image (kindest/node:v1.13.3) 🖼
133+
• [control-plane] Creating node container 📦 ...
134+
✓ [control-plane] Creating node container 📦
135+
• [control-plane] Fixing mounts 🗻 ...
136+
✓ [control-plane] Fixing mounts 🗻
137+
• [control-plane] Starting systemd 🖥 ...
138+
✓ [control-plane] Starting systemd 🖥
139+
• [control-plane] Waiting for docker to be ready 🐋 ...
140+
✓ [control-plane] Waiting for docker to be ready 🐋
141+
• [control-plane] Pre-loading images 🐋 ...
142+
✓ [control-plane] Pre-loading images 🐋
143+
• [control-plane] Creating the kubeadm config file ⛵ ...
144+
✓ [control-plane] Creating the kubeadm config file ⛵
145+
• [control-plane] Starting Kubernetes (this may take a minute) ☸ ...
146+
✓ [control-plane] Starting Kubernetes (this may take a minute) ☸
147+
Cluster creation complete. You can now use the cluster with:
148+
86149
export KUBECONFIG="$(kind get kubeconfig-path --name="clusterapi")"
87-
kubectl get clusters
88-
kubectl get machines
150+
kubectl cluster-info
151+
I0324 23:23:58.081925 27739 kind.go:69] Running: kind [get kubeconfig-path --name=clusterapi]
152+
I0324 23:23:58.149609 27739 kind.go:72] Ran: kind [get kubeconfig-path --name=clusterapi] Output: /home/fakeuser/.kube/kind-config-clusterapi
153+
I0324 23:23:58.150729 27739 clusterdeployer.go:78] Applying Cluster API stack to bootstrap cluster
154+
I0324 23:23:58.150752 27739 applyclusterapicomponents.go:26] Applying Cluster API Provider Components
155+
I0324 23:23:58.150774 27739 clusterclient.go:919] Waiting for kubectl apply...
156+
I0324 23:23:58.756964 27739 clusterclient.go:948] Waiting for Cluster v1alpha resources to become available...
157+
I0324 23:23:58.763134 27739 clusterclient.go:961] Waiting for Cluster v1alpha resources to be listable...
158+
I0324 23:23:58.771783 27739 clusterdeployer.go:83] Provisioning target cluster via bootstrap cluster
159+
I0324 23:23:58.777256 27739 applycluster.go:36] Creating cluster object test-1 in namespace "default"
160+
I0324 23:23:58.783757 27739 clusterdeployer.go:92] Creating control plane test-1-controlplane-0 in namespace "default"
161+
I0324 23:23:58.788974 27739 applymachines.go:36] Creating machines in namespace "default"
162+
I0324 23:23:58.801805 27739 clusterclient.go:972] Waiting for Machine test-1-controlplane-0 to become ready...
163+
<output snipped>
164+
I0324 23:44:38.804516 27739 clusterclient.go:972] Waiting for Machine test-1-controlplane-0 to become ready...
165+
I0324 23:44:38.811944 27739 clusterdeployer.go:97] Updating bootstrap cluster object for cluster test-1 in namespace "default" with control plane endpoint running on test-1-controlplane-0
166+
I0324 23:44:38.835236 27739 clusterdeployer.go:102] Creating target cluster
167+
I0324 23:44:38.835270 27739 getkubeconfig.go:38] Getting target cluster kubeconfig.
168+
I0324 23:44:38.840932 27739 getkubeconfig.go:59] Waiting for kubeconfig on test-1-controlplane-0 to become ready...
169+
I0324 23:44:38.846004 27739 applyaddons.go:25] Applying Addons
170+
I0324 23:44:38.846038 27739 clusterclient.go:919] Waiting for kubectl apply...
171+
I0324 23:44:40.794352 27739 clusterdeployer.go:120] Pivoting Cluster API stack to target cluster
172+
I0324 23:44:40.794449 27739 pivot.go:67] Applying Cluster API Provider Components to Target Cluster
173+
I0324 23:44:40.794495 27739 clusterclient.go:919] Waiting for kubectl apply...
174+
I0324 23:44:43.012086 27739 pivot.go:72] Pivoting Cluster API objects from bootstrap to target cluster.
175+
I0324 23:44:43.012155 27739 pivot.go:83] Ensuring cluster v1alpha1 resources are available on the source cluster
176+
I0324 23:44:43.012225 27739 clusterclient.go:948] Waiting for Cluster v1alpha resources to become available...
177+
I0324 23:44:43.015046 27739 clusterclient.go:961] Waiting for Cluster v1alpha resources to be listable...
178+
I0324 23:44:43.023466 27739 pivot.go:88] Ensuring cluster v1alpha1 resources are available on the target cluster
179+
I0324 23:44:43.023547 27739 clusterclient.go:948] Waiting for Cluster v1alpha resources to become available...
180+
I0324 23:44:43.190476 27739 clusterclient.go:961] Waiting for Cluster v1alpha resources to be listable...
181+
I0324 23:44:43.251215 27739 pivot.go:93] Parsing list of cluster-api controllers from provider components
182+
I0324 23:44:43.251262 27739 decoder.go:224] decoding stream as YAML
183+
I0324 23:44:43.269534 27739 pivot.go:101] Scaling down controller azure-provider-system/azure-provider-controller-manager
184+
I0324 23:44:43.402303 27739 pivot.go:101] Scaling down controller cluster-api-system/cluster-api-controller-manager
185+
I0324 23:44:43.409192 27739 pivot.go:107] Retrieving list of MachineClasses to move
186+
I0324 23:44:43.411218 27739 pivot.go:212] Preparing to copy MachineClasses: []
187+
I0324 23:44:43.411252 27739 pivot.go:117] Retrieving list of Clusters to move
188+
I0324 23:44:43.415212 27739 pivot.go:171] Preparing to move Clusters: [test-1]
189+
I0324 23:44:43.415246 27739 pivot.go:234] Moving Cluster default/test-1
190+
I0324 23:44:43.415269 27739 pivot.go:236] Ensuring namespace "default" exists on target cluster
191+
I0324 23:44:43.929506 27739 pivot.go:247] Retrieving list of MachineDeployments to move for Cluster default/test-1
192+
I0324 23:44:43.932485 27739 pivot.go:287] Preparing to move MachineDeployments: []
193+
I0324 23:44:43.932519 27739 pivot.go:256] Retrieving list of MachineSets not associated with a MachineDeployment to move for Cluster default/test-1
194+
I0324 23:44:43.935291 27739 pivot.go:331] Preparing to move MachineSets: []
195+
I0324 23:44:43.935325 27739 pivot.go:265] Retrieving list of Machines not associated with a MachineSet to move for Cluster default/test-1
196+
I0324 23:44:43.937558 27739 pivot.go:374] Preparing to move Machines: [test-1-controlplane-0]
197+
I0324 23:44:43.937592 27739 pivot.go:385] Moving Machine default/test-1-controlplane-0
198+
I0324 23:44:44.353159 27739 clusterclient.go:972] Waiting for Machine test-1-controlplane-0 to become ready...
199+
I0324 23:44:44.408896 27739 pivot.go:399] Successfully moved Machine default/test-1-controlplane-0
200+
I0324 23:44:44.434373 27739 pivot.go:278] Successfully moved Cluster default/test-1
201+
I0324 23:44:44.434407 27739 pivot.go:127] Retrieving list of MachineDeployments not associated with a Cluster to move
202+
I0324 23:44:44.436304 27739 pivot.go:287] Preparing to move MachineDeployments: []
203+
I0324 23:44:44.436327 27739 pivot.go:136] Retrieving list of MachineSets not associated with a MachineDeployment or a Cluster to move
204+
I0324 23:44:44.437964 27739 pivot.go:331] Preparing to move MachineSets: []
205+
I0324 23:44:44.437987 27739 pivot.go:145] Retrieving list of Machines not associated with a MachineSet or a Cluster to move
206+
I0324 23:44:44.439735 27739 pivot.go:374] Preparing to move Machines: []
207+
I0324 23:44:44.439780 27739 pivot.go:186] Preparing to delete MachineClasses: []
208+
I0324 23:44:44.439803 27739 pivot.go:158] Deleting provider components from source cluster
209+
I0324 23:44:57.831009 27739 clusterdeployer.go:125] Saving provider components to the target cluster
210+
I0324 23:44:58.696579 27739 clusterdeployer.go:133] Updating target cluster object with control plane endpoint running on test-1-controlplane-0
211+
I0324 23:44:58.846821 27739 clusterdeployer.go:138] Creating node machines in target cluster.
212+
I0324 23:44:58.886538 27739 applymachines.go:36] Creating machines in namespace "default"
213+
I0324 23:44:58.923186 27739 clusterclient.go:972] Waiting for Machine test-1-node-c426q to become ready...
214+
<output snipped>
215+
I0324 23:53:58.955885 27739 clusterclient.go:972] Waiting for Machine test-1-node-c426q to become ready...
216+
I0324 23:53:58.997577 27739 clusterdeployer.go:143] Done provisioning cluster. You can now access your cluster with kubectl --kubeconfig kubeconfig
217+
I0324 23:53:58.997892 27739 createbootstrapcluster.go:36] Cleaning up bootstrap cluster.
218+
I0324 23:53:58.997937 27739 kind.go:69] Running: kind [delete cluster --name=clusterapi]
219+
I0324 23:54:00.260254 27739 kind.go:72] Ran: kind [delete cluster --name=clusterapi] Output: Deleting cluster "clusterapi" ...
220+
```
221+
222+
The created KIND cluster is ephemeral and is cleaned up automatically when done. During the cluster creation, the KIND configuration is written to a local directory and can be retrieved using `kind get kubeconfig-path --name="clusterapi"`.
223+
224+
For a more in-depth look into what `clusterctl` is doing during this create step, please see the [clusterctl document](/docs/clusterctl.md).
225+
226+
## Using the cluster
227+
228+
The kubeconfig for the new cluster is created in the directory from where the above `clusterctl create` was run.
229+
230+
Run the following command to point `kubectl` to the kubeconfig of the new cluster:
231+
```bash
232+
export KUBECONFIG=$(PWD)/kubeconfig
233+
```
234+
235+
Alternatively, move the kubeconfig file to a desired location and set the `KUBECONFIG` environment variable accordingly.
236+
237+
238+
## Troubleshooting
239+
240+
### Bootstrap running, but resources aren't being created
241+
242+
Logs can be tailed using [`kubectl`][kubectl]:
243+
244+
```bash
245+
export KUBECONFIG=$(kind get kubeconfig-path --name="clusterapi")
246+
kubectl logs azure-provider-controller-manager-0 -n azure-provider-system -f
89247
```
90248
91249
[development]: /docs/development.md

docs/release-notes-template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
clusterctl is a tool for bootstrapping a cluster for hosting the [cluster-api](https://github.com/kubernetes-sigs/cluster-api) components.
2222
See the [Getting Started Guide](https://github.com/kubernetes-sigs/cluster-api-provider-azure/tree/$VERSION/docs/getting-started.md).
2323

24+
## Image
25+
26+
<!-- Provide a link to the controller image in the container registry -->
27+
- [quay.io/k8s/cluster-api-azure-controller:0.x.y](https://quay.io/repository/k8s/cluster-api-azure-controller?tag=0.x.y&tab=tags)
28+
2429
## Limitations
2530

2631
<!-- List limitations in new functionality -->

docs/releasing.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Release Process
22

3-
Before beginning the release process, review and discuss any potential modifications to the [support matrix/policy][support-policy].
3+
## Pre-flight
4+
5+
- Review and discuss any potential modifications to the [support matrix/policy][support-policy]
6+
- Create a release commit e.g., `Release commit: v0.1.0`, by:
7+
- Searching and replacing the previous image versions in the repo, specifically in:
8+
- Makefile
9+
- Release tool (`cmd/release/main.go`)
410

511
## Semi-automatic
612

713
1. Make sure your repo is clean by git's standards
8-
2. If the controller has changed, it would be good to bump the version of the controller image. Look in `cmd/release/main.go`.
9-
3. Run `go run cmd/release/main.go -version v0.x.y`, replacing the [version][versioning], as appropriate
14+
2. Run `go run cmd/release/main.go -remote <upstream-remote-name> -version v0.x.y`, replacing the [version][versioning], as appropriate
15+
3. Write the [release notes](#release-notes) and make sure the binaries uploaded return the correct version
1016
4. Push the docker images that were generated with this release tool
11-
5. Edit the release notes and make sure the binaries uploaded return the correct version
12-
6. Publish release
13-
7. [Announce][release-announcement] the release
17+
5. Publish release
18+
6. [Announce][release-announcement] the release
1419

1520
## Manual
1621

@@ -21,7 +26,7 @@ Before beginning the release process, review and discuss any potential modificat
2126
4. Run `make release-artifacts`
2227
5. Attach the tarball to the drafted release
2328
6. Attach `clusterctl` to the drafted release (for darwin and linux architectures)
24-
7. Write the [release notes](#release-notes)
29+
7. Write the [release notes](#release-notes) and make sure the binaries uploaded return the correct version
2530
8. Build and push the container image
2631
9. Publish release
2732
10. [Announce][release-announcement] the release

0 commit comments

Comments
 (0)