Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/
MongoDB Controllers for Kubernetes Operator
/

ClusterMongoDBRole Resource Specification

The ClusterMongoDBRole custom resource lets you configure the role required for a user to access a MongoDB database.

The following example shows a resource specification for a ClusterMongoDBRole custom resource:

1---
2apiVersion: mongodb.com/v1
3kind: ClusterMongoDBRole
4metadata:
5 name: ldap-user-1
6spec:
7 role: "customRole"
8 db: admin
9 privileges:
10 - actions:
11 - insert
12 resource:
13 collection: cats
14 db: pets
15 - actions:
16 - insert
17 - find
18 resource:
19 collection: dogs
20 db: pets
21...
spec.role

Type: string

Name of the user-defined role.

spec.roles

Type: array

Array that lists the roles assigned to this user.

spec.roles.db

Type: string

The databases to which this role has access.

spec.roles.role

Type: string

The name of the inherited role.

spec.authenticationRestrictions

Type: array

Array that defines the IP address from which and to which users assigned this spec.security.roles.role can connect.

spec.db

Type: string

Database for which the privilege spec.privileges.actions apply.

If you provide a value for this setting, you must also provide a value for spec.privileges.resource.

spec.privileges

Type: array

Array that describes the privileges that users granted this role possess.

spec.privileges.actions

Type: array

List of actions that users granted this role can perform. For a list of accepted values, see Privilege Actions in the MongoDB Server documentation for the MongoDB versions you deploy with the Kubernetes Operator.

spec.privileges.resource

Type: collection

Resources for which the privilege spec.privileges.actions apply.

This collection must include either:

spec.privileges.resource.db

Type: string

Database for which the privilege spec.privileges.actions apply.

If you provide a value for this setting, you must also provide a value for spec.privileges.resource.collection.

spec.privileges.resource.collection

Type: string

Collection in the spec.privileges.resource.db for which the privilege spec.privileges.actions apply.

If you provide a value for this setting, you must also provide a value for spec.privileges.resource.db.

Back

MongoDB User

On this page