Can't have both global and non-global service account rules

Bug #1861246 reported by Hamish
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Yang Kelvin Liu

Bug Description

In the k8s spec, service accounts are defined like:

kubernetesResources:
  serviceAccounts:
    - name: nginx-ingress
      automountServiceAccountToken: true
      global: true
      rules: []

There are cases where you need the equivalent of a Role and a ClusterRole attached to a single ServiceAccount (my use case here is porting the nginx-ingress helm chart).

To illustrate the issue, here is a potential fix to the spec:

kubernetesResources:
  serviceAccountRules:
    - name: nginx-ingress-cluster-rules
      global: true
      rules: []
    - name: nginx-ingress-rules
      global: false
      rules: []
  serviceAccounts:
    - name: nginx-ingress
      automountServiceAccountToken: true
      rules:
        - nginx-ingress-cluster-rules
        - nginx-ingress-rules

Which would create a ClusterRole, ClusterRoleBinding, Role, RoleBinding, and the ServiceAccount.
A variation on this would be to have something like kubernetesResources.serviceAccounts.rules AND kubernetesResources.serviceAccounts.globalRules

Tags: k8s
Hamish (lucidone)
tags: added: k8s
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.8-beta1
status: New → Triaged
importance: Undecided → High
Revision history for this message
Yang Kelvin Liu (kelvin.liu) wrote :

https://github.com/juju/juju/pull/11293 will land to 2.8 to add this feature for k8s spec v3.

Changed in juju:
status: Triaged → In Progress
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
Changed in juju:
status: In Progress → Fix Committed
Harry Pidcock (hpidcock)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.