Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

Commit 2b3dc24

Browse files
authored
Merge branch 'master' into master
2 parents 7740c3f + 9821610 commit 2b3dc24

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide shows how to build a simple Memcached Operator and how to manage its
66
* **Operator SDK**: Allows your developers to build an Operator based on your expertise without requiring knowledge of Kubernetes API complexities.
77
* **Operator Lifecycle Manager**: Helps you to install, update, and generally manage the lifecycle of all of the Operators (and their associated services) running across your clusters.
88

9-
> **Requirements**: Please make sure that both the [Operator SDK][operator_sdk] and [Operator Lifecycle Manager][operator_lifecycle_manager] are installed before running this guide. The guide also requires deployment to a Kubernetes cluster on release 1.8 or above to support the apps/v1beta2 API group and version.
9+
> **Requirements**: Please make sure that the [Operator SDK][operator_sdk] is installed on the development machine. Additionally, the [Operator Lifecycle Manager][operator_lifecycle_manager] must be installed in the cluster (1.8 or above to support the apps/v1beta2 API group) before running this guide.
1010
1111
## Build an Operator using the Operator SDK
1212

@@ -111,15 +111,15 @@ $ kubectl delete -f deploy/rbac.yaml
111111
```
112112
## Manage the Operator using the Operator Lifecycle Manager
113113

114-
The previous section has covered manually running an Operator. In the next sections, we will explore using the Operator Lifecycle Manager which is what enables a more robust deployment model for Operators being ran in production environments.
114+
The previous section has covered manually running an Operator. In the next sections, we will explore using the Operator Lifecycle Manager which is what enables a more robust deployment model for Operators being run in production environments.
115115

116116
The Operator Lifecycle Manager helps you to install, update, and generally manage the lifecycle of all of the Operators (and their associated services) on a Kubernetes cluster. It runs as an Kubernetes extension and lets you use `kubectl` for all the lifecycle management functions without any additional tools.
117117

118118
### Generate an Operator manifest
119119

120120
The first step to leveraging the Operator Lifecycle Manager is to create a manifest. An Operator manifest describes how to display, create and manage the application, in this case Memcached, as a whole. It is required for the Operator Lifecycle Manager to function.
121121

122-
For the purpose of this guide, we will continue with this predefined manifest file for the next steps. If you’d like, you can alter the image field within this manifest to reflect the image you built in previous steps, but it is unnecessary. In the future, the Operator SDK CLI will generate an Operator manifest for you, a feature that is planned for the next release of the Operator SDK.
122+
For the purpose of this guide, we will continue with this [predefined manifest][manifest_v1] file for the next steps. If you’d like, you can alter the image field within this manifest to reflect the image you built in previous steps, but it is unnecessary. In the future, the Operator SDK CLI will generate an Operator manifest for you, a feature that is planned for the next release of the Operator SDK.
123123

124124
### Deploy the Operator
125125

@@ -131,7 +131,7 @@ $ kubectl apply -f memcachedoperator.0.0.1.csv.yaml
131131
$ kubectl get ClusterServiceVersion-v1s memcachedoperator.v0.0.1 -o json | jq '.status'
132132
```
133133

134-
After applying this manifest, nothing has happened yet, because the cluster does not met the requirements specified in our manifest. Create the CustomResourceDefinition and RBAC rules for the Memcached type managed by the Operator:
134+
After applying this manifest, nothing has happened yet, because the cluster does not meet the requirements specified in our manifest. Create the CustomResourceDefinition and RBAC rules for the Memcached type managed by the Operator:
135135

136136
```sh
137137
$ kubectl apply -f deploy/rbac.yaml
@@ -176,9 +176,9 @@ memcached-for-wordpress-65b75fd8c9-7b9x7 1/1 Running 0 8s
176176

177177
### Update an application
178178

179-
Manually applying an update to the Operator is as simple as editing the initially applied Operator manifest and applying it to the cluster. The Operator Lifecycle Manager will ensure that all resources being managed by the old Operator have their ownership moved to the new Operator without fear of any programs stopping execution. It is up to the Operators themselves to execute any data migrations required to upgrade resources to run under a new version of the Operator.
179+
Manually applying an update to the Operator is as simple as creating a new Operator manifest with a `replaces` field that references the old Operator manifest. The Operator Lifecycle Manager will ensure that all resources being managed by the old Operator have their ownership moved to the new Operator without fear of any programs stopping execution. It is up to the Operators themselves to execute any data migrations required to upgrade resources to run under a new version of the Operator.
180180

181-
The following command demonstrates applying a new Operator manifest using a new version of the Operator and shows that the pods remain executing:
181+
The following command demonstrates applying a new [manifest_v2][Operator manifest] using a new version of the Operator and shows that the pods remain executing:
182182

183183
```sh
184184
$ curl -Lo memcachedoperator.0.0.2.csv.yaml https://raw.githubusercontent.com/operator-framework/getting-started/master/memcachedoperator.0.0.2.csv.yaml
@@ -204,4 +204,6 @@ Hopefully, this guide was an effective demonstration of the value of the Operato
204204
[kubernetes_cr]: https://kubernetes.io/docs/concepts/api-extension/custom-resources/
205205
[handler_go]: https://github.com/operator-framework/getting-started/blob/master/handler.go.tmpl#L7
206206
[create_public_image]: https://quay.io/new/
207+
[manifest_v1]: memcachedoperator.0.0.1.csv.yaml
208+
[manifest_v2]: memcachedoperator.0.0.2.csv.yaml
207209
[mailing_list]: https://groups.google.com/forum/#!forum/operator-framework

handler.go.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import (
66

77
v1alpha1 "github.com/example-inc/memcached-operator/pkg/apis/cache/v1alpha1"
88

9-
"github.com/coreos/operator-sdk/pkg/sdk/action"
10-
"github.com/coreos/operator-sdk/pkg/sdk/handler"
11-
"github.com/coreos/operator-sdk/pkg/sdk/query"
12-
"github.com/coreos/operator-sdk/pkg/sdk/types"
9+
"github.com/operator-framework/operator-sdk/pkg/sdk/action"
10+
"github.com/operator-framework/operator-sdk/pkg/sdk/handler"
11+
"github.com/operator-framework/operator-sdk/pkg/sdk/query"
12+
"github.com/operator-framework/operator-sdk/pkg/sdk/types"
1313
appsv1 "k8s.io/api/apps/v1"
1414
"k8s.io/api/core/v1"
1515
apierrors "k8s.io/apimachinery/pkg/api/errors"

0 commit comments

Comments
 (0)