Skip to content

Commit

Permalink
Merge pull request #251 from helium/feat/cloudfront-prod
Browse files Browse the repository at this point in the history
Adding cloudfront config to prod
  • Loading branch information
deasydoesit authored Nov 8, 2023
2 parents e2d574d + 0f1b36a commit c382f8d
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Invalidate CloudFront Distribution

on:
push:
branches:
- main
paths:
- 'manifests/web-cluster/prod/helium/metadata.yaml'

jobs:
cloudfront-invalidation:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Invalidate CloudFront distribution
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_WEB_PROD_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_WEB_PROD_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Create CloudFront Invalidation
run: |
DISTRIBUTION_ID=${{ secrets.AWS_WEB_PROD_CLOUDFRONT_DISTRIBUTION_ID }}
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ data:
{ "type": "RecipientV0", "table": "recipients", "schema": "public" }
]
}
],
"indexConfigs": [
"CREATE UNIQUE INDEX IF NOT EXISTS key_to_asset_asset_index ON key_to_assets(asset);",
"CREATE UNIQUE INDEX IF NOT EXISTS iot_hotspot_infos_asset_index ON iot_hotspot_infos(asset);",
"CREATE UNIQUE INDEX IF NOT EXISTS mobile_hotspot_infos_asset_index ON mobile_hotspot_infos(asset);"
]
}
---
Expand All @@ -146,7 +151,7 @@ spec:
serviceAccountName: public-monitoring-rds-monitoring-user-access
containers:
- name: account-postgres-sink-service
image: public.ecr.aws/v0j6k5v6/account-postgres-sink-service:0.0.62
image: public.ecr.aws/v0j6k5v6/account-postgres-sink-service:0.0.63
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
Expand Down
42 changes: 42 additions & 0 deletions manifests/web-cluster/prod/helium/entity-invalidator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: entity-invalidator
namespace: helium
spec:
schedule: "0 2 * * *"
concurrencyPolicy: "Forbid"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
backoffLimit: 10
template:
metadata:
labels:
app: 'entity-invalidator'
security-group: public-rds-access
spec:
restartPolicy: OnFailure
serviceAccountName: invalidation-role
containers:
- name: entity-invalidator
image: public.ecr.aws/v0j6k5v6/entity-invalidator:0.0.4
imagePullPolicy: IfNotPresent
env:
- name: PGHOST
value: monitoring-rds-read-replica.cbhihwhsofyu.us-west-2.rds.amazonaws.com
- name: PGPORT
value: "5432"
- name: PGUSER
value: monitoring
- name: AWS_REGION
value: us-west-2
- name: PGDATABASE
value: monitoring
- name: PGSSLMODE
value: no-verify
- name: CLOUDFRONT_DISTRIBUTION
value: EO5ODEGCJ6FK
- name: DOMAIN
value: entities.nft.helium.io
11 changes: 7 additions & 4 deletions manifests/web-cluster/prod/helium/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ spec:
app: metadata
security-group: public-rds-access
spec:
serviceAccountName: public-monitoring-rds-monitoring-user-access
serviceAccountName: public-monitoring-rds-read-replica-monitoring-user-access
containers:
- name: metadata
image: public.ecr.aws/v0j6k5v6/entity-metadata-service:0.0.20
image: public.ecr.aws/v0j6k5v6/entity-metadata-service:0.0.21
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8081
Expand All @@ -38,7 +38,7 @@ spec:
name: globals
key: solana_url
- name: PGHOST
value: monitoring-rds.cbhihwhsofyu.us-west-2.rds.amazonaws.com
value: monitoring-rds-read-replica.cbhihwhsofyu.us-west-2.rds.amazonaws.com
- name: PGPORT
value: "5432"
- name: PGUSER
Expand Down Expand Up @@ -69,9 +69,10 @@ spec:
timeoutSeconds: 1
resources:
requests:
cpu: 250m
cpu: 750m
memory: 500Mi
limits:
cpu: 1000m
memory: 750Mi
---
apiVersion: v1
Expand All @@ -97,6 +98,8 @@ metadata:
annotations:
nginx.ingress.kubernetes.io/limit-rps: "10"
nginx.ingress.kubernetes.io/limit-burst-multiplier: "10"
external-dns.alpha.kubernetes.io/hostname: "d2sqvm859jhkhq.cloudfront.net"
external-dns.alpha.kubernetes.io/ingress-hostname-source: "annotation-only"
spec:
ingressClassName: nginx
rules:
Expand Down
2 changes: 1 addition & 1 deletion manifests/web-cluster/sdlc/helium/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
serviceAccountName: public-monitoring-rds-read-replica-monitoring-user-access
containers:
- name: metadata
image: public.ecr.aws/v0j6k5v6/entity-metadata-service:0.0.20
image: public.ecr.aws/v0j6k5v6/entity-metadata-service:0.0.21
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8081
Expand Down

0 comments on commit c382f8d

Please sign in to comment.