Skip to content

Commit 1b46178

Browse files
Address review feedback #2
Signed-off-by: rashmigottipati <[email protected]>
1 parent 50ba1dd commit 1b46178

File tree

1 file changed

+43
-13
lines changed
  • website/content/en/docs/upgrading-sdk-version

1 file changed

+43
-13
lines changed

website/content/en/docs/upgrading-sdk-version/v1.6.0.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To add this option your project you will need to:
1515
- manager_config_patch.yaml
1616
```
1717
- Update the `config/manager/kustomization.yaml` by adding:
18-
```yaml
18+
```yaml
1919
generatorOptions:
2020
disableNameSuffixHash: true
2121
@@ -29,14 +29,15 @@ To add this option your project you will need to:
2929
- name: controller
3030
newName: quay.io/example/memcached-operator
3131
newTag: v0.0.1
32-
```
32+
```
3333

3434
_See [#4701](https://github.com/operator-framework/operator-sdk/pull/4701) for more details._
3535

3636
## (ansible/v1, helm/v1) Add Role rules for leader election.
3737

3838
Add the rule for the `apiGroups` `coordination.k8s.io` and the resource `leases` in config/rbac/leader_election_role.yaml:
39-
```yaml rules:
39+
```yaml
40+
rules:
4041
- apiGroups:
4142
- ""
4243
- coordination.k8s.io
@@ -100,7 +101,8 @@ _See [#4660](https://github.com/operator-framework/operator-sdk/pull/4660) for m
100101
## (ansible/v1, helm/v1) Add `securityContext`'s to your manager's Deployment.
101102

102103
In `config/manager/manager.yaml`, add the following security contexts:
103-
```yaml spec:
104+
```yaml
105+
spec:
104106
...
105107
template:
106108
...
@@ -119,7 +121,7 @@ _See [#4655](https://github.com/operator-framework/operator-sdk/pull/4655) for m
119121

120122
OLM does [not yet support cert-manager](https://olm.operatorframework.io/docs/advanced-tasks/adding-admission-and-conversion-webhooks/#certificate-authority-requirements), so a JSON patch was added to remove this volume and mount such that OLM can itself create and manage certs for your Operator.
121123
In `config/manifests/kustomization.yaml`, add the following:
122-
```yaml
124+
```yaml
123125
patchesJson6902:
124126
- target:
125127
group: apps
@@ -202,17 +204,36 @@ _See [#4406](https://github.com/operator-framework/operator-sdk/pull/4406) for m
202204
## (go/v2, go/v3, ansible/v1, helm/v1) Changed `BUNDLE_IMG` and added `IMAGE_TAG_BASE` Makefile variables
203205

204206
The following Makefile changes were made to allow `make bundle-build bundle-push catalog-build catalog-push` and encode image repo/namespace information in the Makefile by default:
205-
```diff +IMAGE_TAG_BASE ?= <registry>/<operator name> + -BUNDLE_IMG ?= controller-bundle:$(VERSION) +BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) ```
207+
```diff
208+
+IMAGE_TAG_BASE ?= <registry>/<operator name>
209+
+
210+
-BUNDLE_IMG ?= controller-bundle:$(VERSION) +BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
211+
```
212+
206213
For example, if `IMAGE_TAG_BASE ?= foo/bar-operator` then running `make bundle-build bundle-push catalog-build catalog-push` would build `foo/bar-operator-bundle:v0.0.1` and `foo/bar-operator-catalog:v0.0.1` then push them to the `docker.io/foo` namespaced registry.
207214

208215
_See [#4406](https://github.com/operator-framework/operator-sdk/pull/4406) for more details._
209216

210-
## (ansible/v1, helm/v1) Add a `system:controller-manager` ServiceAccount to your project.
217+
## (ansible/v1, helm/v1) Add the `controller-manager` ServiceAccount to your project.
211218

212-
A non-default ServiceAccount `controller-manager` is scaffolded on `operator-sdk init`, to improve security for operators installed in shared namespaces. To add this ServiceAccount to your project, do the following: ```sh # Create the ServiceAccount. cat <<EOF > config/rbac/service_account.yaml apiVersion: v1 kind: ServiceAccount metadata:
219+
A non-default ServiceAccount `controller-manager` is scaffolded on `operator-sdk init`, to improve security for operators installed in shared namespaces. To add this ServiceAccount to your project, do the following: ```sh
220+
# Create the ServiceAccount.
221+
cat <<EOF > config/rbac/service_account.yaml apiVersion: v1
222+
kind: ServiceAccount
223+
metadata:
213224
name: controller-manager
214225
namespace: system
215-
EOF # Add it to the list of RBAC resources. echo "- service_account.yaml" >> config/rbac/kustomization.yaml # Update all RoleBinding and ClusterRoleBinding subjects that reference the operator's ServiceAccount. find config/rbac -name *_binding.yaml -exec sed -i -E 's/ name: default/ name: controller-manager/g' {} \; # Add the ServiceAccount name to the manager Deployment's spec.template.spec.serviceAccountName. sed -i -E 's/([ ]+)(terminationGracePeriodSeconds:)/\1serviceAccountName: controller-manager\n\1\2/g' config/manager/manager.yaml ``` The changes should look like: ```diff # config/manager/manager.yaml
226+
EOF
227+
# Add it to the list of RBAC resources.
228+
echo "- service_account.yaml" >> config/rbac/kustomization.yaml
229+
# Update all RoleBinding and ClusterRoleBinding subjects that reference the operator's ServiceAccount.
230+
find config/rbac -name *_binding.yaml -exec sed -i -E 's/ name: default/ name: controller-manager/g' {} \; # Add the ServiceAccount name to the manager Deployment's spec.template.spec.serviceAccountName. sed -i -E 's/([ ]+)(terminationGracePeriodSeconds:)/\1serviceAccountName: controller-manager\n\1\2/g' config/manager/manager.yaml
231+
```
232+
233+
The changes should look like:
234+
235+
```diff
236+
# config/manager/manager.yaml
216237
requests:
217238
cpu: 100m
218239
memory: 20Mi
@@ -222,7 +243,8 @@ EOF # Add it to the list of RBAC resources. echo "- service_account.yaml" >> con
222243
name: proxy-role
223244
subjects:
224245
- kind: ServiceAccount
225-
- name: default + name: controller-manager
246+
- name: default
247+
+ name: controller-manager
226248
namespace: system
227249
# config/rbac/kustomization.yaml
228250
resources:
@@ -234,14 +256,22 @@ EOF # Add it to the list of RBAC resources. echo "- service_account.yaml" >> con
234256
name: leader-election-role
235257
subjects:
236258
- kind: ServiceAccount
237-
- name: default + name: controller-manager
259+
- name: default
260+
+ name: controller-manager
238261
namespace: system
239262
# config/rbac/role_binding.yaml
240263
name: manager-role
241264
subjects:
242265
- kind: ServiceAccount
243-
- name: default + name: controller-manager
266+
- name: default
267+
+ name: controller-manager
244268
namespace: system
245-
# config/rbac/service_account.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: controller-manager + namespace: system ```
269+
# config/rbac/service_account.yaml
270+
+apiVersion: v1
271+
+kind: ServiceAccount
272+
+metadata:
273+
+ name: controller-manager
274+
+ namespace: system
275+
```
246276

247277
_See [#4653](https://github.com/operator-framework/operator-sdk/pull/4653) for more details._

0 commit comments

Comments
 (0)