Skip to content
Draft
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
21 changes: 7 additions & 14 deletions manifests/00-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ rules:
- apiGroups:
- ""
resources:
- configmaps
- namespaces
- serviceaccounts
- endpoints
- services
- secrets
- pods
- events
verbs:
Expand All @@ -28,24 +24,23 @@ rules:
- apiGroups:
- ""
resources:
- pods/eviction
- namespaces
verbs:
- "create"
- "*"

- apiGroups:
- ""
resources:
- nodes
- pods/eviction
verbs:
- list
- "create"

- apiGroups:
- apps
- ""
resources:
- deployments
- daemonsets
- nodes
verbs:
- "*"
- list

- apiGroups:
- policy
Expand All @@ -68,8 +63,6 @@ rules:
resources:
- clusterroles
- clusterrolebindings
- roles
- rolebindings
verbs:
- create
- get
Expand Down
40 changes: 40 additions & 0 deletions manifests/00-operand-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Define operand namespaces to be able to restrict the operator's RBAC permissions.
# This enables limiting the access to sensitive resources (e.g., Secrets, ServiceAccounts, ConfigMaps)
# from cluster-wide scope to specific namespaces.
---
kind: Namespace
apiVersion: v1
metadata:
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
openshift.io/node-selector: ""
workload.openshift.io/allowed: "management"
labels:
# allow openshift-monitoring to look for ServiceMonitor objects in this namespace
openshift.io/cluster-monitoring: "true"
name: openshift-ingress
# old and new forms of the label for matching with NetworkPolicy
network.openshift.io/policy-group: ingress
policy-group.network.openshift.io/ingress: ""
# Router deployment needs to allow privilege escalation, as well as host
# network and host ports for the "HostNetwork" endpoint publishing strategy,
# which is the default for on-premise platforms.
pod-security.kubernetes.io/enforce: privileged
pod-security.kubernetes.io/audit: privileged
pod-security.kubernetes.io/warn: privileged
name: openshift-ingress
---
kind: Namespace
apiVersion: v1
metadata:
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
openshift.io/node-selector: ""
workload.openshift.io/allowed: "management"
name: openshift-ingress-canary
86 changes: 86 additions & 0 deletions manifests/01-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,89 @@ roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: ingress-operator
---
# RoleBinding for the operator to manage ingresscontrollers
# in the openshift-ingress namespace.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-ingress
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
subjects:
- kind: ServiceAccount
name: ingress-operator
namespace: openshift-ingress-operator
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: ingress-operator
---
# RoleBinding for the operator to manage canary deployment
# in the openshift-ingress-canary namespace.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-ingress-canary
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
subjects:
- kind: ServiceAccount
name: ingress-operator
namespace: openshift-ingress-operator
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: ingress-operator
---
# RoleBinding for the operator to manage the following resources in openshift-config namespace:
# - Role and RoleBindings to manage RBAC for componentRoutes (configurable-route controller).
# - ConfigMaps to sync error code pages and client CAs (?) (sync-http-error-code-configmap, clientca-configmap controllers).
# - Secrets as roles created for component routes grant read access to secrets (?).
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-config
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
subjects:
- kind: ServiceAccount
name: ingress-operator
namespace: openshift-ingress-operator
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: ingress-operator
---
# Role for the operator to publish the router certificates
# in openshift-config-managed namespace (certificate-publisher controller).
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-config-managed
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
subjects:
- kind: ServiceAccount
name: ingress-operator
namespace: openshift-ingress-operator
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: ingress-operator
166 changes: 164 additions & 2 deletions manifests/01-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@ rules:
- apps
resources:
- deployments
- daemonsets
- services
verbs:
- "*"
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- "*"
---
# Role for the operator to delete Role and RoleBindings
# in the openshift-config namespace.
# Role for the operator to manage the following resources in openshift-config namespace:
# - Role and RoleBindings to manage RBAC for componentRoutes (configurable-route controller).
# - ConfigMaps to sync error code pages and client CAs (?) (sync-http-error-code-configmap, clientca-configmap controllers).
# - Secrets as roles created for component routes grant read access to secrets (?).
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -58,3 +68,155 @@ rules:
- rolebindings
verbs:
- delete
- create
- update
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- get
- list
- watch
---
# Role for the operator to publish the router certificates
# in openshift-config-managed namespace (certificate-publisher controller).
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-config-managed
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
resourceNames:
- router-certs
verbs:
- "*"
- apiGroups:
- ""
resources:
- configmaps
resourceNames:
- default-ingress-cert
verbs:
- "*"
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- get
- list
- watch
---
# Role for the operator to manage ingress controllers
# in openshift-ingress namespace.
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-ingress
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
- serviceaccounts
verbs:
- "*"
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- "*"
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- "*"
---
# Role for the operator to manage canary deployment
# in openshift-ingress-canary namespace.
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-operator
namespace: openshift-ingress-canary
annotations:
capability.openshift.io/name: Ingress
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
- serviceaccounts
verbs:
- "*"
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- "*"
- apiGroups:
- apps
resources:
- daemonsets
- deployments
verbs:
- "*"