dbones-labs / lab-dev

OrgOps - Enable DevOps with GitOps and KubeOps
https://github.com/dbones-labs/lab-dev/wiki
1 stars 0 forks source link

tenancy and deployment for downstream clusters #4

Open dbones opened 2 years ago

dbones commented 2 years ago

deployment rbac


Rancher require

namespaces to have an annotation

then rancher can manage the rbac in the project for all the namespaces.


fleet requires (for a secure setup)

to limit where a tenancy can deploy too

serviceaccounts are not linked to projects

so the contecpt of a tenancy will need to be controlled by namepaces, not by projects for this part

dbones commented 2 years ago

we can setup a separate Repo that is controlled by lab.dev, it has all the metadata, this can then be registered with all clusters and push the correct updates (via fleet)

lab.dev can checkin changes

this would minimise the

however we need to handle git and also have a dedicated Repo, created when the org is setup in Github.

dbones commented 2 years ago

the service account needs alot of access to default

Image

dbones commented 2 years ago

consider a controller to ensure the resources are correct for each tennet

dbones commented 2 years ago
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
  name: lab-ds
  namespace: fleet-default
spec:
  branch: main
  clientSecretName: github-credentials
  insecureSkipTLSVerify: false
  paths: []
  repo: https://github.com/fox-in-the-lab/lab.git
  serviceAccount: tenancy1
  targets:
  - clusterGroup: downstream

---

apiVersion: fleet.cattle.io/v1alpha1
kind: ClusterGroup
metadata:
  name: downstream
  namespace: fleet-default
spec:
  selector:
    matchExpressions: []
    matchLabels: {}
dbones commented 2 years ago

Image

dbones commented 2 years ago

use special folders to control deployment to sub-cluster assets

Image

targetCustomizations:
  - name: bob
    clusterSelector:
      matchExpressions:
        - key: lab.dev/name2
          Operator: In
          values:
            - aqua
    yaml:
      overlays:
        - deploy
dbones commented 2 years ago

This looks correct :)

Image

note that billing is not in the following

Image

(and galaxy does not exist in this cluster) Image

dbones commented 2 years ago

note that he graph does not filter out clusters it does not deploy a bundle too (in this case only aqua would be listed)

Image

dbones commented 2 years ago

the service account is applied :)


Image

this is allowed :)

Image


Image

not allows - as expected

Image

dbones commented 2 years ago

now we need a good mechanism to allow the company to supply the default namespace bindings

dbones commented 2 years ago

MORE NOTES

https://www.youtube.com/watch?v=VGqJ-QvhkIw

Image