- Setting up dependencies for all packages
npm run setup
- Creating new packages
lerna create <package>
- Adding dependencies or packages to a specific package
lerna add <dependency/package> --scope <package>
- Listing all packages
lerna list
cd packages/frontend
npm run start
cd packages/core
docker-compose --env-file .env.docker up -d
npm run dev
docker run -p 9200:80 -e "[email protected]" -e "PGADMIN_DEFAULT_PASSWORD=postgres" --add-host=host.docker.internal:host-gateway -d dpage/pgadmin4
- Delele old cluster
kind delete clusters turingq-local
- Create Registry
cd resources/registry
docker-compose up -d
- Recreate the cluster Kind and configure Ingress
cd ../kubernetes
sh create-kind-cluster.sh
kubectl apply -f ../ingress/k8s/setup.yml
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=90s
kubectl apply -f ../ingress/k8s/ingress.yml
- Up authorizer:
- If no have container registry in Docker before, execute:
npm run deploy:local:authorizer
- Or, execute:
npm run kubernetes:setup:authorizer
- Get KEYCLOAK_REALM_TOKEN_SIGNATURE_PUBLIC_KEY env in Keycloak
- Access http://localhost:9090/auth/
- Copy Realm Settings -> Keys -> RS256 - SIG
- Set KEYCLOAK_REALM_TOKEN_SIGNATURE_PUBLIC_KEY in files:
- packages/core/k8s/core/config-map.yml
- packages/questions/k8s/questions/config-map.yml
- Up RabbitMq
npm run kubernetes:setup:message-broker
- Deploy apps
- If no have container registry in Docker before, execute:
npm run deploy:local:core npm run deploy:local:frontend npm run deploy:local:questions
- Or, execute:
npm run kubernetes:setup:core npm run kubernetes:setup:frontend npm run kubernetes:setup:questions
- Config .env
cp .env.example .env
Edit values: AWS_ACCOUNT_ID and AWS_REGION
- Login in AWS - ECR
npm run docker:prod:login
-
In AWS platform, create registries in ECR: authorizer-config, turingq-core, turingq-frontend, turingq-questions and turingq-subscriptions
-
Send images to ECR
npm run docker:prepare-prod-image:authorizer-config
npm run docker:prepare-prod-image:core
npm run docker:prepare-prod-image:frontend
npm run docker:prepare-prod-image:questions
npm run docker:prepare-prod-image:subscriptions
- Create cluster EKS
eksctl create cluster --config-file resources/aws/cluster.yml
- Obs.: To destroy the cluster
eksctl delete cluster --config-file resources/aws/cluster.yml
- Config ${REPO_HOST}
export REPO_HOST=${AWS_ACCOUNT_ID}.dkr.ecr.us-east1.amazonaws.com
Obs.: Change value ${AWS_ACCOUNT_ID} to your aws account id
- Create ingress
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/aws/deploy.yaml
Obs.: Verify ingress
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=120s
- Create ingress for the services
kubectl apply -f resources/ingress/k8s/ingress.yml
kubectl get svc --namespace=ingress-nginx
-
Change values of secrets keys
-
Configure "rootUrl", "redirectUris" and "webOrigins" of packages/authorizer/config/turingq-prod.json to Load Balancer URL (kubectl get svc --namespace=ingress-nginx)
-
Run
npm run docker:prepare-prod-image:authorizer-config
- Deploy Authorizer
npm run kubernetes:setup:authorizer
- Get KEYCLOAK_REALM_TOKEN_SIGNATURE_PUBLIC_KEY env in Keycloak
- Access Keycloak ${REPO_HOST}/auth
- Copy Realm Settings -> Keys -> RS256 - SIG
- Set KEYCLOAK_REALM_TOKEN_SIGNATURE_PUBLIC_KEY in files:
- packages/core/k8s/core/config-map.yml
- packages/questions/k8s/questions/config-map.yml
- In packages/frontend change .env.production.local:
- REACT_APP_API_BASE_URL: '${REPO_HOST}/api'
- REACT_APP_AUTH_SERVER_URL: '${REPO_HOST}/auth/'
- Build the image frontend and send to ECR:
npm run docker:prepare-prod-image:frontend
-
Config envs of config-maps
-
Deploy the services:
npm run kubernetes:setup:message-broker
npm run kubernetes:setup:frontend
npm run kubernetes:setup:core
npm run kubernetes:setup:questions
npm run kubernetes:setup:subscriptions