Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Stackland
  • What's new
  • Installation
    • All tutorials
    • Installing Stackland on Yandex BareMetal
    • Installing Stackland on Yandex BareMetal via PXE
    • Installing Stackland on Yandex Cloud VMs
    • Setting up external access to a pod in a cluster
    • All guides
        • Creating a ClickHouse® cluster
        • Updating cluster settings
        • Create a backup
        • Recovering a cluster
        • Deleting a cluster
        • Create database
        • Update database
        • Deleting a database
        • Creating a role
        • Editing a role
        • Deleting a role
        • Creating a user
        • Updating a user
        • Deleting a user
    • Projects
    • Resource model
    • Scaling a cluster
  • Access management
  • Pricing policy
  • Diagnostics and troubleshooting

In this article:

  • Using the CLI
  • Allowed privileges
  • Using the management console
  1. Step-by-step guides
  2. Databases
  3. Managed Service for ClickHouse®
  4. Creating a role

Creating a role

Written by
Yandex Cloud
Updated at July 24, 2026
View in Markdown
  • Using the CLI
    • Allowed privileges
  • Using the management console

If you have a ClickHouse® cluster, you can create a role in it using a custom ClickhouseRole resource.

You can configure the following for your role:

  • Role inheritance (spec.membership).
  • Permission blocks (spec.grants) for four types of ClickHouse® objects: databases, tables, named collections, and user and role administration.

The ClickhouseRole resource must reside in the same namespace as the ClickhouseCluster cluster. The resource name must follow this pattern: <cluster_name>-<user_name>.

Using the CLIUsing the CLI

  1. Create the ClickhouseRole resource file, e.g., using the touch clickhouserole.yaml command.

  2. Open the file and paste the configuration below into it:

    Role with read permissions
    Role with inheritance and table permissions
    apiVersion: clickhouse.stackland.yandex.cloud/v1alpha1
    kind: ClickhouseRole
    metadata:
      name: <cluster_name>-reader
    spec:
      cluster: <cluster_name>
      name: reader
      grants:
        - database:
            name: <database_name>
            privileges:
              - SELECT
    
    apiVersion: clickhouse.stackland.yandex.cloud/v1alpha1
    kind: ClickhouseRole
    metadata:
      name: <cluster_name>-writer
    spec:
      cluster: <cluster_name>
      name: writer
      membership:
        - reader
      grants:
        - database:
            name: <database_name>
            privileges:
              - SELECT
              - INSERT
              - CREATE TABLE
              - ALTER TABLE
        - table:
            database: <database_name>
            table: <table_name>
            privileges:
              - SELECT
              - INSERT
    

    Where:

    • spec.cluster: ClickhouseCluster cluster name.
    • spec.name: ClickHouse® role name.
    • spec.membership: Optional list of roles from which this role inherits permissions. The list contains spec.name values of other ClickhouseRole resources.
    • spec.grants: List of permission blocks. Each block must specify exactly one of the following fields: database, table, namedCollection, or access.
  3. Apply the manifest: kubectl apply -f clickhouserole.yaml -n <project_name>.

Allowed privilegesAllowed privileges

The allowed privileges vary depending on the permission block type. Values must match the CRD exactly, including spaces in multi-word privileges.

Block type

Manifest field

Allowed privileges

Database

spec.grants[].database

SELECT, INSERT, ALTER TABLE, ALTER VIEW, CREATE TABLE, CREATE VIEW, CREATE DICTIONARY, DROP TABLE, DROP VIEW, DROP DICTIONARY, TRUNCATE, OPTIMIZE, SHOW TABLES, SHOW DICTIONARIES, ALTER DELETE, ALTER UPDATE

Table

spec.grants[].table

SELECT, INSERT, ALTER TABLE, ALTER VIEW, DROP TABLE, DROP VIEW, TRUNCATE, OPTIMIZE, ALTER DELETE, ALTER UPDATE

Named collection

spec.grants[].namedCollection

CREATE, DROP, ALTER

User and role administration

spec.grants[].access

CREATE USER, ALTER USER, DROP USER, CREATE ROLE, ALTER ROLE, DROP ROLE

Using the management consoleUsing the management console

  1. If you have not opened a project yet, select one.

  2. In the left-hand menu, select ClickHouse® Clusters.

  3. Select the cluster.

  4. Navigate to the Roles tab.

  5. Click Create.

  6. Fill out the fields as follows:

    • Role name: Role name in ClickHouse®.
    • Inherit roles from: Optional list of roles of the same cluster from which the new role inherits permissions. You can specify multiple roles.
  7. Under Access permissions, configure the permissions. By default, one permission block is available:

    • In the Permissions for selector, select the object type: Database, Table, Named collection, or User and role administration.
    • For the Database type, select a database and privileges.
    • For the Table type, select a database, specify a table name, and select privileges.
    • For the Named collection and User and role administration types, only select privileges.

    To add another permission block, click Add. To delete a permission block, click Delete next to the block.

    For a list of allowed privileges for each block type, see Allowed privileges.

  8. Click Create.

Done. The role will now appear in the list of roles on the Role tab.

Was the article helpful?

Previous
Deleting a database
Next
Editing a role
© 2026 Direct Cursus Technology L.L.C.