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

Add configmap mounting for RBAC teams ENG-3182 #3803

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

Sean-Holcomb
Copy link
Contributor

What does this PR change?

This PR adds the ability to mount a configmap via helm values to be used as a configuration for RBAC teams

Does this PR rely on any other PRs?

#3799
https://github.com/kubecost/kubecost-cost-model/pull/2875/files#diff-c2c67151419742af1f2e7c1e6e71238cda0f5bbb0a0a54147efa2fdd8ed8744a

How does this PR impact users? (This is the kind of thing that goes in release notes!)

Links to Issues or tickets this PR addresses or fixes

What risks are associated with merging this PR? What is required to fully test this PR?

How was this PR tested?

This PR was tested using helm template with the following values

rbac:
    teamsConfig:
      - id: test-id
        name: test-name
        roles:
          - id: test
        claims:
          key: value
          key2: value2

Key results in the template

env:
 ...
            - name: RBAC_TEAMS_HELM_CONFIG_PATH
              value: "/var/configs/rbac-teams-configs/rbac-teams-configs.json"

# Source: cost-analyzer/templates/kubecost-rbac-teams-configmap-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: "kubecost-rbac-teams-config"
  namespace: default
  labels:
    app.kubernetes.io/name: cost-analyzer
    helm.sh/chart: cost-analyzer-2.3.3
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/managed-by: Helm
    app: cost-analyzer
data:
  rbac-teams-configs.json: '[{"claims":{"key":"value","key2":"value2"},"id":"test-id","name":"test-name","roles":[{"id":"test"}]}]'
---
volumes:
  ...
        - name: kubecost-rbac-teams-config
          configMap:
            name: kubecost-rbac-teams-config
 volumeMounts:
            ...
            - name: kubecost-rbac-teams-config
              mountPath: /var/configs/rbac-teams-configs

Have you made an update to documentation? If so, please provide the corresponding PR.

Copy link
Contributor

@kaelanspatel kaelanspatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sean-Holcomb Sean-Holcomb merged commit 10145e1 into kaelan-rbac-rewrite Jan 8, 2025
19 checks passed
@Sean-Holcomb Sean-Holcomb deleted the sth/ENG-3182/config-map branch January 8, 2025 22:14
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 this pull request may close these issues.

2 participants