-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
We should remove the Redis deployments and services from the cluster after this successfully runs a daily import job in a few hours (or deal with whatever breaks!).
- Loading branch information
Showing
4 changed files
with
113 additions
and
3 deletions.
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
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,110 @@ | ||
# This job runs database migration for the API. | ||
# | ||
# It's designed to be run with the latest version of the rails server image. | ||
# You'll usually want to run it *before* deploying updates to the actual API | ||
# server, jobs, workers, etc: | ||
# | ||
# $ kubectl apply -f kubernetes/production/jobs/api-migration-job.yaml | ||
# # Wait for job to finish... | ||
# # ...and delete the job so it can be run again in the future. | ||
# $ kubectl delete -f kubernetes/production/jobs/api-migration-job.yaml | ||
# | ||
# Since Kubernetes jobs are idempotent, you should delete the job after it has | ||
# been successfully run so that you can run it again. | ||
# | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: api-migration-job | ||
namespace: production | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: api-migration-job | ||
image: envirodgi/db-status-update-job:latest | ||
command: ["bundle", "exec", "rake", "db:migrate"] | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "100m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1500m" | ||
env: | ||
- name: ALLOWED_ARCHIVE_HOSTS | ||
value: "https://edgi-wm-versionista.s3.amazonaws.com/ https://edgi-wm-versionista.s3-us-west-2.amazonaws.com/ https://edgi-versionista-archive.s3.amazonaws.com/ https://edgi-wm-archive.s3.amazonaws.com/ https://edgi-wm-archive.s3.us-west-2.amazonaws.com/" | ||
- name: AUTO_ANNOTATION_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: auto_annotation_user | ||
- name: AWS_ACCESS_KEY_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: aws_access_key_id | ||
- name: AWS_ARCHIVE_BUCKET | ||
value: edgi-wm-archive | ||
- name: AWS_REGION | ||
value: us-west-2 | ||
- name: AWS_SECRET_ACCESS_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: aws_secret_access_key | ||
- name: AWS_WORKING_BUCKET | ||
value: edgi-wm-db-internal | ||
- name: CACHE_DATE_DIFFER | ||
value: "2019-09-22T00:00:00Z" | ||
- name: DATABASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: database_rds | ||
- name: DIFFER_DEFAULT | ||
value: http://diffing:80 | ||
- name: HOST_URL | ||
value: "https://api.monitoring.envirodatagov.org/" | ||
- name: LANG | ||
value: en_US.UTF-8 | ||
- name: MAIL_SENDER | ||
value: website.monitoring@envirodatagov.org | ||
- name: MAX_COLLECTION_PAGE_SIZE | ||
value: "1000" | ||
- name: NEW_RELIC_AGENT_ENABLED | ||
value: "false" | ||
- name: POSTMARK_API_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: postmark_api_token | ||
- name: RACK_ENV | ||
value: production | ||
- name: RAILS_ENV | ||
value: production | ||
- name: RAILS_LOG_TO_STDOUT | ||
value: enabled | ||
- name: RAILS_SERVE_STATIC_FILES | ||
value: enabled | ||
- name: REDIS_URL | ||
value: redis://redis-master:6379 | ||
- name: SECRET_KEY_BASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: secret_key_base | ||
- name: SENTRY_DSN | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: sentry_dsn | ||
- name: TOKEN_PRIVATE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: app-secrets | ||
key: token_private_key | ||
- name: INCREMENTAL_UPDATE | ||
value: "1" |
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