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
Copy file name to clipboardExpand all lines: modules/osdk-golang-implement-controller.adoc
+204-3Lines changed: 204 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,210 @@ After creating a new API and controller, you can implement the controller logic.
9
9
10
10
.Procedure
11
11
12
-
* For this example, replace the generated controller file `controllers/memcached_controller.go` with the `memcached_controller.go` link:https://github.com/operator-framework/operator-sdk/blob/v1.3.0/testdata/go/v2/memcached-operator/controllers/memcached_controller.go[example implementation].
12
+
* For this example, replace the generated controller file `controllers/memcached_controller.go` with following example implementation:
13
+
+
14
+
.Example `memcached_controller.go`
15
+
[%collapsible]
16
+
====
17
+
[source,golang]
18
+
----
19
+
/*
20
+
Copyright 2020.
21
+
22
+
Licensed under the Apache License, Version 2.0 (the "License");
23
+
you may not use this file except in compliance with the License.
24
+
You may obtain a copy of the License at
25
+
26
+
http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+
Unless required by applicable law or agreed to in writing, software
29
+
distributed under the License is distributed on an "AS IS" BASIS,
30
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+
See the License for the specific language governing permissions and
The example controller runs the following reconciliation logic for each `Memcached` custom resource (CR):
15
218
+
@@ -18,5 +221,3 @@ The example controller runs the following reconciliation logic for each `Memcach
18
221
* Ensure that the deployment size is the same as specified by the `Memcached` CR spec.
19
222
* Update the `Memcached` CR status with the names of the `memcached` pods.
20
223
--
21
-
22
-
The next subsections explain how the controller watches resources and how the reconcile loop is triggered. You can skip these subsections to go directly to building and running the Operator.
Copy file name to clipboardExpand all lines: modules/osdk-run-deployment.adoc
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,11 +58,6 @@ $ make deploy IMG=<registry>/<user>/<image_name>:<tag>
58
58
----
59
59
+
60
60
By default, this command creates a namespace with the name of your Operator project in the form `<project_name>-system` and is used for the deployment. This command also installs the RBAC manifests from `config/rbac`.
61
-
+
62
-
[NOTE]
63
-
====
64
-
If you enabled webhooks in your deployments, you must have `cert-manager` already installed in the cluster or the `make deploy` command will fail when it attempts to create the `cert-manager` resources.
- See xref:../../../operators/operator_sdk/ansible/osdk-ansible-project-layout.adoc#osdk-ansible-project-layout_osdk-ansible-project-layout[Appendices] to learn about the project directory structures created by the Operator SDK.
43
+
- See xref:../../../operators/operator_sdk/ansible/osdk-ansible-project-layout.adoc#osdk-ansible-project-layout[Project layout for Ansible-based Operators] to learn about the directory structures created by the Operator SDK.
The next subsections explain how the controller in the example implementation watches resources and how the reconcile loop is triggered. You can skip these subsections to go directly to xref:../../../operators/operator_sdk/golang/osdk-golang-tutorial.adoc#osdk-run-operator_osdk-golang-tutorial[Running the Operator].
- See xref:../../../operators/operator_sdk/golang/osdk-golang-project-layout.adoc#osdk-golang-project-layout_osdk-golang-project-layout[Appendices] to learn about the project directory structures created by the Operator SDK.
53
+
- See xref:../../../operators/operator_sdk/golang/osdk-golang-project-layout.adoc#osdk-golang-project-layout[Project layout for Go-based Operators] to learn about the directory structures created by the Operator SDK.
- See xref:../../../operators/operator_sdk/helm/osdk-helm-project-layout.adoc#osdk-helm-project-layout_osdk-helm-project-layout[Appendices] to learn about the project directory structures created by the Operator SDK.
45
+
- See xref:../../../operators/operator_sdk/helm/osdk-helm-project-layout.adoc#osdk-helm-project-layout[Project layout for Helm-based Operators] to learn about the directory structures created by the Operator SDK.
0 commit comments