# Creating roles with Keycloak Operator

**URL:** <https://forum.keycloak.org/t/creating-roles-with-keycloak-operator/8526>\
**Category:** Getting advice\
**Created:** [April 16, 2021, 12:16am UTC](https://forum.keycloak.org/t/creating-roles-with-keycloak-operator/8526 "2021-04-16T00:16:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etavela](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@etavela](https://forum.keycloak.org/u/etavela)\
**Post date:** [April 16, 2021, 12:16am UTC](https://forum.keycloak.org/t/creating-roles-with-keycloak-operator/8526/1 "2021-04-16T00:16:09Z")

</div>

Can someone provide advice on how to create realm roles (or client) using Keycloak Operator CRDs? I can successfully assign users to existing roles with the KeycloakUser CRD but can’t see any method to add roles to a realm. Any advice?

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![SimoneDiCola](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@SimoneDiCola](https://forum.keycloak.org/u/SimoneDiCola)\
**Post date:** [June 2, 2021, 3:07pm UTC](https://forum.keycloak.org/t/creating-roles-with-keycloak-operator/8526/2 "2021-06-02T15:07:25Z")

</div>

anyone? This should be quite simple

---

<div class="post-metadata">

**Author:** ![etavela](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@etavela](https://forum.keycloak.org/u/etavela)\
**Post date:** [June 2, 2021, 8:16pm UTC](https://forum.keycloak.org/t/creating-roles-with-keycloak-operator/8526/3 "2021-06-02T20:16:17Z")

</div>

This wasn’t available in 12.0.0 when I originally asked but works now in 13.0.x. You can now add entries to spec.realm.roles.realm in a KeycloakRealm. I think only `name` is required.
