By default, Kong Mesh deployed on Kubernetes reacts to events and observes all resources at the cluster scope. This approach benefits first-time users who want to explore its functionality and simplifies migration. However, in production environments, restricting access to specific resources can enhance security and ensure that Kong Mesh doesn’t impact running applications.
You can define a list of namespaces that the Kong Mesh control plane can access. When this list is set, Kong Mesh will only have permissions in those selected namespaces and in its own system namespace. It won’t be able to access or manage resources in any other namespace.
To restrict Kong Mesh to a specific set of namespaces, set the kuma.namespaceAllowList option during installation:
# Before installing Kong Mesh with Helm, configure your local Helm repository:# https://developer.konghq.com/mesh/2.13/production/cp-deployment/kubernetes/#helmhelm install \ --create-namespace \ --namespace kong-mesh-system \ --set "kuma.namespaceAllowList={first-namespace,second-namespace}" \ kong-mesh kong-mesh/kong-mesh
Copied!
This will create a RoleBinding in each listed namespace, binding the kong-mesh-control-plane-workloadsClusterRole to that namespace. It will also configure Kong Mesh’s mutating and validating webhooks to only work within the specified namespaces.
If your environment restricts creating cluster-scoped resources (ClusterRole or ClusterRoleBinding), or if you prefer to manage permissions yourself, you can disable automatic resource creation during installation.
Before installing Kong Mesh, you must manually create the following resources:
ClusterRole and ClusterRoleBinding used by the control plane
Role and RoleBinding within the control plane namespace
RoleBindings in selected namespaces when using namespaceAllowList (optional)
You can find the complete set of required manifests here:
# Before installing Kong Mesh with Helm, configure your local Helm repository:# https://developer.konghq.com/mesh/2.13/production/cp-deployment/kubernetes/#helmhelm install \ --create-namespace \ --namespace kong-mesh-system \ --set "kuma.skipRBAC=true" \ kong-mesh kong-mesh/kong-mesh
Copied!
To skip only cluster-scoped resources kuma.controlPlane.skipClusterRoleCreation=true:
# Before installing Kong Mesh with Helm, configure your local Helm repository:# https://developer.konghq.com/mesh/2.13/production/cp-deployment/kubernetes/#helmhelm install \ --create-namespace \ --namespace kong-mesh-system \ --set "kuma.controlPlane.skipClusterRoleCreation=true" \ kong-mesh kong-mesh/kong-mesh
Copied!
If you choose to manage Kong Mesh’s RBAC resources yourself, make sure to keep them in sync during upgrades. When a new version of Kong Mesh is released, roles and role bindings may change, and it’s your responsibility to update them accordingly.