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: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ See the [design docs][design_docs] for planned work on upcoming milestones:
10
10
11
11
## Overview
12
12
13
-
[Operators][operator_link] make it easy to manage complex stateful applications on top of Kuberentes. However writing an operator today can be a significant effort that involves challenges like using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication.
13
+
[Operators][operator_link] make it easy to manage complex stateful applications on top of Kubernetes. However writing an operator today can be a significant effort that involves challenges like using low level APIs, writing boilerplate, and a lack of modularity which leads to duplication.
14
14
15
15
The Operator SDK is a framework designed to make writing operators easier by providing:
16
16
- High level APIs and abstractions to write the operational logic more intuitively
@@ -21,7 +21,7 @@ The Operator SDK is a framework designed to make writing operators easier by pro
21
21
22
22
The SDK provides the following workflow to develop a new operator:
23
23
1. Create a new operator project using the SDK Command Line Interface(CLI)
24
-
2. Define new resource APIs by adding CRDs and specifying fields
24
+
2. Define new resource APIs by adding Custom Resource Definitions(CRD)
25
25
3. Specify resources to watch using the SDK API
26
26
4. Define the operator reconciling logic in a designated handler and use the SDK API to interact with resources
27
27
5. Use the SDK CLI to build and generate the operator deployment manifests
@@ -54,41 +54,41 @@ Before creating any project, this guide has the following prerequisites:
54
54
55
55
## Installing Operator SDK CLI
56
56
57
-
Operator SDK CLI tool is used to manage development lifecycle.
57
+
The Operator SDK comes with a CLI tool that manages the development lifecycle. It helps create the project scaffolding, preprocess custom resource API to generate Kubernetes related code, and generate deployment scripts.
58
58
59
59
Checkout the desired release tag and install the SDK CLI tool:
60
60
```
61
61
git checkout tags/v0.0.1
62
62
go install github.com/coreos/operator-sdk/commands/operator-sdk
63
63
```
64
64
65
-
## Creating a new project
65
+
This will install the CLI binary `operator-sdk` at `$GOPATH/bin`.
66
66
67
-
Operator SDK comes with a number of code generators that are designed to facilitate development lifecycle. It helps create the project scaffolding, preprocess custom resource API to generate Kubernetes related code, generate deployment scripts -- just everything that is necessary to build an operator.
67
+
## Creating a new project
68
68
69
69
Navigate to `$GOPATH/src/github.com/example-inc/`.
70
70
71
-
To start a project, we use the `new`generator to provide the foundation of a fresh operator project. Run the following command:
71
+
Use the `new`command to create a new operator project:
72
72
73
73
```
74
74
operator-sdk new memcached-operator --api-version=cache.example.com/v1alpha1 --kind=Memcached
75
75
```
76
76
77
-
This generates a project repo`memcached-operator`, a custom resource with APIVersion `cache.example.com/v1apha1` and Kind `Memcached`, and an example operator that watches all deployments in the same namespace and logs deployment names.
77
+
This creates the project directory`memcached-operator` and generates the API pkg tree for a custom resource with APIVersion `cache.example.com/v1apha1` and Kind `Memcached`.
78
78
79
79
Navigate to the project folder:
80
80
81
81
```
82
82
cd memcached-operator
83
83
```
84
84
85
-
More details about the structure of the project can be found in [this doc][scaffold_doc].
85
+
More details about the project directory structure can be found in the [project layout][scaffold_doc] doc.
86
86
87
87
## Up and running
88
88
89
-
At this step we actually have a functional operator already.
89
+
At this point we are ready to build and run a functional operator.
90
90
91
-
The default operator behaviour as seen in the entrypoint`cmd/memcached-operator/main.go` is to watch for Deployments in the default namespace and print out their names.
91
+
The default operator behaviour defined in the entry point`cmd/memcached-operator/main.go` is to watch for Deployments in the default namespace and print out their names.
92
92
93
93
> Note: This example watches Deployments for the APIVersion `apps/v1` which is only present in k8s versions 1.9+. So for k8s versions < 1.9 change the APIVersion to something that is supported e.g `apps/v1beta1`.
0 commit comments