forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 3
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
PLG Cloud.gov #3192
Open
elipe17
wants to merge
80
commits into
develop
Choose a base branch
from
3046-plg-cloud
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PLG Cloud.gov #3192
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
fd4e974
- Add log file rollover
elipe17 feec150
- Add initial configs for cloud deployments
elipe17 8805b94
- initial config for grafana deploy
elipe17 cd4b739
- Remove empty file
elipe17 c935ce0
- move data sources to template file
elipe17 b7bd9e4
- general deploy routine for pg and grafana
elipe17 092df96
- added deploy routine for prometheus
elipe17 1440b7f
- Added deploy routine for loki
elipe17 c6edd4a
- Initial update for promtail sidecars
elipe17 19b48a1
- allow deploy no matter test state
elipe17 0d2518a
- Update deploy scripts to prepare promtail config
elipe17 e495aac
- add quotes
elipe17 8388f40
- Update frontend to write error log to file
elipe17 57de9d4
-- for faster turnaround
elipe17 3da3526
- add ignore for file generation
elipe17 4797ced
- Move limits to per process
elipe17 6b1eedd
- update disk quota to match backend
elipe17 30ca7fc
- Uping promtail memory
elipe17 9926c4d
- Explicitely execute nginx
elipe17 79d578d
- Testing less memory
elipe17 5bb32d2
- Tell nginx to reload
elipe17 2316312
- try removing nginx command
elipe17 bd60f78
- remove stderr log
elipe17 7767c17
- try removing extra buildpaack
elipe17 60827e0
- re-add errorlog pipe
elipe17 96abb6b
- remove blank line
elipe17 c44692e
- remove error log for test
elipe17 e1e272b
- remove resolver directive as test
elipe17 d8b27d3
- test hard coded vals
elipe17 17b22f1
- revert conf changes
elipe17 8c121d9
Merge branch 'develop' into 3046-plg-cloud
elipe17 dfa6de8
- Testing with latest nginx buildpack
elipe17 0078a86
- revert to original manifest
elipe17 4f9d4d5
- revert buildpack and nginx.conf
elipe17 9f82e14
- test promtail as a sidecar
elipe17 4527ed6
- Update loki to store logs in s3
elipe17 764e041
- add bucket name
elipe17 4a35d01
- add path for local loki directories
elipe17 d6acc58
- Update path prefix
elipe17 7d70d19
- Add networking commands for PLG
elipe17 47fafaf
- alleviate secrets check
elipe17 7ceb3d9
- UPdated deploy script
elipe17 cc73759
- update comment in route
elipe17 9e00a31
- add internal apps to allowed hosts
elipe17 5e43a1f
- Updated local proxy config to correctly proxy grafana
elipe17 d08a4c9
- Explicitely mark netpols to route to dev env
elipe17 bc960b5
- intermediate commit
elipe17 0a4bbe8
- Updates to deploy script
elipe17 f3cc7c7
- Update prometheus scrape configs to have all envs
elipe17 5e64f68
Merge branch 'develop' of https://github.com/raft-tech/TANF-app into …
elipe17 fb7f807
- Remove promtail sidecar from frontend
elipe17 8cc8430
- remove manifest tremplate usage
elipe17 98e1cb2
- remove env expansion from loki
elipe17 6b3ab12
- Give loki a local config for comparison
elipe17 e24b3cd
- add db size visualizaiton
elipe17 654ccc4
- Update loki local to use local stack storage
elipe17 a43da06
- log level info
elipe17 25487cc
- get promtail logs to file
elipe17 2428d41
- Move promtail process into gunicorn script
elipe17 e949849
- Update job label to be templated
elipe17 f38cf87
- Add space switching to allow for correct networking
elipe17 88c6d4e
- Update dashboards
elipe17 69ee469
- export missing DB metrics
elipe17 3a05246
- fix dashboard for local use
elipe17 0dfb56c
- correct name
elipe17 3fe36bc
- Update to use datasource uid
elipe17 d519ca2
- fix name
elipe17 d40b2c4
- Move log file to /tmp
elipe17 8b310a9
- make deployments rolling
elipe17 0578058
- update terraform
elipe17 9488843
- re-enable testing
elipe17 9eeee32
Merge branch 'develop' into 3046-plg-cloud
elipe17 0d242d7
- Remove debug stuff
elipe17 9d1604d
Change scrape to happen every 15s
elipe17 1afb129
Merge branch 'develop' into 3046-plg-cloud
elipe17 e1696da
Merge branch 'develop' into 3046-plg-cloud
elipe17 84999f1
- extra tests. mroe to be added
elipe17 31bdfe2
Merge branch '3046-plg-cloud' of https://github.com/raft-tech/TANF-ap…
elipe17 2895f9c
Merge branch 'develop' into 3046-plg-cloud
elipe17 34798ae
Merge branch 'develop' into 3046-plg-cloud
elipe17 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,4 +108,7 @@ tfapply | |
cypress.env.json | ||
|
||
# Patches | ||
*.patch | ||
*.patch | ||
|
||
# Logs | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
help() { | ||
echo "Deploy the PLG stack or a Postgres exporter to the Cloud Foundry space you're currently authenticated in." | ||
echo "Syntax: deploy.sh [-h|a|p|u|d]" | ||
echo "Options:" | ||
echo "h Print this help message." | ||
echo "a Deploy the entire PLG stack." | ||
echo "p Deploy a postgres exporter. Requires -u and -d" | ||
echo "u Requires -p. The database URI the exporter should connect with." | ||
echo "d Requires -p. The Cloud Foundry service name of the RDS instance." | ||
echo | ||
} | ||
|
||
deploy_pg_exporter() { | ||
pushd postgres-exporter | ||
MANIFEST=manifest.$1.yml | ||
cp manifest.yml $MANIFEST | ||
|
||
APP_NAME="pg-exporter-$1" | ||
|
||
yq eval -i ".applications[0].name = \"$APP_NAME\"" $MANIFEST | ||
yq eval -i ".applications[0].env.DATA_SOURCE_NAME = \"$2\"" $MANIFEST | ||
yq eval -i ".applications[0].services[0] = \"$3\"" $MANIFEST | ||
|
||
cf push --no-route -f $MANIFEST -t 180 --strategy rolling | ||
cf map-route $APP_NAME apps.internal --hostname $APP_NAME | ||
|
||
# Add policy to allow prometheus to talk to pg-exporter | ||
# TODO: this logic needs to be updated to allow routing accross spaces based on where we want PLG to live. | ||
cf add-network-policy prometheus $APP_NAME -s "tanf-dev" --protocol tcp --port 9187 | ||
rm $MANIFEST | ||
popd | ||
} | ||
|
||
deploy_grafana() { | ||
pushd grafana | ||
APP_NAME="grafana" | ||
DATASOURCES="datasources.yml" | ||
cp datasources.template.yml $DATASOURCES | ||
|
||
yq eval -i ".datasources[0].url = \"http://prometheus.apps.internal:8080\"" $DATASOURCES | ||
yq eval -i ".datasources[1].url = \"http://loki.apps.internal:8080\"" $DATASOURCES | ||
|
||
cf push --no-route -f manifest.yml -t 180 --strategy rolling | ||
# cf map-route $APP_NAME apps.internal --hostname $APP_NAME | ||
# Give Grafana a public route for now. Might be able to swap to internal route later. | ||
cf map-route "$APP_NAME" app.cloud.gov --hostname "${APP_NAME}" | ||
|
||
# Add policy to allow grafana to talk to prometheus and loki | ||
cf add-network-policy $APP_NAME prometheus --protocol tcp --port 8080 | ||
cf add-network-policy $APP_NAME loki --protocol tcp --port 8080 | ||
rm $DATASOURCES | ||
popd | ||
} | ||
|
||
deploy_prometheus() { | ||
pushd prometheus | ||
cf push --no-route -f manifest.yml -t 180 --strategy rolling | ||
cf map-route prometheus apps.internal --hostname prometheus | ||
popd | ||
} | ||
|
||
deploy_loki() { | ||
pushd loki | ||
cf push --no-route -f manifest.yml -t 180 --strategy rolling | ||
cf map-route loki apps.internal --hostname loki | ||
popd | ||
} | ||
|
||
while getopts ":hap:u:d:" option; do | ||
case $option in | ||
h) # display Help | ||
help | ||
exit;; | ||
a) # Deploy PLG stack | ||
DEPLOY="plg";; | ||
p) # Deploy a Postgres exporter to $ENV | ||
ENV=$OPTARG | ||
DEPLOY="pg-exporter";; | ||
u) # Bind a Postgres exporter to $DB_URI | ||
DB_URI=$OPTARG;; | ||
d) # Bind a Postgres exporter to $DB_SERVICE_NAME | ||
DB_SERVICE_NAME=$OPTARG;; | ||
\?) # Invalid option | ||
echo "Error: Invalid option" | ||
exit;; | ||
esac | ||
done | ||
|
||
if [ "$#" -eq 0 ]; then | ||
help | ||
exit | ||
fi | ||
|
||
pushd "$(dirname "$0")" | ||
if [ "$DEPLOY" == "plg" ]; then | ||
deploy_prometheus | ||
deploy_loki | ||
deploy_grafana | ||
fi | ||
if [ "$DEPLOY" == "pg-exporter" ]; then | ||
if [ "$DB_URI" == "" ] || [ "$DB_SERVICE_NAME" == "" ]; then | ||
echo "Error: you must also pass -u and -d when deploying a postgres exporter." | ||
echo | ||
help | ||
popd | ||
exit | ||
fi | ||
deploy_pg_exporter $ENV $DB_URI $DB_SERVICE_NAME | ||
fi | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want PLG to live in prod? If so, need to update networking.