Skip to content
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

docs: add getting started guide for bootstrapping a managemenet cluster with clusterctl #308

Merged

Conversation

andrewsykim
Copy link
Member

Signed-off-by: Andrew Sy Kim kiman@vmware.com

/assign @akutz

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 15, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewsykim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2019
@k8s-ci-robot k8s-ci-robot requested review from akutz and figo June 15, 2019 17:57
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 15, 2019
Copy link
Contributor

@akutz akutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

This. is. AMAZING. Thank you!!!

The only nits I have to pick are:

  • Please be consistent with spacing between text and blocks of pre-formatted text. A single, empty line is usually what I've seen in k/k markdown.
  • Please use shell or bash when pre-formatting shell output with triple ticks. I noticed that missing in a few places.

Other than that, looks perfect!

Copy link
Contributor

@akutz akutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

Sorry for the double-review, but something caught my eye and then I started looking more closely. One thing I didn't note in any comments (since it was prevalent everywhere) is that your IDE appears to line break in the middle of sentences. The k/k docs I've seen seem to use soft word wrapping from the IDE and prefer no line breaks except for when starting a new paragraph. Unless you object, I think we should stick with that. Thoughts?

Assuming you have a Go installed on your machine, run the following to install Kind:

```bash
$ GO111MODULE="on" go get sigs.k8s.io/kind@v0.3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

Please change this to:

$ GO111MODULE="on" go get -mod readonly sigs.k8s.io/kind@v0.3.0

This ensures that installing Kind won't modify a project's Go module files.

$ brew install gettext
```

NOTE: brew may install envsubst in a path that is not in your PATH environment variable. Ensure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

There's a trailing Ensure that begins a second sentence I think you meant to finish.


#### clusterctl

A version of `clusterctl` that is built from **this** respository must be installed. If you have a workin Go environment,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/workin/working/

The `clusterctl` make target installs `clusterctls` in `bin/clusterctl`. Temporarily add this folder to your PATH to use it
for the rest of this guide:
```
$ export PATH=$PATH:$(pwd)/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

Perhaps consider quoting it export PATH="${PATH}:$(pwd)/bin"

### Generating YAML for the Bootstrap Cluster

The bootstrapping process in `clusterctl` requires a few configuration files:
* **cluster.yaml**: a yaml file defining the cluster resource for your management cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

Please consider a table here and pre-formatting the file names.


### Managing Workload Clusters using the Management Cluster

With your management cluster bootstrapped, this is when you can reap the benefits of Cluster API. From this point forward,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/this is when you can/it's time to/

kubelet: 1.13.6
```

`kubectl apply -f` the above files on your management cluster and it should start provisioning the new cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

Instead of starting the sentence with the command, how about?

Run kubectl apply -f to apply the above files...

