rbac

by SikaLabs

Helm chartv0.3.0

Create RBAC objects

About this chart

rbac

Helm chart for creating RBAC objects (Roles, ClusterRoles, RoleBindings, ClusterRoleBindings).

Values

FieldTypeDescription
namestringUnique name for generated resources
groupstringKubernetes Group subject name
clusterWideboolIf true, creates ClusterRole/ClusterRoleBinding (default: false)
ruleslistRBAC policy rules. Required unless existingClusterRole or existingRole is set
namespaceslist of stringNamespaces for namespace-scoped resources. Required when not clusterWide
existingClusterRolestringBind to an existing ClusterRole instead of creating one
existingRolestringBind to an existing Role instead of creating one

Usage

rbacRules:
  # Custom ClusterRole (cluster-wide)
  - name: admin-role
    group: kubernetes-admin
    clusterWide: true
    rules:
      - apiGroups: ["*"]
        resources: ["*"]
        verbs: ["*"]

  # Custom ClusterRole bound in specific namespaces
  - name: ch-devs-extensions
    group: "k8s:devs"
    clusterWide: true
    namespaces: [ch-kong, ch-camunda-orch]
    rules:
      - apiGroups: ["gateway.networking.k8s.io"]
        resources: ["httproutes"]
        verbs: ["*"]

  # Custom Role in multiple namespaces
  - name: pod-reader
    group: kubernetes-dev
    namespaces: [default, monitoring]
    rules:
      - apiGroups: [""]
        resources: [pods]
        verbs: [get, list, watch]

  # Bind to existing ClusterRole cluster-wide
  - name: view-all-binding
    group: kubernetes-viewer
    existingClusterRole: view
    clusterWide: true

  # Bind to existing ClusterRole in specific namespaces
  - name: dev-edit-binding
    group: kubernetes-dev
    existingClusterRole: edit
    namespaces: [default, staging]

  # Bind to existing Role in specific namespaces
  - name: dev-custom-binding
    group: kubernetes-dev
    existingRole: my-custom-role
    namespaces: [default]

Deploy rbac with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rbac on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartrbac is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply