You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The versions which are defined in the `Makefile` and `go.mod` files are the versions tested and therefore is recommend to use the specified versions.
24
+
The versions which are defined in the `Makefile` and `go.mod` files are the versions tested and therefore is recommended to use the specified versions.
25
25
26
26
</aside>
27
27
@@ -91,7 +91,7 @@ and the `internal/controllers/guestbook_controller.go` where the reconciliation
91
91
logic. For more info see [Designing an API](/cronjob-tutorial/api-design.md) and [What's in
92
92
a Controller](cronjob-tutorial/controller-overview.md).
93
93
94
-
If you are editing the API definitions, generate the manifests such as Custom Resources (CRs) or Custom Resource Defintions (CRDs) using
94
+
If you are editing the API definitions, generate the manifests such as Custom Resources (CRs) or Custom Resource Definitions (CRDs) using
Copy file name to clipboardExpand all lines: docs/book/src/reference/good-practices.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ Building your operator commonly involves extending the Kubernetes API itself. It
18
18
19
19
Additionally, we recommend checking the documentation on [Operator patterns][operator-pattern] from Kubernetes to better understand the purpose of the standard solutions built with KubeBuilder.
20
20
21
-
## Why you should adhere to the k8s API conventions and standards
21
+
## Why you should adhere to the Kubernetes API conventions and standards
22
22
23
-
Embracing the [Kubernetes API conventions and standards][k8s-api-convetions] is crucial for maximizing the potential of your applications and deployments. By adhering to these established practices, you can benefit in several ways.
23
+
Embracing the [Kubernetes API conventions and standards][k8s-api-conventions] is crucial for maximizing the potential of your applications and deployments. By adhering to these established practices, you can benefit in several ways.
24
24
25
25
Firstly, adherence ensures seamless interoperability within the Kubernetes ecosystem. Following conventions allows your applications to work harmoniously with other components, reducing compatibility issues and promoting a consistent user experience.
26
26
@@ -57,7 +57,7 @@ These challenges underline the importance of assigning each controller the singl
57
57
58
58
## Why You Should Adopt Status Conditions
59
59
60
-
We recommend you manage your solutions using Status Conditionals following the [K8s Api conventions][k8s-aoi-convetions] because:
60
+
We recommend you manage your solutions using Status Conditionals following the [K8s Api conventions][k8s-api-conventions] because:
61
61
62
62
-**Standardization**: Conditions provide a standardized way to represent the state of an Operator's custom resources, making it easier for users and tools to understand and interpret the resource's status.
63
63
-**Readability**: Conditions can clearly express complex states by using a combination of multiple conditions, making it easier for users to understand the current state and progress of the resource.
@@ -75,10 +75,13 @@ Therefore, you can check an example of Status Conditional usage by looking at it
Copy file name to clipboardExpand all lines: docs/book/src/reference/raising-events.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,13 @@ type MyKindReconciler struct {
75
75
// See that we added the following code to allow us to pass the record.EventRecorder
76
76
Recorder record.EventRecorder
77
77
}
78
+
```
79
+
78
80
### Passing the EventRecorder to the Controller
81
+
79
82
Events are published from a Controller using an [EventRecorder]`type CorrelatorOptions struct`,
80
83
which can be created for a Controller by calling `GetRecorder(name string)` on a Manager. See that we will change the implementation scaffolded in `cmd/main.go`:
84
+
81
85
```go
82
86
if err = (&controller.MyKindReconciler{
83
87
Client: mgr.GetClient(),
@@ -89,15 +93,18 @@ which can be created for a Controller by calling `GetRecorder(name string)` on a
89
93
os.Exit(1)
90
94
}
91
95
```
96
+
92
97
### Granting the required permissions
93
98
94
99
You must also grant the RBAC rules permissions to allow your project to create Events. Therefore, ensure that you add the [RBAC][rbac-markers] into your controller:
Copy file name to clipboardExpand all lines: docs/book/src/reference/watching-resources/operator-managed.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,11 @@ Managing dependency resources is fundamental to a controller, and it's not possi
10
10
- ReplicaSets must know when their Pods are deleted, or change from healthy to unhealthy.
11
11
12
12
Through the `Owns()` functionality, Controller Runtime provides an easy way to watch dependency resources for changes.
13
+
A resource can be defined as dependent on another resource through the 'ownerReferences' field.
13
14
14
15
As an example, we are going to create a `SimpleDeployment` resource.
15
16
The `SimpleDeployment`'s purpose is to manage a `Deployment` that users can change certain aspects of, through the `SimpleDeployment` Spec.
16
-
The `SimpleDeployment` controller's purpose is to make sure that it's owned `Deployment` always uses the settings provided by the user.
17
+
The `SimpleDeployment` controller's purpose is to make sure that it's owned `Deployment`(has an ownerReference which points to `SimpleDeployment` resource) always uses the settings provided by the user.
0 commit comments