Skip to content

Commit

Permalink
bundle: manifest changes for status-reporter
Browse files Browse the repository at this point in the history
manifest changes for the status-reporter image

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Feb 1, 2023
1 parent 9dda71b commit 2c1e6a9
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ COPY api/ api/
COPY controllers/ controllers/
COPY config/ config/
COPY pkg/ pkg/
COPY service/ service/
# Run tests and linting
RUN make go-test

Expand All @@ -27,6 +28,7 @@ RUN make go-build
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY --from=builder /workspace/bin/status-reporter .
COPY --from=builder /workspace/images.yaml /etc/ocs-client-operator/images.yaml
USER 65532:65532

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada
cd config/manifests/bases && $(KUSTOMIZE) edit add annotation --force 'olm.skipRange':"$(SKIP_RANGE)" && \
$(KUSTOMIZE) edit add patch --name ocs-client-operator.v0.0.0 --kind ClusterServiceVersion\
--patch '[{"op": "replace", "path": "/spec/replaces", "value": "$(REPLACES)"}]'
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) --extra-service-accounts=ocs-client-operator-csi-cephfs-provisioner-sa,ocs-client-operator-csi-cephfs-plugin-sa,ocs-client-operator-csi-rbd-provisioner-sa,ocs-client-operator-csi-rbd-plugin-sa
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) --extra-service-accounts=ocs-client-operator-csi-cephfs-provisioner-sa,ocs-client-operator-csi-cephfs-plugin-sa,ocs-client-operator-csi-rbd-provisioner-sa,ocs-client-operator-csi-rbd-plugin-sa,ocs-client-operator-status-reporter
$(OPERATOR_SDK) bundle validate ./bundle

.PHONY: bundle-build
Expand Down
24 changes: 24 additions & 0 deletions bundle/manifests/ocs-client-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ spec:
- --leader-elect
command:
- /manager
env:
- name: OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: STATUS_REPORTER_IMAGE
value: quay.io/ocs-dev/ocs-client-operator:latest
image: quay.io/ocs-dev/ocs-client-operator:latest
livenessProbe:
httpGet:
Expand Down Expand Up @@ -563,6 +570,23 @@ spec:
verbs:
- create
serviceAccountName: ocs-client-operator-csi-rbd-provisioner-sa
- rules:
- apiGroups:
- ocs.openshift.io
resources:
- storageclients
verbs:
- get
- list
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- update
serviceAccountName: ocs-client-operator-status-reporter
strategy: deployment
installModes:
- supported: false
Expand Down
7 changes: 7 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ spec:
- --leader-elect
image: controller:latest
name: manager
env:
- name: OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: STATUS_REPORTER_IMAGE
value: quay.io/ocs-dev/ocs-client-operator:latest
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
Expand Down
4 changes: 4 additions & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ resources:
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml

# status reporter RBAC
- status-reporter-sa.yaml
- status-reporter-role.yaml
- status-reporter-role_binding.yaml
# CSI RBAC
- csi_cephfs_plugin_service_account.yaml
- csi_cephfs_provisioner_clusterrole.yaml
Expand Down
20 changes: 20 additions & 0 deletions config/rbac/status-reporter-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: status-reporter
rules:
- apiGroups:
- ocs.openshift.io
resources:
- storageclients
verbs:
- get
- list
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- update
11 changes: 11 additions & 0 deletions config/rbac/status-reporter-role_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ocs-status-reporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ocs-client-operator-status-reporter
subjects:
- kind: ServiceAccount
name: ocs-client-operator-status-reporter
4 changes: 4 additions & 0 deletions config/rbac/status-reporter-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: status-reporter
1 change: 1 addition & 0 deletions hack/go-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export GO111MODULE=${GO111MODULE:-on}
set -x

go build -a -o ${GOBIN:-bin}/manager main.go
go build -a -o ${GOBIN:-bin}/status-reporter ./service/status-report/main.go

0 comments on commit 2c1e6a9

Please sign in to comment.