-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Initial draft GitBook. #566
Conversation
|
||
{% sample lang="go" %} | ||
```go | ||
// MachineTemplateSpec describes the data a machine should have when created from a template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/a machine should have when created from a template/needed to create a Machine from a template/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with my latest commit.
docs/book/provider_implementations/building_running_and_testing.md
Outdated
Show resolved
Hide resolved
Remaining tasks which may or may not be dealt with within this PR: #571 @phyber, @randomvariable, @hardikdr, @oneilcin, @detiber, @chuckha, @kris-nova |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments and questions, but overall this is outstanding work!
{% sample lang="go" %} | ||
```go | ||
// MachineStatus defines the observed state of Machine | ||
type MachineStatus struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some tooling to sync these structs with the current versions? If not, we may want to track that as a followup item to avoid drift.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that duplicating this code is a Bad Idea (tm). I've found two GitBook plugins which support including code snippets: include-codeblock and snippet. Both of them assume Doxygen markers, which seems reasonable to me. If we are okay with adding those to the source I'll take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully those play well with the code generation.... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include-codebook
is more popular (29 vs 2 stars, 22 vs 2 forks) and has seen more recent development (though not by much).
As an example, with this code change:
diff --git a/pkg/apis/cluster/v1alpha1/machinedeployment_types.go b/pkg/apis/cluster/v1alpha1/machinedeployment_types.go
index d3017c05d..e27c880da 100644
--- a/pkg/apis/cluster/v1alpha1/machinedeployment_types.go
+++ b/pkg/apis/cluster/v1alpha1/machinedeployment_types.go
@@ -23,6 +23,7 @@ import (
"sigs.k8s.io/cluster-api/pkg/apis/cluster/common"
)
+/// [marker0]
// MachineDeploymentSpec defines the desired state of MachineDeployment
type MachineDeploymentSpec struct {
// Number of desired machines. Defaults to 1.
@@ -67,6 +68,9 @@ type MachineDeploymentSpec struct {
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSteeconds,omitempty"`
}
+/// [marker0]
The coresponding markdown looks like this:
{% method %}
## MachineDeploymentSpec
{% sample lang="go" %}
[import:'marker0'](../../../pkg/apis/cluster/v1alpha1/machinedeployment_types.go)
{% endmethod %}
So the resulting markdown is both less readable and more accurate...
`Cluster` in the same namespace as the `Machine` | ||
|
||
There are two consequences of this: | ||
- There must be at exactly one `Cluster` per namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest rewording this to say "There must no be more than one Cluster
per namespace". The current wording seems to suggest that namespaces without a cluster
would also be problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This is poorly worded.
For the machine actuator, I think we do require exactly one Cluster
in the same namespace as the Machine
:
func (c *ReconcileMachine) getCluster(machine *clusterv1.Machine) (*clusterv1.Cluster, error) { |
#177 and #490 both discuss removing this restriction.
Maybe I should add informational panels to document these open issues.
# Generate manifests e.g. CRD, RBAC etc. | ||
manifests: | ||
- go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all | ||
+ go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably isn't ideal. Ideally we'd be able to leverage more of the auto generation from kubebuilder. For the AWS implementation we disabled most of it for expedience as we were working on break-fix after the initial CRD migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documenting the current state is a good idea though, because it points out these rough edges. I agree that we should fix. Let's file an issue (and it might even be a decent getting started issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @pwittrock |
at any time with the Namespace and Name of an object (Resource instance), | ||
and it will make the cluster state match the state declared in the object | ||
Spec. Upon completion, Reconcile updates the object Status to the new actual | ||
state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Reconcile function fails to update the actual state, ...
|
||
{% panel style="warning", title="Important" %} | ||
Does it make sense to identify a simple provider which may be easier to get | ||
started with? Is that possible in a vendor neutral way? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not possible in a vendor neutral way. I think the best bet is to point to the list above and tell people to use the one for the environment that they want to be running in.
# Generate manifests e.g. CRD, RBAC etc. | ||
manifests: | ||
- go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go all | ||
+ go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go crd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documenting the current state is a good idea though, because it points out these rough edges. I agree that we should fix. Let's file an issue (and it might even be a decent getting started issue).
docs/book/provider_implementations/building_running_and_testing.md
Outdated
Show resolved
Hide resolved
|
||
```bash | ||
minikube start | ||
make deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat, I haven't actually tried this. Good to see that someone has.
# Repository Naming | ||
|
||
The naming convention for new Cluster API [_provider_ repositories][repo-naming] | ||
is generally of the form `cluster-api-provider-${cloud}`, where `${cloud}` is a, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of "cloud" I've been using the term "environment". A cloud is one type of environment, as vsphere or openstack or bare metal (of which there are probably lots of variants).
Thanks for getting started on the docs. This looks great! |
This is looking great. 👍 |
Awesome stuff @davidewatson! Thank you for picking this up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Bunch of minor comments.
|
||
Cluster has 4 fields: | ||
|
||
`Spec` contains the desired cluster state specified by the object. While much |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a little clearer if the order here matched the order they appeared in the struct below. I think a personal preference is to put the struct first then the explanation after, but I think this ordering works as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking more about this, I am not sure I agree. By placing the Spec
and Status
descriptions first aren't we are emphasizing the portion of the API which matters most to the implementor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can see it both ways, totally fine to keep it as is
```go | ||
// MachineSpec defines the desired state of Machine | ||
type MachineSpec struct { | ||
// This ObjectMeta will autopopulate the Node created. Use this to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened a cluster-api issue since these have golint issues: #570
This looks pretty great. For remaining tasks, we can track these in an "UMBRELLA: Gitbook" issue. Just as a test, was able to get this to push to Github pages. Would require renaming the current docs directory to work. |
@randomvariable: I like the features of firebase, and see some value in maintaining consistency with kubebuilder, but gh-pages are free and therefore more likely to be replicated by other kubebuilder projects. Maybe we can discuss briefly tomorrow and make a decision. |
I have updated the deployment instructions. Once this is merged someone with admin privileges will need to:
/assign @roberthbailey |
I'm happy to approve once someone lgtm's this who has reviewed it somewhat carefully (I took a quick pass on the docs but from the call today it sounded like other folks had done a much better job reviewing them than I have). |
/test pull-cluster-api-test |
docs/book/_book/GLOSSARY.html
Outdated
<meta name="description" content=""> | ||
<meta name="generator" content="GitBook 3.2.3"> | ||
<meta name="author" content="SIG Lifecycle Team"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of the excessive number of empty lines in these html files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything under docs/book/_book/
is rendered so we would have to fix GitBook if we wanted to make their removal permanent...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is strange. Maybe there is a stray new line (or two!) somewhere. I'll look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you aware of this discussion on gitbook's future as an open source project:
GitbookIO/gitbook#1808
GitbookIO/gitbook#2148
it seems the new version does not support self-hosting anymore
https://docs.gitbook.com/v2-changes/important-differences
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be we that we have to or should migrate to netlify in the future. @timothysc suggested this last week since it is what k8s uses.
If we do it might also be nice to migrate kubebuilder as well. I am unsure if there is interest on that front but I think there is value in leveraging kubebuilder to the extent possible since this will make it easier for others to create high quality CRDs. @pwittrock
For now I'd like to get this merged so that we can parallize and iterate. @detiber, @roberthbailey, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to block this now, but it'll definitely be worth tracking it for later followup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for merging, I didn't intend to block this, content is more important than the tool
k8s documentation is written in markdown, processed using Hugo and served using netlify
https://kubernetes.io/docs/contribute/start/#the-basics-about-our-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the link!
/assign @detiber |
/lgtm |
Let's get this in and we can iterate from there. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davidewatson, roberthbailey 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 |
/test pull-cluster-api-test |
I tried to follow the instructions above to push to a branch to serve on gh pages but it didn't work:
Thoughts? |
Usually git subtree comes in the
|
My guess is either the
The instructions I found for installing |
@davidewatson - I gave you write access to the repo; can you run the git subtree commands and get the branch pushed? I have a google-installed version of git and don't feel like breaking it right now to get the subtree command working via brew. :) |
…const use govmomi types.VirtualEthernetCardMacType for NIC address type
What this PR does / why we need it:
The Cluster API has seen a fair number of changes over the course of the past year. At the same time, there has been a significant increase in the number of providers. Clear developer documentation is needed in order to make implementation easier and maintain consistent behavior.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Begins to fix #505
Special notes for your reviewer:
I am going to push the generated code in a second commit for ease of review. It may also make sense for me to break this up further to both obtain consensus for this PR, and facilitate further writing.
To view this GitBook locally while we sort out which account will be used to serve the final product, you may install GitBook and then:
You may then view the book locally
open http://localhost:4000
...Release note: