File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,18 @@ memcached-operator 1 1 1 1 1m
113
113
114
114
### Create a Memcached CR
115
115
116
- Run the following command to create a ` Memcached ` custom resource:
116
+ Modify ` deploy/cr.yaml ` as shown and create a ` Memcached ` custom resource:
117
117
118
118
``` sh
119
- $ cat << EOF | kubectl apply -f -
119
+ $ cat deploy/cr.yaml
120
120
apiVersion: " cache.example.com/v1alpha1"
121
121
kind: " Memcached"
122
122
metadata:
123
123
name: " example-memcached"
124
124
spec:
125
125
size: 3
126
- EOF
126
+
127
+ $ kubectl apply -f deploy/cr.yaml
127
128
```
128
129
129
130
Ensure that the memcached-operator creates the deployment for the CR:
@@ -170,10 +171,18 @@ status:
170
171
171
172
### Update the size
172
173
173
- Change the ` spec.size ` field in the memcached CR from 3 to 4:
174
+ Change the ` spec.size ` field in the memcached CR from 3 to 4 and apply the change :
174
175
175
176
``` sh
176
- $ kubectl get memcached/example-memcached -o yaml | sed ' s|size: 3|size: 4|g' | kubectl apply -f -
177
+ $ cat deploy/cr.yaml
178
+ apiVersion: " cache.example.com/v1alpha1"
179
+ kind: " Memcached"
180
+ metadata:
181
+ name: " example-memcached"
182
+ spec:
183
+ size: 4
184
+
185
+ $ kubectl apply -f deploy/cr.yaml
177
186
```
178
187
179
188
Confirm that the operator changes the deployment size:
@@ -189,7 +198,7 @@ example-memcached 4 4 4 4 5m
189
198
Clean up the resources:
190
199
191
200
``` sh
192
- $ kubectl delete memcached example-memcached
201
+ $ kubectl delete -f deploy/cr.yaml
193
202
$ kubectl delete -f deploy/operator.yaml
194
203
```
195
204
You can’t perform that action at this time.
0 commit comments