Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOSIP-35421] Moved installtion scripts of prereg apitestrig. #791

Merged
merged 7 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions deploy/copy_cm.sh

This file was deleted.

44 changes: 44 additions & 0 deletions deploy/prereg-apitestrig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# APITESTRIG

## Introduction
ApiTestRig will test the working of APIs of the MOSIP modules.

## Install
* Review `values.yaml` and, Make sure to enable required modules for apitestrig operation.
* Install
```sh
./install.sh
```
* During the execution of the `install.sh` script, a prompt appears requesting information regarding the presence of a public domain and a valid SSL certificate on the server.
* If the server lacks a public domain and a valid SSL certificate, it is advisable to select the `n` option. Opting it will enable the `init-container` with an `emptyDir` volume and include it in the deployment process.
* The init-container will proceed to download the server's self-signed SSL certificate and mount it to the specified location within the container's Java keystore (i.e., `cacerts`) file.
* This particular functionality caters to scenarios where the script needs to be employed on a server utilizing self-signed SSL certificates.

## Uninstall
* To uninstall ApiTestRig, run `delete.sh` script.
```sh
./delete.sh
```

## Run apitestrig manually

#### Rancher UI
* Run apitestrig manually via Rancher UI.
![apitestrig-2.png](../../docs/apitestrig-2.png)
* There are two modes of apitestrig `smoke` & `smokeAndRegression`.
* By default, apitestrig will execute with `smokeAndRegression`. <br>
If you want to run apitestrig with only `smoke`. <br>
You have to update the `apitestrig` configmap and rerun the specific apitestrig job.

#### CLI
* Download Kubernetes cluster `kubeconfig` file from `rancher dashboard` to your local.
![apitestrig-1.png](../../docs/apitestrig-1.png)
* Install `kubectl` package to your local machine.
* Run apitestrig manually via CLI by creating a new job from an existing k8s cronjob.
```
kubectl --kubeconfig=<k8s-config-file> -n apitestrig create job --from=cronjob/<cronjob-name> <job-name>
```
example:
```
kubectl --kubeconfig=/home/xxx/Downloads/qa4.config -n apitestrig create job --from=cronjob/cronjob-apitestrig-masterdata cronjob-apitestrig-masterdata
```
4 changes: 2 additions & 2 deletions deploy/prereg-apitestrig/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $# -ge 1 ] ; then
fi

NS=prereg
CHART_VERSION=0.0.1-develop
CHART_VERSION=1.3.0-beta.1-develop
COPY_UTIL=../copy_cm_func.sh

echo Create $NS namespace
Expand Down Expand Up @@ -127,4 +127,4 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
set -o nounset ## set -u : exit the script if you try to use an uninitialised variable
set -o errtrace # trace ERR through 'time command' and other functions
set -o pipefail # trace ERR through pipes
installing_apitestrig # calling function
installing_apitestrig # calling function
7 changes: 7 additions & 0 deletions deploy/prereg-apitestrig/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
modules:
prereg:
enabled: true
image:
repository: mosipqa/apitest-prereg
tag: develop
pullPolicy: Always
2 changes: 1 addition & 1 deletion deploy/README.md → deploy/prereg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ On a browser open `https://<prereg ui domain>/pre-registration-ui/`. Example `h
## Rate Control Using Envoyfilter

- Using Envoyfilter one can limit the rate of http requests coming in to a resource. Reference: [Istio Policty Enforcement](https://istio.io/latest/docs/tasks/policy-enforcement/rate-limit/#local-rate-limit) and [Rate Limit Filter](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter).
- Edit the envoyfilter [here](./rate-control-envoyfilter.yaml)
- Edit the envoyfilter [here](rate-control-envoyfilter.yaml)
- Edit these values in the envoyfilter accordingly.
```
token_bucket:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added docs/apitestrig-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/apitestrig-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading