Skip to content

Commit

Permalink
Add deploy files
Browse files Browse the repository at this point in the history
  • Loading branch information
gofman8 committed Aug 21, 2024
1 parent 4efaa74 commit 609d0ac
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 184 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"app_name": "rootstock-client-gateway",
"aws_region": "us-east-2",
"k8s_cluster_name": "k8-mainnet",
"registry": "docker.io",
"image_name": "sovryn/rootstock-client-gateway",
"prod_branch": "production",
"dev_branch": "main",
"dockerfile_path": ".",
"APP_ENV_VARS": {
"EXCHANGE_API_BASE_URI": "http://api.exchangeratesapi.io/latest",
"CHAIN_INFO_REQUEST_TIMEOUT": "15000",
"SAFE_APP_INFO_REQUEST_TIMEOUT": "10000",
"INTERNAL_CLIENT_CONNECT_TIMEOUT": "10000",
"CONCURRENT_BALANCE_TOKEN_REQUESTS": "5",
"VPC_TRANSACTION_SERVICE_URI": "true",
"LOG_ALL_ERROR_RESPONSES": "false",
"RUST_LOG": "safe_client_gateway=error,safe_client_gateway::monitoring=info",
"ROCKET_ADDRESS": "0.0.0.0",
"ROCKET_PORT": "8000",
"ROCKET_LOG_LEVEL": "normal",
"SCHEME": "http",
"FEATURE_FLAG_NESTED_DECODING": "true",
"FEATURE_FLAG_BALANCES_RATE_IMPLEMENTATION": "false",
"REDIS_URI": "redis://gnosis.axfxfv.ng.0001.use2.cache.amazonaws.com:6379",
"REDIS_HOST_MAINNET": "gnosis.axfxfv.ng.0001.use2.cache.amazonaws.com",
"REDIS_PORT_MAINNET": "6379",
"REDIS_URI_MAINNET": "redis://gnosis.axfxfv.ng.0001.use2.cache.amazonaws.com:6379"
},
"DEV_ENV_VARS": {
"CONFIG_SERVICE_URI": "https://safe-config.test.sovryn.app",
"INGRESS_HOSTNAME": "safe-client.test.sovryn.app"
},
"PROD_ENV_VARS": {
"CONFIG_SERVICE_URI": "https://safe-config.sovryn.app",
"INGRESS_HOSTNAME": "safe-client.sovryn.app"
}
}
184 changes: 0 additions & 184 deletions .github/workflows/ci.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI Template

on:
push:
branches: [ production, main ]
workflow_dispatch:

jobs:
call-workflow-init:
uses: DistributedCollective/.github/.github/workflows/init.yml@master
with:
ref: ${{ github.ref }}
base_ref: ${{ github.base_ref }}
call-workflow-docker-build:
uses: DistributedCollective/.github/.github/workflows/docker.yml@master
needs: [call-workflow-init]
with:
KUBE_NAMESPACE: ${{ needs.call-workflow-init.outputs.KUBE_NAMESPACE }}
IMAGE_NAME: ${{ needs.call-workflow-init.outputs.image_name }}
event_name: ${{ github.event_name }}
registry: ${{ needs.call-workflow-init.outputs.registry }}
dockerfile_path: ${{ needs.call-workflow-init.outputs.dockerfile_path }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
call-workflow-k8s-deploy:
uses: DistributedCollective/.github/.github/workflows/deploy-k8s.yml@master
needs: [call-workflow-init, call-workflow-docker-build]
if: github.event_name != 'pull_request'
with:
KUBE_NAMESPACE: ${{ needs.call-workflow-init.outputs.KUBE_NAMESPACE }}
IMAGE_NAME: ${{ needs.call-workflow-init.outputs.image_name }}
ci_env: ${{ needs.call-workflow-init.outputs.ci_env }}
aws_region: ${{ needs.call-workflow-init.outputs.aws_region }}
k8s_cluster_name: ${{ needs.call-workflow-init.outputs.k8s_cluster_name }}
app_name: ${{ needs.call-workflow-init.outputs.app_name }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
77 changes: 77 additions & 0 deletions deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: '1'
labels:
app: rootstock-client-gateway
name: rootstock-client-gateway
spec:
replicas: 1
selector:
matchLabels:
app: rootstock-client-gateway
strategy:
type: Recreate
template:
metadata:
labels:
app: rootstock-client-gateway
spec:
containers:
- image: sovryn/rootstock-client-gateway
imagePullPolicy: Always
envFrom:
- secretRef:
name: rootstock-client-gateway
- secretRef:
name: rootstock-client-gateway-secret
name: web
resources:
requests:
memory: "384Mi"
cpu: "100m"
limits:
memory: "384Mi"
cpu: "200m"
tty: true
volumeMounts:
- mountPath: /nginx
name: nginx-shared
- image: nginx:1.21-alpine
name: nginx
envFrom:
- secretRef:
name: rootstock-client-gateway
- secretRef:
name: rootstock-client-gateway-secret
ports:
- containerPort: 80
resources: {}
volumeMounts:
- name: nginxconf
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
- mountPath: /nginx
name: nginx-shared
restartPolicy: Always
volumes:
- name: nginx-shared
emptyDir: {}
- name: nginxconf
secret:
secretName: rootstock-client-gateway-nginx
imagePullSecrets:
- name: regcred
---
apiVersion: v1
kind: Service
metadata:
name: rootstock-client-gateway
spec:
selector:
app: rootstock-client-gateway
ports:
- port: 443
targetPort: 80
type: NodePort
17 changes: 17 additions & 0 deletions ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rootstock-client-gateway-ingress
spec:
ingressClassName: nginx
rules:
- host: ingress.hostname
http:
paths:
- backend:
service:
name: rootstock-client-gateway
port:
number: 443
path: /
pathType: Prefix

0 comments on commit 609d0ac

Please sign in to comment.