`kubectl apply -f` the above files on your management cluster and it should start provisioning the new cluster.
Clusters that are provisioned by the management cluster that run your application workloads are called [Workload Clusters](https://github.com/kubernetes-sigs/cluster-api/blob/master/docs/book/GLOSSARY.md#workload-cluster).

The `kubeconfig` file to access workload clusters should be accessible as Secrets on the management cluster. As of today, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/as Secrets/as a secret/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret to reference Kubernetes Secret resources. But updating to as a Secret resource

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. How about "as a Kubernetes Secret"? Maybe that isn't clear to those who don't use K8s as often as we do.

Clusters that are provisioned by the management cluster that run your application workloads are called [Workload Clusters](https://github.com/kubernetes-sigs/cluster-api/blob/master/docs/book/GLOSSARY.md#workload-cluster).

The `kubeconfig` file to access workload clusters should be accessible as Secrets on the management cluster. As of today, the
secret is named `<cluster-resource-uuid>-kubeconfig` in the same namespace as the cluster resource it belongs to. For example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/in the same namespace as the cluster resource it belongs to/in the same namespace as the cluster to which the secret belongs/

$ kubectl -n default get secrets 3644a115-88ae-11e9-952c-005056b08e9e-kubeconfig -o yaml
```

Now that you have the `kubeconfig` for your Workload Cluster, you can start deploying your applications there.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

It may be valuable to actually add a Terms and Phrases section at the top of this document to define things like "Workload Cluster" there. I personally would find that valuable. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed the terminology trips a lot of people up so this would be helpful. A graphic showing the relations may also be helpful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc links out in many places to the glossary page in the cluster-api docs but might be helpful to be more explicit in the beginning that the glossary page exists.

If we feel the glossary page there (https://cluster-api.sigs.k8s.io/glossary.html) is not enough we can add the definitions here again.

export VSPHERE_NETWORK="vm-network-1" # the VM network to deploy the management cluster on
export VSPHERE_RESOURCE_POOL="*/Resources/Compute-ResourcePool/CAPV" # the vSphere resource pool for your VMs
export VSPHERE_FOLDER="Workloads" # the VM folder for your VMs, this can be "" if not applicable to your environment
export VSPHERE_TEMPLATE="ubuntu-16.04-server-cloudimg-amd64" # the VM template to use for your management cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

The template should be a template a user deployed from one of the OVAs in the GCS bucket gs://capv-images/release. For example, in our VMC test environment the template name is ubuntu-1804-kube-v1.13.6. A user can learn more about the machine images in the image documentation or list the available machine images with gsutil:

$ gsutil ls gs://capv-images/release/*
gs://capv-images/release/v1.13.6/:
gs://capv-images/release/v1.13.6/centos-7-kube-v1.13.6.ova
gs://capv-images/release/v1.13.6/centos-7-kube-v1.13.6.ova.sha256
gs://capv-images/release/v1.13.6/ubuntu-1804-kube-v1.13.6.ova
gs://capv-images/release/v1.13.6/ubuntu-1804-kube-v1.13.6.ova.sha256

gs://capv-images/release/v1.13.7/:
gs://capv-images/release/v1.13.7/centos-7-kube-v1.13.7.ova
gs://capv-images/release/v1.13.7/centos-7-kube-v1.13.7.ova.sha256
gs://capv-images/release/v1.13.7/ubuntu-1804-kube-v1.13.7.ova
gs://capv-images/release/v1.13.7/ubuntu-1804-kube-v1.13.7.ova.sha256

gs://capv-images/release/v1.14.0/:
gs://capv-images/release/v1.14.0/centos-7-kube-v1.14.0.ova
gs://capv-images/release/v1.14.0/centos-7-kube-v1.14.0.ova.sha256
gs://capv-images/release/v1.14.0/ubuntu-1804-kube-v1.14.0.ova
gs://capv-images/release/v1.14.0/ubuntu-1804-kube-v1.14.0.ova.sha256

gs://capv-images/release/v1.14.1/:
gs://capv-images/release/v1.14.1/centos-7-kube-v1.14.1.ova
gs://capv-images/release/v1.14.1/centos-7-kube-v1.14.1.ova.sha256
gs://capv-images/release/v1.14.1/ubuntu-1804-kube-v1.14.1.ova
gs://capv-images/release/v1.14.1/ubuntu-1804-kube-v1.14.1.ova.sha256

gs://capv-images/release/v1.14.2/:
gs://capv-images/release/v1.14.2/centos-7-kube-v1.14.2.ova
gs://capv-images/release/v1.14.2/centos-7-kube-v1.14.2.ova.sha256
gs://capv-images/release/v1.14.2/ubuntu-1804-kube-v1.14.2.ova
gs://capv-images/release/v1.14.2/ubuntu-1804-kube-v1.14.2.ova.sha256

gs://capv-images/release/v1.14.3/:
gs://capv-images/release/v1.14.3/centos-7-kube-v1.14.3.ova
gs://capv-images/release/v1.14.3/centos-7-kube-v1.14.3.ova.sha256
gs://capv-images/release/v1.14.3/ubuntu-1804-kube-v1.14.3.ova
gs://capv-images/release/v1.14.3/ubuntu-1804-kube-v1.14.3.ova.sha256

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to put to a separate doc for "How to install the CAPV OVA in vSphere" that will be a pre-req for this, thoughts? Different from the one you linked since it will just be instructions for OVA download from google storage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andrewsykim,

I think a doc that is top-to-bottom from how to download Kind, get CAPV machine images, install as templates, run CAPV, etc. is needed. A single walk through.

Also, please say "CAPV machine image" instead of of OVA. I am going to open a PR to completely remove the installer directory so there's no longer any confusion about we mean when OVA is used. Still, since they're technically "machine images" that happen to be delivered as OVAs, let's be very clear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, I'll add a section on how to upload the CAPV machine images to vSphere.

@andrewsykim
Copy link
Member Author

IDE appears to line break in the middle of sentences

This is mainly to make reviewing the PR easier.

@akutz
Copy link
Contributor

akutz commented Jun 19, 2019

line break

It doesn't. You can see the line breaks in GH, and they don't break in a way that makes sense. GitHub and IDEs are able to soft-break, so let's maintain the standard in the community of no hard breaks except when beginning new paragraphs.

Thanks.

@andrewsykim
Copy link
Member Author

Good to know, thanks

@andrewsykim
Copy link
Member Author

Going to continue writing docs assuming we are going to use #330 since it removes the need to install kustomize and envsubst locally.

@andrewsykim andrewsykim force-pushed the bootstrap-cluster-docs branch 2 times, most recently from 7a8e5bc to ff9f6c2 Compare June 21, 2019 19:07
@andrewsykim
Copy link
Member Author

Comments addressed, PTAL

@andrewsykim andrewsykim force-pushed the bootstrap-cluster-docs branch 9 times, most recently from 88f0a28 to 6bb8d01 Compare June 25, 2019 00:44
@akutz
Copy link
Contributor

akutz commented Jun 25, 2019

/lgtm

Not sure why e2e is failing. No logs as far as I can tell. I wonder if the Prow cluster is having issues.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2019
@andrewsykim
Copy link
Member Author

/retest

2 similar comments
@andrewsykim
Copy link
Member Author

/retest

@andrewsykim
Copy link
Member Author

/retest

Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2019
@akutz
Copy link
Contributor

akutz commented Jun 25, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 25, 2019
@k8s-ci-robot k8s-ci-robot merged commit f537259 into kubernetes-sigs:master Jun 25, 2019
jayunit100 pushed a commit to jayunit100/cluster-api-provider-vsphere that referenced this pull request Feb 26, 2020
* [clusterawsadm] enable sharedconfig on the session

* Updates for getting started guide

* Update default manager image

* Fix issue with machine create and LB assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants