Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multitenant Service Account Name #44

Closed
blezoray opened this issue Jun 20, 2024 · 1 comment · Fixed by #63
Closed

Multitenant Service Account Name #44

blezoray opened this issue Jun 20, 2024 · 1 comment · Fixed by #63

Comments

@blezoray
Copy link

Today, in version 0.5.0, we can change the multitenant Service Account using kustomize patch, like this:

apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
spec:
...
  cluster:

    type: openshift
    multitenant: true
    networkPolicy: true
    domain: "cluster.local"
...
  kustomize:
    patches:
      - patch: |
          - op: add
            path: /spec/template/spec/containers/0/args/-
            value: --default-service-account=flux
        target:
          kind: Deployment
          name: "(kustomize-controller|helm-controller)"

As the result, the kustomize|helm controllers have these args (flux SA overwrite default SA):

  spec:
    containers:
      - args:
          - --events-addr=http://notification-controller.mpms-flux-operator.svc.cluster.local./
          - --watch-all-namespaces=true
          - --log-level=info
          - --log-encoding=json
          - --enable-leader-election
          - --no-cross-namespace-refs=true
          - --no-remote-bases=true
          - --default-service-account=default
          - --concurrent=10
          - --requeue-dependency=5s
          - --default-service-account=flux

Is it possible to add a new parameter, like spec.cluster.multitenantServiceAccountName in order to specify the name of this SA and to avoid any confusion ?

Rgds, Bruno.

@blezoray blezoray changed the title Multitenant Service Account Multitenant Service Account Name Jun 20, 2024
@erikgb
Copy link

erikgb commented Jun 27, 2024

I support this! We used to patch in all changes required for multi-tenant lock-down. When enabling the multitenant mode using the operator, we get double flags for the default service account - which could be a bit confusing for some users.

      args:
        - '--events-addr=http://notification-controller.flux-system.svc.cluster.local./'
        - '--watch-all-namespaces=true'
        - '--log-level=info'
        - '--log-encoding=json'
        - '--enable-leader-election'
        - '--no-cross-namespace-refs=true'
        - '--no-remote-bases=true'
        - '--default-service-account=default'
        - '--default-service-account=gitops-reconciler'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants