Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: openshiftdockerregistries.dockerregistry.operator.openshift.io
spec:
group: dockerregistry.operator.openshift.io
names:
kind: OpenShiftDockerRegistry
listKind: OpenShiftDockerRegistryList
plural: openshiftdockerregistries
singular: openshiftdockerregistry
scope: Namespaced
version: v1alpha1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: openshift-image-registry
spec:
finalizers:
- kubernetes
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cluster-image-registry-operator
namespace: openshift-image-registry
spec:
replicas: 1
selector:
matchLabels:
name: cluster-image-registry-operator
template:
metadata:
labels:
name: cluster-image-registry-operator
spec:
containers:
- name: cluster-image-registry-operator
image: docker.io/openshift/origin-cluster-image-registry-operator:latest
ports:
- containerPort: 60000
name: metrics
command:
- cluster-image-registry-operator
imagePullPolicy: Always
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OPERATOR_NAME
value: "cluster-image-registry-operator"
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: cluster-image-registry-operator
rules:
- apiGroups:
- dockerregistry.operator.openshift.io
resources:
- "*"
verbs:
- "*"
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- events
- persistentvolumeclaims
- pods
- secrets
- services
verbs:
- "*"
- apiGroups:
- apps
resources:
- daemonsets
- deploymentconfigs
- deployments
- replicasets
- statefulsets
verbs:
- "*"
- apiGroups:
- apps.openshift.io
resources:
- deploymentconfigs
verbs:
- "*"
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- "*"
- apiGroups:
- rbac.authorization.k8s.io
resources:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives operator root on cluster. why not just bind to cluster-admin role?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one reason i can think of is that this makes it explicit what permissions we actually need/want.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives operator root on cluster. why not just bind to cluster-admin role?

We want to explicitly list the permissions that are required. Speaking specifically about this, we need these permissions to create clusterroles. We need to do this dynamically since the number of interfaces registry uses is vary from version to version.

- clusterroles
- clusterrolebindings
verbs:
- "*"
- apiGroups:
- project.openshift.io
resources:
- projects
verbs:
- get
- apiGroups:
- ""
resources:
- limitranges
- resourcequotas
verbs:
- list
- apiGroups:
- image.openshift.io
resources:
- "*"
verbs:
- "*"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: default-account-cluster-image-registry-operator
subjects:
- kind: ServiceAccount
name: default
namespace: openshift-image-registry
roleRef:
kind: ClusterRole
name: cluster-image-registry-operator
apiGroup: rbac.authorization.k8s.io
5 changes: 5 additions & 0 deletions modules/tectonic/resources/tectonic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ kubectl create -f updater/app_versions/app-version-tectonic-alm.yaml
kubectl create -f updater/app_versions/app-version-tectonic-utility.yaml
kubectl create -f updater/app_versions/app-version-tectonic-ingress.yaml

kubectl create -f registry/image-registry-namespace.yaml
kubectl create -f registry/image-registry-crd.yaml
kubectl create -f registry/image-registry-rbac.yaml
kubectl create -f registry/image-registry-operator.yaml

# wait for Tectonic pods
wait_for_pods tectonic-system
asset_cleanup
Expand Down