Skip to content

Commit bd86562

Browse files
justaugustusk8s-ci-robot
authored andcommitted
Update repo documentation and dependencies (#249)
Signed-off-by: Stephen Augustus <[email protected]>
1 parent 1c57a13 commit bd86562

File tree

8 files changed

+137
-27
lines changed

8 files changed

+137
-27
lines changed

WORKSPACE

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,23 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
1818
http_archive(
1919
name = "io_bazel_rules_go",
2020
urls = [
21-
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.18.7/rules_go-0.18.7.tar.gz",
22-
"https://github.com/bazelbuild/rules_go/releases/download/0.18.7/rules_go-0.18.7.tar.gz",
21+
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
22+
"https://github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
2323
],
24-
sha256 = "45409e6c4f748baa9e05f8f6ab6efaa05739aa064e3ab94e5a1a09849c51806a",
24+
sha256 = "8df59f11fb697743cbb3f26cfb8750395f30471e9eabde0d174c3aebc7a1cd39",
2525
)
2626

27+
git_repository(
28+
name = "com_google_protobuf",
29+
commit = "6a59a2ad1f61d9696092f79b6d74368b4d7970a3", # v3.9.0
30+
remote = "https://github.com/protocolbuffers/protobuf",
31+
shallow_since = "1562856725 -0700",
32+
)
33+
34+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
35+
36+
protobuf_deps()
37+
2738
http_archive(
2839
name = "io_bazel_rules_docker",
2940
sha256 = "87fc6a2b128147a0a3039a2fd0b53cc1f2ed5adb8716f50756544a572999ae9a",

cmd/clusterctl/examples/azure/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pkg_tar(
6262
"machine-deployment.yaml.template",
6363
"provider-components-base.yaml",
6464
"//docs:getting-started.md",
65+
"//docs:manifests.md",
6566
],
6667
modes = {
6768
"addons.yaml": "0644",
@@ -75,6 +76,7 @@ pkg_tar(
7576
"machine-deployment.yaml.template": "0644",
7677
"provider-components-base.yaml": "0644",
7778
"//docs:getting-started.md": "0644",
79+
"//docs:manifests.md": "0644",
7880
".gitignore": "0644",
7981
},
8082
package_dir = "azure",

cmd/clusterctl/examples/azure/machine-deployment.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: "cluster.k8s.io/v1alpha1"
22
kind: MachineDeployment
33
metadata:
4-
name: ${CLUSTER_NAME}-machinedeployment
4+
name: ${CLUSTER_NAME}-md
55
labels:
66
cluster.k8s.io/cluster-name: ${CLUSTER_NAME}
77
spec:

docs/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@
1414

1515
exports_files([
1616
"getting-started.md",
17+
"manifests.md",
1718
])

docs/development.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [Dev images](#dev-images)
1414
- [Container registry](#container-registry)
1515
- [Developing](#developing)
16+
- [Modules and dependencies](#modules-and-dependencies)
1617
- [Manual Testing](#manual-testing)
1718
- [Setting up the environment](#setting-up-the-environment)
1819
- [Building and pushing dev images](#building-and-pushing-dev-images)
@@ -143,17 +144,20 @@ Ensure kind has been reset:
143144
make kind-reset
144145
```
145146
146-
`make create-cluster` will launch a bootstrap cluster and then run the generated
147-
manifests creating a target cluster in Azure.
147+
**Before continuing, please review the [documentation on manifests][manifests] to understand which manifests to use for various cluster scenarios.**
148148
149-
If you're interested in creating the cluster with verbose logging, you can instead run:
149+
Launch a bootstrap cluster and then run the generated manifests creating a target cluster in Azure:
150+
- Use `make create-cluster` to create a single control plane, single node cluster
151+
- Use `make create-cluster-ha` to create a multi-node control plane, with no nodes
152+
153+
If you're interested in creating the cluster with verbose logging or further customize the manifests, you can instead run:
150154

151155
```bash
152156
time clusterctl create cluster -v 10 \
153157
--provider azure \
154158
--bootstrap-type kind \
155-
-m ./cmd/clusterctl/examples/azure/out/machines.yaml \
156-
-c ./cmd/clusterctl/examples/azure/out/cluster.yaml \
159+
-m ./cmd/clusterctl/examples/azure/out/<machine-manifest> \
160+
-c ./cmd/clusterctl/examples/azure/out/<cluster-manifest> \
157161
-p ./cmd/clusterctl/examples/azure/out/provider-components.yaml \
158162
-a ./cmd/clusterctl/examples/azure/out/addons.yaml
159163
```
@@ -204,4 +208,5 @@ If you then want to use these mocks with `go test ./...`, run
204208
[kind]: https://sigs.k8s.io/kind
205209
[azure_cli]: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
206210
[bazel]: https://docs.bazel.build/versions/master/install.html
211+
[manifests]: /docs/manifests.md
207212
[pyenv]: https://github.com/pyenv/pyenv

docs/getting-started.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [Using the cluster](#using-the-cluster)
2121
- [Troubleshooting](#troubleshooting)
2222
- [Bootstrap running, but resources aren't being created](#bootstrap-running-but-resources-arent-being-created)
23+
- [Resources are created but control plane is taking a long time to become ready](#resources-are-created-but-control-plane-is-taking-a-long-time-to-become-ready)
2324

2425
<!-- /TOC -->
2526

@@ -87,7 +88,7 @@ A set of sane defaults are utilized when generating manifests via `./azure/gener
8788
Here is a list of commonly overriden configuration parameters (the full list is available in `./azure/generate-yaml.sh`):
8889
```bash
8990
# Azure settings.
90-
export LOCATION="eastus2"
91+
export LOCATION="eastus"
9192
export RESOURCE_GROUP="kubecuddles"
9293

9394
# Cluster settings.
@@ -106,9 +107,11 @@ Now that the deployment has been customized, the next step is to generate the re
106107
./azure/generate-yaml.sh
107108
```
108109

110+
**Please review `manifests.md` to understand which manifests to use for various cluster scenarios.**
111+
109112
Manually editing the generated manifests should not be required, but this is the stage where final customizations can be done.
110113

111-
Verify that `./azure/out/cluster.yaml` and `./azure/out/machine.yaml` reflect the expected settings before continuing.
114+
Verify that the manifests reflect the expected settings before continuing.
112115

113116
### Creating a cluster
114117

@@ -118,11 +121,17 @@ You can now start the Cluster API controllers and deploy a new cluster in Azure:
118121
clusterctl create cluster -v 4 \
119122
--bootstrap-type kind \
120123
--provider azure \
121-
-m ./azure/out/machines.yaml \
122-
-c ./azure/out/cluster.yaml \
124+
-m ./azure/out/<machine-manifest> \
125+
-c ./azure/out/<cluster-manifest> \
123126
-p ./azure/out/provider-components.yaml \
124127
-a ./azure/out/addons.yaml
128+
```
129+
130+
Here is some example output from `clusterctl`:
125131

132+
<details>
133+
134+
```
126135
I0324 23:19:37.110948 27739 decoder.go:224] decoding stream as YAML
127136
I0324 23:19:37.111615 27739 decoder.go:224] decoding stream as YAML
128137
I0324 23:19:37.115835 27739 createbootstrapcluster.go:27] Creating bootstrap cluster
@@ -219,6 +228,7 @@ I0324 23:53:58.997892 27739 createbootstrapcluster.go:36] Cleaning up bootstra
219228
I0324 23:53:58.997937 27739 kind.go:69] Running: kind [delete cluster --name=clusterapi]
220229
I0324 23:54:00.260254 27739 kind.go:72] Ran: kind [delete cluster --name=clusterapi] Output: Deleting cluster "clusterapi" ...
221230
```
231+
</details>
222232

223233
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"`.
224234

docs/manifests.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Manifests
2+
3+
Cluster API Provider Azure provides several manifest templates to assist with provisioning Kubernetes clusters.
4+
5+
- `cluster.yaml.template`
6+
- `cluster-network-spec.yaml.template`
7+
- `controlplane-machine.yaml.template`
8+
- `controlplane-machines-ha.yaml.template`
9+
- `credentials.yaml.template`
10+
- `machines.yaml.template`
11+
- `machine-deployment.yaml.template`
12+
13+
After running `generate-yaml.sh`, the provided templates will be transformed into usable Kubernetes manifests.
14+
15+
You will not require all of the manifests to successfully create a cluster.
16+
This will provide some guidance on which manifests to use and when.
17+
18+
## Cluster
19+
20+
### Default network configuration
21+
22+
Use `cluster.yaml`.
23+
24+
### (Unsupported) Existing virtual network
25+
26+
Use `cluster-network-spec.yaml`.
27+
28+
29+
## Machine
30+
31+
### Single control plane, single node
32+
33+
Use `machines.yaml`.
34+
35+
### Single control plane, without nodes
36+
37+
Use `controlplane-machine.yaml`.
38+
39+
### Multi-node control plane
40+
41+
Use `controlplane-machines-ha.yaml`.
42+
43+
### Machine deployment (single replica)
44+
45+
**This manifest should only be applied to a cluster _after_ a control plane has been deployed.**
46+
47+
Use `machine-deployment.yaml`.

docs/releasing.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,32 @@
22

33
## Pre-flight
44

5+
- Identify a known good commit on the release branch
6+
- Tag the repository with a release candidate tag and push the tag
7+
- An [OWNER](/OWNERS) runs `git tag -s <version>-rc.n`, inserts the changelog and pushes the tag with `git push <version>-rc.n`
58
- 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`)
10-
11-
## Semi-automatic
9+
- Review the development, getting started documentation, generation scripts, and update as necessary
10+
- Run `make release-artifacts`, with the appropriate environment variables:
11+
```
12+
REGISTRY="quay.io/k8s-staging" \
13+
PULL_POLICY="IfNotPresent" \
14+
MANAGER_IMAGE_TAG="<version>-rc.n" \
15+
make release-artifacts
16+
```
17+
- Build and push a container image to the staging repository using the release candidate tag (`<version>-rc.n`):
18+
```
19+
REGISTRY="quay.io/k8s-staging" \
20+
MANAGER_IMAGE_TAG="<version>-rc.n" \
21+
time make docker-build
22+
23+
REGISTRY="quay.io/k8s-staging" \
24+
MANAGER_IMAGE_TAG="<version>-rc.n" \
25+
time make docker-push
26+
```
27+
- Run through the "Getting Started" instructions using the artifacts generated in these steps to validate that they result in a working cluster
28+
- Commit and PR any required changes before continuing the release process ([example](https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/249))
29+
30+
## (Unused) Semi-automatic
1231

1332
1. Make sure your repo is clean by git's standards
1433
2. Run `go run cmd/release/main.go -remote <upstream-remote-name> -version v0.x.y`, replacing the [version][versioning], as appropriate
@@ -20,16 +39,31 @@
2039
## Manual
2140

2241
1. Tag the repository and push the tag
23-
- An [OWNER](/OWNERS) runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION`
42+
- An [OWNER](/OWNERS) runs `git tag -s <version>` and inserts the changelog and pushes the tag with `git push <version>`
2443
2. Create a draft release in GitHub and associate it with the tag that was just created
2544
3. Checkout the tag and make sure git is in a clean state
26-
4. Run `make release-artifacts`
45+
4. Run `make release-artifacts`, with the appropriate environment variables:
46+
```
47+
REGISTRY="quay.io/k8s" \
48+
PULL_POLICY="IfNotPresent" \
49+
MANAGER_IMAGE_TAG="<version>" \
50+
make release-artifacts
51+
```
2752
5. Attach the tarball to the drafted release
2853
6. Attach `clusterctl` to the drafted release (for darwin and linux architectures)
29-
7. Write the [release notes](#release-notes) and make sure the binaries uploaded return the correct version
30-
8. Build and push the container image
31-
9. Publish release
32-
10. [Announce][release-announcement] the release
54+
7. Write the [release notes](#release-notes) and make sure the binaries uploaded return the correct version
55+
8. Build and push a container image to the staging repository using the release candidate tag (`<version>`):
56+
```
57+
REGISTRY="quay.io/k8s" \
58+
MANAGER_IMAGE_TAG="<version>" \
59+
time make docker-build
60+
61+
REGISTRY="quay.io/k8s" \
62+
MANAGER_IMAGE_TAG="<version>" \
63+
time make docker-push
64+
```
65+
11. Publish release
66+
12. [Announce][release-announcement] the release
3367
3468
## Versioning
3569
@@ -85,12 +119,12 @@ The markdown is shared in the Kubernetes slack in the channel #cluster-api-azure
85119
### Minor/Patch Releases
86120
87121
1. Announce the release in Kubernetes Slack on the #cluster-api-azure channel.
88-
2. An announcement email is sent to `[email protected]` and `[email protected]` with the subject `[ANNOUNCE] cluster-api-provider-azure $VERSION has been released`
122+
2. An announcement email is sent to `[email protected]` and `[email protected]` with the subject `[ANNOUNCE] cluster-api-provider-azure <version> has been released`
89123
90124
### Major Releases
91125
92126
1. Follow the communications process for [pre-releases](#pre-releases)
93-
2. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] cluster-api-provider-azure $VERSION has been released`
127+
2. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] cluster-api-provider-azure <version> has been released`
94128
95129
96130
[release-announcement]: #communication

0 commit comments

Comments
 (0)