kubeapps icon indicating copy to clipboard operation
kubeapps copied to clipboard

Configuration of service account token for additional clusters

Open castelblanque opened this issue 2 years ago • 3 comments

Signed-off-by: Rafa Castelblanque [email protected]

Description of the change

This PR adds the ability to set a service token to be used by Kubeapps on additional clusters. There was the original work done by @XenoAura in #5034. Due to kubeops being removed, the work has been re-done for the new setup, hence this PR. Added tests for regression.

Benefits

Service account token applies to operations done against additional clusters.

Possible drawbacks

Security? Service account token will apply to all operations done with the configGetter, not only the ones related to namespaces.

Applicable issues

  • fixes #5033
  • related to #5034

castelblanque avatar Sep 02 '22 10:09 castelblanque

Deploy Preview for kubeapps-dev canceled.

Name Link
Latest commit 1341a35b8cae69c42143d89d968beedd75df9b64
Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/63174d2680c8db000aab8068

netlify[bot] avatar Sep 02 '22 10:09 netlify[bot]

Thank you @castelblanque!

ppbaena avatar Sep 02 '22 10:09 ppbaena

After taking a deeper look, it seems that the fix for this is more complex. The service account for additional clusters should only be used for listing namespaces. See comment here.

With the fix in this PR we are always applying the service token (if any) for calls to additional clusters. Switching to using this only for listing namespaces requires a change in the signature of the clientGetter function used in the plugin to handle a flag. This will allow to get the client using the service account token or the context token.

castelblanque avatar Sep 02 '22 12:09 castelblanque