Skip to content

Commit

Permalink
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
Mr0grog committed Mar 29, 2023
1 parent a1efdea commit fb6bcf6
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kubernetes/production/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: rails-server
image: envirodgi/db-rails-server:65fb2753c2964cac7b36005ae8c335b6ee06b901
image: envirodgi/db-rails-server:877ce5a4b33cbe7b17e94cb92f9b6d36ed965217
imagePullPolicy: Always
ports:
- containerPort: 3000
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/production/import-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: db-import-worker
image: envirodgi/db-import-worker:65fb2753c2964cac7b36005ae8c335b6ee06b901
image: envirodgi/db-import-worker:877ce5a4b33cbe7b17e94cb92f9b6d36ed965217
imagePullPolicy: Always
resources:
requests:
Expand Down
110 changes: 110 additions & 0 deletions kubernetes/production/jobs/api-migration-job.yaml
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"
2 changes: 1 addition & 1 deletion kubernetes/production/status-update-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
restartPolicy: OnFailure
containers:
- name: db-status-update-job
image: envirodgi/db-status-update-job:65fb2753c2964cac7b36005ae8c335b6ee06b901
image: envirodgi/db-status-update-job:877ce5a4b33cbe7b17e94cb92f9b6d36ed965217
imagePullPolicy: Always
resources:
requests:
Expand Down

0 comments on commit fb6bcf6

Please sign in to comment.