AuthorizationRule
Scope: Namespaced
Version: v1alpha1
Manages RBAC and authorization settings within a particular namespace.
The
AuthorizationRuleresource is used in the current role-based model and isn’t used in the experimental role model.
- objectspec
Required value
- stringspec.accessLevel
Access level:
User— has access to information about all objects (including viewing pod logs) but cannot exec into containers, read secrets, and perform port-forwarding;PrivilegedUser— the same asUser+ can exec into containers, read secrets, and delete pods (and thus, restart them);Editor— is the same asPrivilegedUser+ can create and edit all objects that are usually required for application tasks;Admin— the same asEditor+ can delete service objects (auxiliary resources such asReplicaSet,certmanager.k8s.io/challengesandcertmanager.k8s.io/orders);
Allowed values:
User,PrivilegedUser,Editor,AdminExample:
accessLevel: PrivilegedUser - booleanspec.allowScale
Defines if scaling of Deployments and StatefulSets is allowed/not allowed.
Default:
false - booleanspec.portForwarding
Allow/disallow the user to do
port-forwarding.Default:
false - array of objectsspec.subjects
Required value
Users and/or groups to grant privileges.
Pay attention to the following nuances if this module is used together with the user-authn module:
- Use the user’s
emailas the username to grant privileges to the specific user; - When specifying a group, make sure that the necessary groups are allowed to be received from the provider, i.e., they are defined in the corresponding custom resource DexProvider.
- stringspec.subjects.kind
Required value
Type of user identification resource.
Allowed values:
User,Group,ServiceAccountExample:
kind: Group - stringspec.subjects.name
Required value
Resource name.
Example:
name: some-group-name - stringspec.subjects.namespace
ServiceAccount namespace.
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?Length:
1..63
- Use the user’s
ClusterAuthorizationRule
Scope: Cluster
This object manages RBAC and namespace-based authorization.
The settings determine which access level is assigned to the user and/or group.
- objectspec
Required value
- stringspec.accessLevel
Access level:
User— has access to information about all objects (including viewing pod logs) but cannot exec into containers, read secrets, and perform port-forwarding;PrivilegedUser— the same asUser+ can exec into containers, read secrets, and delete pods (and thus, restart them);Editor— is the same asPrivilegedUser+ can create and edit all objects that are usually required for application tasks;Admin— the same asEditor+ can delete service objects (auxiliary resources such asReplicaSet,certmanager.k8s.io/challengesandcertmanager.k8s.io/orders);ClusterEditor— the same asEditor+ can manage a limited set ofcluster-wideobjects that can be used in application tasks (ClusterXXXMetric,KeepalivedInstance,DaemonSet, etc.). This role is best suited for cluster operators.-
ClusterAdmin— the same as bothClusterEditorandAdmin+ can managecluster-wideservice objects (e.g.,MachineSets,Machines,OpenstackInstanceClasses…, as well asClusterAuthorizationRule,ClusterRoleBindingsandClusterRole). This role is best suited for cluster administrators.Caution! since
ClusterAdmincan editClusterRoleBindings, he can broader his privileges within the cluster; SuperAdmin— can perform any actions with any objects (note thatlimitNamespacesandnamespaceSelector(see below) restrictions remain valid).
Allowed values:
User,PrivilegedUser,Editor,Admin,ClusterEditor,ClusterAdmin,SuperAdminExample:
accessLevel: PrivilegedUser - array of objectsspec.additionalRoles
Additional roles to bind for subjects.
This parameter is reserved for emergencies. Please, use the
accessLevelparameter instead.Example:
additionalRoles: - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-write-all - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-read-all- stringspec.additionalRoles.apiGroup
Required value
apiGroup for users.
Example:
apiGroup: rbac.authorization.k8s.io - stringspec.additionalRoles.kind
Required value
Kind of the role.
Allowed values:
ClusterRoleExample:
kind: ClusterRole - stringspec.additionalRoles.name
Required value
Name of the role.
Example:
name: cluster-admin
- booleanspec.allowAccessToSystemNamespacesDeprecated
Available in editions: BE, SE, SE+, EE
Allow access to System namespaces (kube-, d8-, loghouse, default).
Option available only if the enableMultiTenancy option is enabled.
Deprecated. Use the namespaceSelector field instead.
Default:
false - booleanspec.allowScale
Defines if scaling of Deployments and StatefulSets is allowed/not allowed.
Default:
false - array of stringsspec.limitNamespacesDeprecated
Available in editions: BE, SE, SE+, EE
List of regex-patterns that define namespaces accessible by the user.
The decision making process:
- If the list is defined, then only its constituents are accessible.
- If the list is not defined, then all namespaces are accessible (except for the system ones - see
spec.allowAccessToSystemNamespacesbelow).
Option available only if enableMultiTenancy option is enabled.
Deprecated. Use the namespaceSelector field instead.
Example:
limitNamespaces: production-.*- stringElement of the array
- objectspec.namespaceSelector
Available in editions: BE, SE, SE+, EE
Defines a set of namespaces accessible by the user, using the value of the
namespaceSelector.labelSelectorparameter.If the
namespaceSelectorparameter is specified, the values of thelimitNamespacesandallowAccessToSystemNamespacesparameters are ignored. If thenamespaceSelector.matchAnyfield is specified, then all namespaces (including system namespaces) will be accessible. Otherwise, only the namespaces with labels matching thenamespaceSelector.labelSelectorconditions will be accessible (including system namespaces).If the
namespaceSelectorparameter is not specified, then the set of available namespaces is determined by the value of thelimitNamespacesandallowAccessToSystemNamespacesparameters. If none of the parametersnamespaceSelector,limitNamespacesandallowAccessToSystemNamespacesare specified, then all namespaces will be available, except for the system ones (kube-*,d8-*,loghouse,default).Is available only if the enableMultiTenancy parameter is enabled.
- objectspec.namespaceSelector.labelSelector
Defines the label selector-based filter of the namespaces.
Cannot be used together with the
matchAnyparameter.If both
matchExpressionsandmatchLabelsparameters are set, their requirements are ANDed together — they must all be satisfied in order to match. If multiplematchExpressionconditions are provided, they all must be satisfied in order to match.- array of objectsspec.namespaceSelector.labelSelector.matchExpressions
An array of set-based expressions.
Example:
matchExpressions: - key: tier operator: In values: - production - staging - key: tier operator: NotIn values: - production- stringspec.namespaceSelector.labelSelector.matchExpressions.key
A label name.
- stringspec.namespaceSelector.labelSelector.matchExpressions.operator
A comparison operator.
Allowed values:
In,NotIn,Exists,DoesNotExist - array of stringsspec.namespaceSelector.labelSelector.matchExpressions.values
A label value.
- stringElement of the array
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?Length:
1..63
- objectspec.namespaceSelector.labelSelector.matchLabels
A set of labels a namespace must have to match.
Example:
matchLabels: foo: bar baz: who
- booleanspec.namespaceSelector.matchAny
Unconditionally permits access to any namespace in the cluster, including system namespaces.
Cannot be used together with the
labelSelectorparameter.Since
labelSelectorprovides access to a limited number of the namespaces that match it,matchAnyis needed in cases where access to all namespaces is to be granted.Allowed values:
true
- booleanspec.portForwarding
Allow/disallow the user to do
port-forwarding.Default:
false - array of objectsspec.subjects
Required value
Users and/or groups to grant privileges.
Pay attention to the following nuances if this module is used together with the user-authn module:
- Use the user’s
emailas the username to grant privileges to the specific user; - When specifying a group, make sure that the necessary groups are allowed to be received from the provider, i.e., they are defined in the corresponding custom resource DexProvider.
- stringspec.subjects.kind
Required value
Type of user identification resource.
Allowed values:
User,Group,ServiceAccountExample:
kind: Group - stringspec.subjects.name
Required value
Resource name.
Example:
name: some-group-name - stringspec.subjects.namespace
ServiceAccount namespace.
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?Length:
1..63
- Use the user’s
Deprecated resource. Support for the resource might be removed in a later release.
This cluster-wide object manages RBAC and authorization.
The
ClusterAuthorizationRuleresource is used in the current role-based model and isn’t used in the experimental role model.
- objectspec
Required value
- stringspec.accessLevel
Access level:
User— has access to information about all objects (including viewing pod logs) but cannot exec into containers, read secrets, and perform port-forwarding;PrivilegedUser— the same asUser+ can exec into containers, read secrets, and delete pods (and thus, restart them);Editor— is the same asPrivilegedUser+ can create and edit all objects that are usually required for application tasks;Admin— the same asEditor+ can delete service objects (auxiliary resources such asReplicaSet,certmanager.k8s.io/challengesandcertmanager.k8s.io/orders);ClusterEditor— the same asEditor+ can manage a limited set ofcluster-wideobjects that can be used in application tasks (ClusterXXXMetric,KeepalivedInstance,DaemonSet, etc.). This role is best suited for cluster operators.-
ClusterAdmin— the same as bothClusterEditorandAdmin+ can managecluster-wideservice objects (e.g.,MachineSets,Machines,OpenstackInstanceClasses…, as well asClusterAuthorizationRule,ClusterRoleBindingsandClusterRole). This role is best suited for cluster administrators.Caution! since
ClusterAdmincan editClusterRoleBindings, he can broader his privileges within the cluster; SuperAdmin— can perform any actions with any objects (note thatlimitNamespaces(see below) restrictions remain valid).
Allowed values:
User,PrivilegedUser,Editor,Admin,ClusterEditor,ClusterAdmin,SuperAdminExample:
accessLevel: PrivilegedUser - array of objectsspec.additionalRoles
Additional roles to bind for subjects.
This parameter is reserved for emergencies. Please, use the
accessLevelparameter instead.Example:
additionalRoles: - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-write-all - apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-read-all- stringspec.additionalRoles.apiGroup
Required value
apiGroup for users.
Example:
apiGroup: rbac.authorization.k8s.io - stringspec.additionalRoles.kind
Required value
Kind of the role.
Allowed values:
ClusterRoleExample:
kind: ClusterRole - stringspec.additionalRoles.name
Required value
Name of the role.
Example:
name: cluster-admin
- booleanspec.allowAccessToSystemNamespacesDeprecated
Available in editions: BE, SE, SE+, EE
Allow access to System namespaces (kube-, d8-, loghouse, default).
Option available only if the enableMultiTenancy option is enabled.
Deprecated. Use the namespaceSelector parameter (API version
v1of the CR) instead.Default:
false - booleanspec.allowScale
Defines if scaling of Deployments and StatefulSets is allowed/not allowed.
Default:
false - array of stringsspec.limitNamespacesDeprecated
Available in editions: BE, SE, SE+, EE
List of regex-patterns that define namespaces accessible by the user.
The decision making process:
- If the list is defined, then only its constituents are accessible.
- If the list is not defined, then all namespaces are accessible (except for the system ones - see
spec.allowAccessToSystemNamespacesbelow).
Option available only if enableMultiTenancy option is enabled.
Deprecated. Use the namespaceSelector parameter (API version
v1of the CR) instead.Example:
limitNamespaces: production-.*- stringElement of the array
- booleanspec.portForwarding
Allow/disallow the user to do
port-forwarding.Default:
false - array of objectsspec.subjects
Required value
Users and/or groups to grant privileges.
Pay attention to the following nuances if this module is used together with the user-authn module:
- Use the user’s
emailas the username to grant privileges to the specific user; - When specifying a group, make sure that the necessary groups are allowed to be received from the provider, i.e., they are defined in the corresponding custom resource DexProvider.
- stringspec.subjects.kind
Required value
Type of user identification resource.
Allowed values:
User,Group,ServiceAccountExample:
kind: Group - stringspec.subjects.name
Required value
Resource name.
Example:
name: some-group-name - stringspec.subjects.namespace
ServiceAccount namespace.
Pattern:
[a-z0-9]([-a-z0-9]*[a-z0-9])?Length:
1..63
- Use the user’s