0

我正在使用来自此 github https://github.com/keycloak/keycloak-operator/tree/master/deploy/examples的示例,使用诸如 realm.yaml 和 user.yaml 之类的清单。我们的用户清单看起来像这样。将组添加到此文件时,我们会从 helm 收到此错误:

来自服务器的错误 (NotFound): keycloakusers.keycloak.org "example-user" not found

使用 keycloak 清单创建组的正确方法是什么?

apiVersion: keycloak.org/v1alpha1
kind: KeycloakUser
metadata:
  name: example-user
spec:
  user:
    username: "example-user"
    email: "example-user@gmail.com"
    enabled: True
    emailVerified: True
    # credentials:
    #   - type: "password"
    #     value: "password"
    realmRoles:
      - "offline_access"
      - "uma_authorization"
      - "user"
    clientRoles:
      account:
        - "manage-account"
      realm-management:
        - "manage-users"
  realmSelector:
    matchLabels:
      app: sso
4

1 回答 1

0

当 keycloak-user 使用 crd 时,请查看下面的 yaml。但是,您应该记住该组(您要放置..)必须已经存在。

apiVersion: keycloak.org/v1alpha1
kind: KeycloakUser
metadata:
  name: example-user
spec:
  user:
    username: "example-user"
    email: "example-user@gmail.com"
    enabled: True
    emailVerified: True
    # credentials:
    #   - type: "password"
    #     value: "password"
    realmRoles:
      - "offline_access"
      - "uma_authorization"
      - "user"
    groups:
      - "your group"
    clientRoles:
      account:
        - "manage-account"
      realm-management:
        - "manage-users"
  realmSelector:
    matchLabels:
      app: sso
于 2021-11-26T14:27:50.540 回答