Skip to content

Commit f9ffd1b

Browse files
authored
Merge pull request #153 from hasbro17/haseeb/user-guide-uses-deploy-cr
user_guide: use deploy/cr.yaml to create/update CR
2 parents 038c307 + d8172ad commit f9ffd1b

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

doc/milestone/user_guide.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,18 @@ memcached-operator 1 1 1 1 1m
113113

114114
### Create a Memcached CR
115115

116-
Run the following command to create a `Memcached` custom resource:
116+
Modify `deploy/cr.yaml` as shown and create a `Memcached` custom resource:
117117

118118
```sh
119-
$ cat <<EOF | kubectl apply -f -
119+
$ cat deploy/cr.yaml
120120
apiVersion: "cache.example.com/v1alpha1"
121121
kind: "Memcached"
122122
metadata:
123123
name: "example-memcached"
124124
spec:
125125
size: 3
126-
EOF
126+
127+
$ kubectl apply -f deploy/cr.yaml
127128
```
128129

129130
Ensure that the memcached-operator creates the deployment for the CR:
@@ -170,10 +171,18 @@ status:
170171

171172
### Update the size
172173

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:
174175

175176
```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
177186
```
178187

179188
Confirm that the operator changes the deployment size:
@@ -189,7 +198,7 @@ example-memcached 4 4 4 4 5m
189198
Clean up the resources:
190199

191200
```sh
192-
$ kubectl delete memcached example-memcached
201+
$ kubectl delete -f deploy/cr.yaml
193202
$ kubectl delete -f deploy/operator.yaml
194203
```
195204

0 commit comments

Comments
 (0)