Skip to content

Commit

Permalink
Adding graphql deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
leboiko committed Jan 22, 2025
1 parent 57c2cd9 commit baad2fc
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devops/aws/ingress/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
pathType: Prefix
backend:
service:
name: dev-base-mainnet-graphql-engine
name: prod-base-mainnet-graphql-engine
port:
number: 8080
- host: prod.base-sepolia.intuition-api.com
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: graphql-engine
spec:
template:
spec:
serviceAccountName: secrets-access-sa
containers:
- name: graphql-engine
volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets"
readOnly: true
envFrom:
- secretRef:
name: prod-mainnet-sepolia-hasura-aws-secrets
volumes:
- name: secrets-store-inline
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "prod-base-mainnet-prod-mainnet-sepolia-hasura-aws-secrets"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: batch/v1
kind: Job
metadata:
name: indexer-and-cache-migration
spec:
template:
spec:
serviceAccountName: secrets-access-sa
containers:
- name: indexer-and-cache-migration
image: ghcr.io/0xintuition/indexer-and-cache-migrations:1.0.42
imagePullPolicy: Always
volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets"
readOnly: true
envFrom:
- secretRef:
name: prod-mainnet-sepolia-hasura-aws-secrets
volumes:
- name: secrets-store-inline
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "prod-base-mainnet-prod-mainnet-sepolia-hasura-aws-secrets"
restartPolicy: Never
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base # Adjusted to point to the base directory
- secret-provider.yaml
- indexer-migrations.yaml

namePrefix: "prod-base-mainnet-"

patches:
- path: deployment-patch.yaml
target:
kind: Deployment
name: graphql-engine

- path: migrations-patch.yaml
target:
kind: Job
name: hasura-migrations

commonLabels:
network: base-mainnet

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: batch/v1
kind: Job
metadata:
name: hasura-migrations
spec:
template:
spec:
containers:
- name: hasura-migrations
image: ghcr.io/0xintuition/hasura-migrations:1.0.42
imagePullPolicy: Always
volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets"
readOnly: true
envFrom:
- secretRef:
name: prod-mainnet-sepolia-hasura-aws-secrets
volumes:
- name: secrets-store-inline
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "prod-base-mainnet-prod-mainnet-sepolia-hasura-aws-secrets"
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: prod-mainnet-sepolia-hasura-aws-secrets
namespace: default
spec:
provider: aws
parameters:
objects: |
- objectName: "new-be-secrets-prod-base-mainnet"
objectType: "secretsmanager"
objectVersionLabel: "AWSCURRENT"
jmesPath:
- path: "HASURA_GRAPHQL_ADMIN_SECRET"
objectAlias: "HASURA_GRAPHQL_ADMIN_SECRET"
- path: "PINATA_AUTH"
objectAlias: "PINATA_AUTH"
- path: "HASURA_GRAPHQL_ENDPOINT"
objectAlias: "HASURA_GRAPHQL_ENDPOINT"
- path: "HASURA_GRAPHQL_METADATA_DATABASE_URL"
objectAlias: "HASURA_GRAPHQL_METADATA_DATABASE_URL"
- path: "DATABASE_URL"
objectAlias: "DATABASE_URL"
secretObjects:
- secretName: "prod-mainnet-sepolia-hasura-aws-secrets" # The name of the Kubernetes secret to create
type: Opaque
data:
- objectName: "HASURA_GRAPHQL_ADMIN_SECRET"
key: "HASURA_GRAPHQL_ADMIN_SECRET"
- objectName: "PINATA_AUTH"
key: "PINATA_AUTH"
- objectName: "HASURA_GRAPHQL_ENDPOINT"
key: "HASURA_GRAPHQL_ENDPOINT"
- objectName: "HASURA_GRAPHQL_METADATA_DATABASE_URL"
key: "HASURA_GRAPHQL_METADATA_DATABASE_URL"
- objectName: "DATABASE_URL"
key: "DATABASE_URL"

0 comments on commit baad2fc

Please sign in to comment.