Skip to content

fix: readding maas-api service account and removing ref to non-existing secret#130

Merged
jland-redhat merged 3 commits intomainfrom
fix-service-account
Oct 2, 2025
Merged

fix: readding maas-api service account and removing ref to non-existing secret#130
jland-redhat merged 3 commits intomainfrom
fix-service-account

Conversation

@jland-redhat
Copy link
Copy Markdown
Contributor

@jland-redhat jland-redhat commented Oct 2, 2025

Somewhere along the line we lost the maas-api service account so adding it back in.

And this pr removes the admin secret but we still had some references to it that needed to be removed

Summary by CodeRabbit

  • Chores
    • Added a dedicated ServiceAccount for the MaaS API and included it in the base deployment.
    • Removed automatic generation and injection of the ADMIN_API_KEY secret from the overlay and deployment.
    • Prepares clearer identity management and secret handling for deployments.
    • No user-facing changes; runtime features and functionality remain unchanged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Adds a new ServiceAccount resource for maas-api and includes it in kustomization; removes generation and use of the maas-api admin secret and deletes the ADMIN_API_KEY env var from the maas-api Deployment.

Changes

Cohort / File(s) Summary of Changes
kustomize resources
deployment/base/maas-api/kustomization.yaml, deployment/base/maas-api/serviceaccount.yaml
Added serviceaccount.yaml and declared a ServiceAccount named maas-api; included it in kustomization resources.
Deployment env changes
deployment/base/maas-api/deployment.yaml
Removed the ADMIN_API_KEY environment variable and its secretKeyRef from the maas-api Deployment.
Overlay secret generator removed
maas-api/deploy/overlays/secret/kustomization.yaml
Removed the secretGenerator block and the patch reference for api-key-env-var.yaml; kustomize no longer generates maas-api-admin secret.
Patch removed / secret env patch
maas-api/deploy/overlays/secret/patches/api-key-env-var.yaml
Deleted the patch that injected ADMIN_API_KEY from a secret into the Deployment (file removed/patch dropped).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer / Kustomize
  participant K as Kustomize build
  participant K8s as Kubernetes

  rect rgb(235,245,255)
    note left of K: Old flow (before changes)
    Dev->>K: include secretGenerator + patch\n(add ADMIN_API_KEY from env)
    K->>K8s: generate Secret (maas-api-admin)
    K->>K8s: apply Deployment with secretKeyRef (ADMIN_API_KEY)
  end

  rect rgb(245,255,235)
    note left of K: New flow (after changes)
    Dev->>K: include `serviceaccount.yaml`,\nremove secretGenerator & patch
    K->>K8s: apply ServiceAccount (maas-api)
    K->>K8s: apply Deployment without ADMIN_API_KEY
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibble lines of YAML bright,
A tiny account springs into light.
Secrets tucked away, a cleaner tune,
I hop along under the moon.
Carrots and commits — happy night! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and succinctly describes the two primary changes in this pull request—restoring the maas-api service account and removing references to a missing secret—without extraneous detail or ambiguity, making it easy for reviewers to understand the core purpose of the PR at a glance.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-service-account

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e362cf and 9924b55.

📒 Files selected for processing (3)
  • deployment/base/maas-api/deployment.yaml (0 hunks)
  • maas-api/deploy/overlays/secret/kustomization.yaml (0 hunks)
  • maas-api/deploy/overlays/secret/patches/api-key-env-var.yaml (0 hunks)
💤 Files with no reviewable changes (3)
  • maas-api/deploy/overlays/secret/patches/api-key-env-var.yaml
  • maas-api/deploy/overlays/secret/kustomization.yaml
  • deployment/base/maas-api/deployment.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jland-redhat jland-redhat changed the title fix: readding maas-api service account fix: readding maas-api service account and removing ref to non-existing secret Oct 2, 2025
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This overlay is unrelated, but I think we can remove it entirely

Copy link
Copy Markdown
Collaborator

@bartoszmajsak bartoszmajsak left a comment

Choose a reason for hiding this comment

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

LGTM

@jland-redhat jland-redhat merged commit b1d60bd into main Oct 2, 2025
2 checks passed
@bartoszmajsak bartoszmajsak deleted the fix-service-account branch October 3, 2025 09:14
SB159 pushed a commit to SB159/maas-billing that referenced this pull request Oct 15, 2025
…ng secret (opendatahub-io#130)

* Service Account went missing

* Removing refrence to secret that is no longer used

* reverting change

---------

Co-authored-by: Jamie Land <hokie10@gmail.com>
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.

3 participants