Skip to content

Commit

Permalink
Update/clusterconfig (#412)
Browse files Browse the repository at this point in the history
* update configuration and workflow

* update entrypoint

* update namespace

* update configmap

* change domain

* add prod domain

* update configmap

* update preparedeployment

* add resolver.identity.foundation
  • Loading branch information
Pratap2018 authored Mar 13, 2024
1 parent 06354d0 commit 1ccbaf9
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kubernetes-deploy-to-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Deploy to AWS
uses: ./ci/deploy-k8s-aws
env:
KUBE_CONFIG_DATA: ${{env.KUBE_CONFIG_DATA}}
KUBE_CONFIG_DATA: ${{secrets.KUBE_CONFIG_DATA_BASE64_UNI_RESOLVER_PROD}}
AWS_ACCESS_KEY_ID: ${{env.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{env.AWS_SECRET_ACCESS_KEY}}
RPC_URL_TESTNET: ${{env.RPC_URL_TESTNET}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: uni-resolver-frontend
namespace: uni-resolver-dev
namespace: uni-resolver
data:
backend_url: https://dev.uniresolver.io/
26 changes: 13 additions & 13 deletions ci/deploy-k8s-aws/app-specs/deployment-uni-resolver-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: uni-resolver-frontend
namespace: uni-resolver-dev
namespace: uni-resolver
labels:
app: uni-resolver
type: frontend
Expand All @@ -17,23 +17,23 @@ spec:
app: uni-resolver-frontend
spec:
containers:
- name: uni-resolver-frontend
image: universalresolver/universal-resolver-frontend
imagePullPolicy: Always
ports:
- containerPort: 7081
env:
- name: BACKEND_URL
valueFrom:
configMapKeyRef:
name: uni-resolver-frontend
key: backend_url
- name: uni-resolver-frontend
image: universalresolver/universal-resolver-frontend
imagePullPolicy: Always
ports:
- containerPort: 7081
env:
- name: BACKEND_URL
valueFrom:
configMapKeyRef:
name: uni-resolver-frontend
key: backend_url
---
apiVersion: v1
kind: Service
metadata:
name: uni-resolver-frontend
namespace: uni-resolver-dev
namespace: uni-resolver
spec:
type: NodePort
selector:
Expand Down
4 changes: 2 additions & 2 deletions ci/deploy-k8s-aws/app-specs/deployment-uni-resolver-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: uni-resolver-web
namespace: uni-resolver-dev
namespace: uni-resolver
labels:
app: uni-resolver
type: backend
Expand Down Expand Up @@ -34,7 +34,7 @@ apiVersion: v1
kind: Service
metadata:
name: uni-resolver-web
namespace: uni-resolver-dev
namespace: uni-resolver
spec:
type: NodePort
selector:
Expand Down
2 changes: 1 addition & 1 deletion ci/deploy-k8s-aws/namespace/namespace-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ kubectl create -f namespace-setup.yaml
CLUSTER_NAME=$(kubectl config view -o=jsonpath='{.clusters[0].name}')
USER_NAME=$(kubectl config view -o=jsonpath='{.users[0].name}')

kubectl config set-context uni-resolver-dev --namespace=uni-resolver-dev \
kubectl config set-context uni-resolver --namespace=uni-resolver \
--cluster="$CLUSTER_NAME" \
--user="$USER_NAME"
4 changes: 2 additions & 2 deletions ci/deploy-k8s-aws/namespace/namespace-setup.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: uni-resolver-dev
name: uni-resolver
labels:
name: uni-resolver-dev
name: uni-resolver
1 change: 1 addition & 0 deletions ci/deploy-k8s-aws/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ ls -al .
echo "### Deploying following Specs ### "
cat deploy.sh


./deploy.sh
4 changes: 2 additions & 2 deletions ci/deploy-k8s-aws/scripts/k8s-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{containerName}}
namespace: uni-resolver-dev
namespace: uni-resolver
labels:
app: {{containerName}}
spec:
Expand Down Expand Up @@ -37,7 +37,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{containerName}}
namespace: uni-resolver-dev
namespace: uni-resolver
spec:
type: NodePort
selector:
Expand Down
22 changes: 20 additions & 2 deletions ci/deploy-k8s-aws/scripts/prepare-deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

# CONSTANTS you may need to change:
DEV_DOMAIN_NAME = 'dev.uniresolver.io'
PROD_DOMAIN_NAME='resolver.identity.foundation'
UNIVERSAL_RESOLVER_FRONTEND_TAG = "universalresolver/uni-resolver-frontend:latest;"
NAMESPACE = "uni-resolver-dev"
NAMESPACE = "uni-resolver"


def init_deployment_dir(outputdir):
Expand Down Expand Up @@ -91,7 +92,7 @@ def generate_ingress(containers, outputdir):
fout.write('kind: Ingress\n')
fout.write('metadata:\n')
fout.write(' name: \"uni-resolver-ingress\"\n')
fout.write(' namespace: \"uni-resolver-dev\"\n')
fout.write(' namespace: \"uni-resolver\"\n')
fout.write(' annotations:\n')
fout.write(' alb.ingress.kubernetes.io/scheme: internet-facing\n')
fout.write(' alb.ingress.kubernetes.io/certificate-arn: \"arn:aws:acm:us-east-2:332553390353:certificate/925fce37-d446-4af3-828e-f803b3746af0,arn:aws:acm:us-east-2:332553390353:certificate/59fa30ca-de05-4024-8f80-fea9ab9ab8bf\"\n')
Expand Down Expand Up @@ -119,6 +120,23 @@ def generate_ingress(containers, outputdir):
fout.write(' name: uni-resolver-frontend\n')
fout.write(' port:\n')
fout.write(' number: 7081\n')
fout.write(' - host: ' + PROD_DOMAIN_NAME + '\n')
fout.write(' http:\n')
fout.write(' paths:\n')
fout.write(' - path: /1.0/*\n')
fout.write(' pathType: ImplementationSpecific\n')
fout.write(' backend:\n')
fout.write(' service:\n')
fout.write(' name: uni-resolver-web\n')
fout.write(' port:\n')
fout.write(' number: 8080\n')
fout.write(' - path: /*\n')
fout.write(' pathType: ImplementationSpecific\n')
fout.write(' backend:\n')
fout.write(' service:\n')
fout.write(' name: uni-resolver-frontend\n')
fout.write(' port:\n')
fout.write(' number: 7081\n')


# for container in containers:
Expand Down

0 comments on commit 1ccbaf9

Please sign in to comment.