# cd /kra-data/ndml-kra.devops/setup/services/dev/crux/crux-qa # prerequisites make sure that database and db-user for crux is created # build the crux application (frontend and backend) inside the build-tool container # exec into the build-tool pod kubectl get pods -n build-tool kubectl exec -it -n build-tool -- /bin/bash cd /app/crux/crux-qa/ git clone https://github.com/remiges-tech/crux-ui.git git clone https://github.com/remiges-tech/crux.git # build the UI using following commands cd crux-ui open src/environments/environment.development.ts and replace the "http://localhost:8084/api/v1" to "http://13.201.78.242:31015/api/v1" and run the following commands npm i ng build cp -r src/assets/ dist/crux-ui cp src/favicon.ico dist/crux-ui tar cvzf crux-ui-qa.tar.gz dist/crux-ui # build the backend cd crux/db/migrations open the tern.conf file and make necessary changes in the file (host, port, database, user, password) and run the following commands tern migrate go build tar cvzf crux-api-qa.tar.gz crux config_dev.json # copy build files to the host machine kubectl cp build-tool/:/app/crux/crux-dev/crux-ui/crux-ui-qa.tar.gz crux-ui-qa.tar.gz kubectl cp build-tool/:/app/crux/crux-dev/crux/crux-api-qa.tar.gz crux-api-qa.tar.gz # create namespace crux-qa kubectl create ns crux-qa # open the crux-frontend.yaml file and check the mount path inside container, replicas, nodeSelector, container images, container ports, service ports, environment variables to connect elasticsearch like url, username and password. # Also files and update storage section and host path to mount persistent volume. # Also update external access url and port number. # deploy the file by below command kubectl apply -f crux-frontend.yaml -n crux-qa # output service/crux-ui-service configured deployment.apps/crux-web configured persistentvolume/crux-qa-web-config-pv-volume configured persistentvolume/crux-qa-web-data-pv-volume configured persistentvolumeclaim/crux-qa-web-config-pv-claim configured persistentvolumeclaim/crux-qa-web-data-pv-claim configured # confirmed deployment by running below command kubectl get all -n crux-qa --------------------- (will give pods, deployment and service data) # check whether pods are in running state or not NAME READY STATUS RESTARTS AGE pod/crux-web-76c848d846-w2vvn 1/1 Running 0 9d NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE crux-ui-service LoadBalancer X.X.X.X X.X.X.X 5601:30005/TCP 16d NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/crux-web 1/1 1 1 13d NAME DESIRED CURRENT READY AGE replicaset.apps/crux-web-76c848d846 1 1 1 13d # check logs using below command kubectl logs -n crux-qa # check description of pod using below command kubectl describe pod -n crux-qa e.g. kubectl describe pod -n crux-qa pod/crux-web-76c848d846-w2vvn # copy the frontend build files inside the pod and untar the files kubectl cp crux-ui-qa.tar.gz crux-qa/:/usr/share/nginx/html/ kubectl exec -it -n crux-qa -- /bin/bash cd /usr/share/nginx/html/ tar xzvf crux-ui-qa.tar.gz nginx -s reload # backend deployment # open the crux-backend.yaml file and check the mount path inside container, replicas, nodeSelector, container images, container ports, service ports, environment variables to connect elasticsearch like url, username and password. # Also files and update storage section and host path to mount persistent volume. # deploy the file by below command kubectl apply -f crux-backend.yaml -n crux-qa # output service/crux-api-service configured deployment.apps/crux-api configured persistentvolume/crux-qa-api-config-pv-volume configured persistentvolume/crux-qa-api-data-pv-volume configured persistentvolumeclaim/crux-qa-api-config-pv-claim configured persistentvolumeclaim/crux-qa-api-data-pv-claim configured # confirmed deployment by running below command kubectl get all -n crux-qa --------------------- (will give pods, deployment and service data) # check whether pods are in running state or not NAME READY STATUS RESTARTS AGE pod/crux-api-76c848d846-w2vvn 1/1 Running 0 9d NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE crux-api-service LoadBalancer X.X.X.X X.X.X.X 5601:30005/TCP 16d NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/crux-api 1/1 1 1 13d NAME DESIRED CURRENT READY AGE replicaset.apps/crux-api-76c848d846 1 1 1 13d # check logs using below command kubectl logs -n crux-qa # check description of pod using below command kubectl describe pod -n crux-qa e.g. kubectl describe pod -n crux-qa pod/crux-api-76c848d846-w2vvn # copy the backend build files inside the pod and untar the files kubectl cp crux-ui-api.tar.gz crux-qa/:/var/crux/ kubectl exec -it -n crux-qa -- /bin/bash cd /var/crux tar xzvf crux-api-qa.tar.gz nohup ./crux &