-
Notifications
You must be signed in to change notification settings - Fork 1.8k
doc: clean up README and user-guide #661
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
Conversation
260164d
to
036411b
Compare
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 cosmetic nits and one addition.
README.md
Outdated
|
||
The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases. | ||
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future. |
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 shouldn't mention controller-runtime before defining what it is below, or link it up here too.
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 add a quick note what alpha
means? There were questions about this on slack. See #608
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.
There is talk about adding api breaking changes to the controller-runtime see just an FYI
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.
@estroz I'm going to link it up here.
@shawn-hurley Thanks for pointing that out. That's why I used the phrase "most likely" but I'll try to make it clearer that there could still be breaking changes. Just hopefully nothing on the scale of what we're doing now. Most likely just function signature changes.
@lilic Alpha and beta are usually defined in the context of testing and missing features(and I might be wrong) but here's my understanding:
- Alpha: Some features may still be missing(e.g metrics, csv generation) and incompatible changes may still be made.
- Beta: All the features have been added and no backward incompatible changes will be made. Only changes expected are bug fixes.
I'll add a note on that.
|
||
To learn more about the operator-sdk, see the [user guide][guide]. | ||
The SDK also supports developing an operator using Ansible. See the [Ansible operator user guide][ansible_user_guide]. |
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 would add a note about this in the Workflow section as well. Perhaps @shawn-hurley or another Ansible-focused team member could write a workflow in this or a separate PR.
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 think we will add a follow up PR just to keep it easy
README.md
Outdated
- High level APIs and abstractions to write the operational logic more intuitively | ||
- Tools for scaffolding and code generation to bootstrap a new project fast | ||
- Extensions to cover common operator use cases | ||
|
||
## Workflow | ||
|
||
The SDK provides the following workflow to develop a new operator: | ||
The SDK provides the following workflow to develop a new operator in Go: |
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.
The SDK provides the following workflow to develop a new operator in Go: | |
The SDK provides workflows to develop operators in Go or Ansible. | |
The following workflow is for a new Go operator: |
doc/user-guide.md
Outdated
For this example replace the generated controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation. | ||
This will scaffold a new Controller implementation under `pkg/controller/memcached/...`. | ||
|
||
For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation. |
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.
For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [memcached_controller.go][memcached_controller] implementation. | |
For this example replace the generated Controller file `pkg/controller/memcached/memcached_controller.go` with the example [`memcached_controller.go`][memcached_controller] implementation. |
doc/user-guide.md
Outdated
@@ -135,7 +139,7 @@ err := c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequest | |||
|
|||
### Reconcile loop | |||
|
|||
Every controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the `Request` argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache: | |||
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [Request][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache: |
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.
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [Request][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache: | |
Every Controller has a Reconciler object with a `Reconcile()` method that implements the reconcile loop. The reconcile loop is passed the [`Request`][request-go-doc] argument which is a Namespace/Name key used to lookup the primary resource object, Memcached, from the cache: |
doc/user-guide.md
Outdated
@@ -146,7 +150,8 @@ func (r *ReconcileMemcached) Reconcile(request reconcile.Request) (reconcile.Res | |||
} | |||
``` | |||
|
|||
Based on the return value of `Reconcile()` the reconcile `Request` may be requeued and the loop may be triggered again: | |||
Based on the return values, [Result][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again: |
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.
Based on the return values, [Result][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again: | |
Based on the return values, [`Result`][result_go_doc] and error, the `Request` may be requeued and the reconcile loop may be triggered again: |
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.
lgtm overall
README.md
Outdated
|
||
The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases. | ||
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future. |
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 add a quick note what alpha
means? There were questions about this on slack. See #608
- [kubectl][kubectl_tool] version v1.10.0+. | ||
- Access to a kubernetes v.1.10.0+ cluster. | ||
- [kubectl][kubectl_tool] version v1.11.0+. | ||
- Access to a kubernetes v.1.11.0+ cluster. |
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.
How come it doesn't work on v.1.10.0
clusters anymore?
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 should work on v1.10, but we don't test v1.10 anymore, only v1.11 (technically openshift v3.11)
doc/user-guide.md
Outdated
@@ -61,7 +61,7 @@ By default this will be the namespace that the operator is running in. To watch | |||
mgr, err := manager.New(cfg, manager.Options{Namespace: ""}) | |||
``` | |||
|
|||
**// TODO:** Doc on manager options(Sync period, leader election, registering 3rd party types) | |||
**// TODO:** Doc on leader election |
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.
Nit: I would prefer opening an issue for documentation on leader election rather than having it in the README.
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 would also like that we start publishing our API's on godoc and link to our docs there.
IIRC @mhrivnak added package level docs that were pretty extensive and I think that might be the correct way to document usage of packages. 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.
@shawn-hurley Agreed all of our APIs should have sufficient godocs. The leader election package is already quite well documented but the ToDo I have here is for an example on how to use our leader election pkg in the manager. And also an example on how to use the runtime's leader election pkg for comparison.
So either a separate doc that goes over both of those and links to the releavant godocs. Or we add the example to the godoc.
Either way I've created an issue for that #665
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.
Just some thoughts and suggestions. LGTM though
README.md
Outdated
|
||
The project is currently pre-alpha and it is expected that breaking changes to the API will be made in the upcoming releases. | ||
The project is currently alpha. The core APIs provided by the controller-runtime will most likely be unchanged. New features and APIs may still be added in the future. |
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.
There is talk about adding api breaking changes to the controller-runtime see just an FYI
|
||
To learn more about the operator-sdk, see the [user guide][guide]. | ||
The SDK also supports developing an operator using Ansible. See the [Ansible operator user guide][ansible_user_guide]. |
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 think we will add a follow up PR just to keep it easy
doc/user-guide.md
Outdated
@@ -61,7 +61,7 @@ By default this will be the namespace that the operator is running in. To watch | |||
mgr, err := manager.New(cfg, manager.Options{Namespace: ""}) | |||
``` | |||
|
|||
**// TODO:** Doc on manager options(Sync period, leader election, registering 3rd party types) | |||
**// TODO:** Doc on leader election |
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 would also like that we start publishing our API's on godoc and link to our docs there.
IIRC @mhrivnak added package level docs that were pretty extensive and I think that might be the correct way to document usage of packages. Thoughts?
Addressed the above comments. PTAL. |
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.
lgtm
Description of the change:
README:
user-guide: