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 deployment manifests #88

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add deployment manifests #88

wants to merge 14 commits into from

Conversation

mgdaily
Copy link
Contributor

@mgdaily mgdaily commented Nov 13, 2024

This PR adds the deployment manifests for this project. These were created in line with the "Deploy Applications with ArgoCD" guide.

  • Adds base and local kustomization
  • Adds skaffold
  • Adds nix flake
  • Adds CD github workflow
  • Adds README instructions

cd:
uses: LCOGT/reusable-workflows/.github/workflows/continuous-deployment.yaml@main
with:
secretsExposedToSkaffold: 'FONTAWESOME_PACKAGE_TOKEN,'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This allows us to send the package token to skaffold, which is used in the reusable workflow to build the docker image.

"targetNameUrl": "https://simbad2k.lco.global/",
"configdbUrl": "http://configdb.lco.gtn/",
"demo": false
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We mount this to /config/config.json as a ConfigMap in the deployment

artifacts:
- image: lco-education-platform
custom:
buildCommand: skaffold-builder-buildx --build-arg FONTAWESOME_PACKAGE_TOKEN=${FONTAWESOME_PACKAGE_TOKEN}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can pass the package token as a docker build arg this way!

@mgdaily mgdaily requested a review from LTDakin November 13, 2024 22:47
command:
- "sh"
- "-c"
- "cp -r /app/dist/* /app/volume"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We updated this to simply copy the already built prod files from the docker image to a shared volume on the pod so that the static web server container could serve them. It felt wasteful to always build the app if a new pod is spun up.

- --health
- --port=8080
- --host=0.0.0.0
- --page-fallback=/app/dist/index.html
Copy link
Contributor Author

@mgdaily mgdaily Nov 13, 2024

Choose a reason for hiding this comment

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

This --page-fallback is necessary to force the static server to rely on the vue router (by routing to index.html) to route the browser. See https://static-web-server.net/features/error-pages/ for more details. Without it, when navigating to anything other than the root page, the server assumes it should serve /app/dist + /url/path (where /url/path is the path entered e.g. /dashboard) which results in a 404, since the views aren't organized in the directories exactly matching the paths.

I have a feeling that most of our frontend apps will need this config.

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