TremoloSecurity / OpenUnison

Unified Identity Management
Apache License 2.0
76 stars 9 forks source link

Provision to remote k8s clusters #489

Open mlbiam opened 4 years ago

mlbiam commented 4 years ago

Goal is to be able to provision to remote k8s clusters using the same API used to provision to the local cluster. Need to be able to interact with the same APIs, building an additional API is neither desired nor required.

Option 1 - Service Account

A ServiceAccount with cluster-admin privileges is provisioned in the target cluster and stored as a Secret in the control plane cluster's OpenUnison.

ou_multicluster_sa

Pros:

Cons:

Option 2 - Certificate Authentication

A key pair and CSR is generated from the control plane OpenUnison, submitted to the target cluster's CertificateSigningRequest API. The approved certificate is imported into OpenUnison and provided cluster-admin rights via RBAC. OpenUnison uses the certificate for interacting with the target cluster.

ou_multicluster_cert

Pros:

Cons:

Option 3 - Service Proxy

Deploy an OpenUnison instance to the target cluster who's ServiceAccount has cluster-admin privileges. The OpenUnison is a reverse proxy to the target cluster's API server that expects OpenID Connect id_token in each request issued by the control plane OpenUnison. The target OpenUnison would get the control plane OpenUnison's signature validation public key via the oidc discovery API. The id_token generated by the control plane's OpenUnison would have a one minute time-to-live to limit the impact if it were compromised.

ou_multicluster_proxy

Pros:

Cons:

Option 4 - Message bus based communication

Deploy an OpenUnison instance to the target cluster who's ServiceAccount has cluster-admin privileges. The target cluster OpenUnison is not exposed via Ingress. It listens for requests on the same message bus the control plane cluster runs on. When the control plane OpenUnison wants to communicate with a target OpenUnison it does so via message bus. The request is sent via one queue and the response to another.

ou_multicluster_messagebus

Pros:

Cons:

mlbiam commented 3 years ago

functional, but needs quite a bit of docs. will add in next release