-
Notifications
You must be signed in to change notification settings - Fork 36
Adding Controller user's guide #77
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7d7c74f
Adding Controller user's guide
CsatariGergely afd20ba
Reformatting deployment checking command
CsatariGergely 677bf45
Apply suggestions from code review
CsatariGergely 9b070b4
Fixing environment variable name
CsatariGergely 818c756
Update content/en/docs/guides/user-guides/controllers.md
CsatariGergely 1cc43ea
Clarifications about the reconcilier interface
CsatariGergely 8f19d0a
Merge branch 'add-controller-guide' of github.com:nokia/nephio-docs i…
CsatariGergely File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
| title: Nephio controller user's guide | ||
| description: > | ||
|
|
||
| weight: 1 | ||
| --- | ||
|
|
||
| ## Reconcilers | ||
|
|
||
| [Reconcilers](https://kubebyexample.com/learning-paths/operator-framework/operator-sdk-go/controller-reconcile-function) | ||
| are used by Kubernetes to enforce the desired state of a Custom Resource (CR). | ||
|
|
||
| ## The Nephio Reconciler Interface | ||
|
|
||
| The Nephio Controller deploys multiple reconcilers and also supports pluggable reconcilers. To plug into the Nephio | ||
| controller, a reconciler must implement the | ||
| [nephio reconcilerinterface](https://github.com/nephio-project/nephio/tree/main/controllers/pkg/reconcilers/reconciler-interface). | ||
| Reconcilers register with the Nephio reconciler interface when they start up. | ||
|
|
||
| The reconcilers below are currently deployed by default in the nephio controller: | ||
|
|
||
| ```bash | ||
| ./controllers/pkg/reconcilers/token/reconciler.go | ||
| ./controllers/pkg/reconcilers/repository/reconciler.go | ||
| ./controllers/pkg/reconcilers/bootstrap-packages/reconciler.go | ||
| ./controllers/pkg/reconcilers/vlan-specializer/reconciler.go | ||
| ./controllers/pkg/reconcilers/generic-specializer/reconciler.go | ||
| ./controllers/pkg/reconcilers/network/reconciler.go | ||
| ./controllers/pkg/reconcilers/ipam-specializer/reconciler.go | ||
| ./controllers/pkg/reconcilers/bootstrap-secret/reconciler.go | ||
| ./controllers/pkg/reconcilers/approval/reconciler.go | ||
| ``` | ||
|
|
||
| ## Enabling Reconcilers | ||
|
|
||
| To enable a particular reconciler, you pass an environment variable to the | ||
| Nephio Controller at startup. The environment variable is of the form | ||
| `ENABLE_<RECONCILER>` where `<RECONCILER>` is the name of the reconciler to | ||
| be enabled in upper case. Therefore, to enable the `bootstrap-packages` reconciler, | ||
| pass the `ENABLE_BOOTSTRAPPACKAGES` to the nephio controller. Reconcilers are | ||
| disabled by default. | ||
|
|
||
| <details> | ||
| <summary>You can see what reconcilers are enabled on the Nephio Controller using | ||
| `kubectl`.</summary> | ||
|
|
||
| ```bash | ||
| $ kubectl describe pod -n nephio-system nephio-controller-6565fd695d-44kld | ||
|
|
||
| *** Truncated output *** | ||
|
|
||
| Name: nephio-controller-6565fd695d-44kld | ||
| Containers: | ||
| controller: | ||
| Container ID: containerd://37d3eff53c1944a659e5a7ab913173db42f34b44347072e6c9b51e5671f35ea2 | ||
| Environment: | ||
| POD_NAMESPACE: nephio-system (v1:metadata.namespace) | ||
| POD_IP: (v1:status.podIP) | ||
| POD_NAME: nephio-controller-6565fd695d-44kld (v1:metadata.name) | ||
| NODE_NAME: (v1:spec.nodeName) | ||
| NODE_IP: (v1:status.hostIP) | ||
| GIT_URL: http://172.18.0.200:3000 | ||
| GIT_NAMESPACE: gitea | ||
| ENABLE_APPROVAL: true | ||
| ENABLE_REPOSITORIES: true | ||
| ENABLE_BOOTSTRAPSECRETS: true | ||
| ENABLE_BOOTSTRAPPACKAGES: true | ||
| ENABLE_GENERICSPECIALIZER: true | ||
| ENABLE_NETWORKS: true | ||
| CLIENT_PROXY_ADDRESS: resource-backend-controller-grpc-svc.backend-system.svc.cluster.local:9999 | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| To check that the reconcilers are actually deployed, you can examine the logs | ||
| from the Nephio Controller. The log rolls over so you may need to redeploy the | ||
| Nephio Controller to see what reconcilers are being deployed. | ||
|
|
||
| ```bash | ||
| $ kubectl rollout restart deployment nephio-controller -n nephio-system | ||
|
|
||
| $ kubectl logs -n nephio-system nephio-controller-59487989bf-md845 --all-containers | \ | ||
| grep enable | ||
| 2023-06-27T11:37:58.646Z INFO setup enabled reconcilers {"reconcilers": "repositories,approval,bootstrappackages,bootstrapsecrets,genericspecializer,networks"} | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.