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 environment value and set config appropriately #201

Conversation

ri-roee
Copy link

@ri-roee ri-roee commented Jun 13, 2024

Description of the change

By default the app-config.production.yaml file is not used in bootup process of backstage. This leads to misconfiguration and confusion (see attached issue). This PR is a no-op for folks who continue to not set backstage.environment value, however those using the production string will have the config correctly passed in.

Existing or Associated Issue(s)

backstage/backstage#25189

Additional Information

It is not strictly required to pass in --config app-config.yaml however I felt that being extra verbose would be clearer in this case.

I noticed that the ct install tests were failing, even off master, and I believe this is due to the NODE_ENV not being set correctly thus causing the guest auth provider to error out. I now set that env var based on the backstage environment

Checklist

  • Chart version bumped in Chart.yaml according to semver.
  • Variables are documented in the values.yaml and added to the README.md. The helm-docs utility can be used to generate the necessary content. Use helm-docs --dry-run to preview the content.
  • JSON Schema generated.
  • List tests pass for Chart using the Chart Testing tool and the ct lint command.

Signed-off-by: Roee Landesman <roee@robustintelligence.com>
@ri-roee ri-roee requested a review from a team as a code owner June 13, 2024 19:00
Signed-off-by: Roee Landesman <roee@robustintelligence.com>
Copy link

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Jun 22, 2024
@ri-roee
Copy link
Author

ri-roee commented Jun 24, 2024

@ChrisJBurns sorry to tag you in this directly, but wanted to make sure you saw it as its marked stale! Would appreciate a review :)

@vinzscam vinzscam removed the stale label Jun 24, 2024
Copy link
Member

@vinzscam vinzscam left a comment

Choose a reason for hiding this comment

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

Hi @ri-roee! I agree that this might cause some confusion, sorry if this issue has made you lose some time 😅

I think the main issue is that the "ejected" Dockerfile created when you bootstrap a new Backstage app loads app-config.production.yaml by default. Suggesting to use an app-config.production.yaml file isn't appropriate in case sensitive data is present in the file. This is the reason why this chart provides a few options for passing app-config files: https://github.com/backstage/charts/tree/main/charts/backstage#configure-your-backstage-instance

I think the best way to address the issue is to remove the extra "--config", "app-config.production.yaml" argument in https://github.com/backstage/backstage/blob/c9a2e9663466c6db7d2ed9b036080e6205746268/packages/create-app/templates/default-app/packages/backend/Dockerfile#L52 and perhaps we could mention the docs in this chart describing how to pass extra config files using backstage.args.

| backstage.containerPorts | Container ports on the Deployment | object | `{"backend":7007}` |
| backstage.containerSecurityContext | Security settings for a Container. <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container | object | `{}` |
| backstage.environment | Backstage container environment: development, production | string | `"development"` |
Copy link
Member

Choose a reason for hiding this comment

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

this adds some complexity as you should be able to achieve the same thing by passing the extra flags you want as arguments:

backstage:
  args: ["--config", "app-config.yaml", "--config", "app-config.whatever.yaml"]

Copy link

github-actions bot commented Jul 2, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Jul 2, 2024
@github-actions github-actions bot closed this Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants