X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=servicemanager%2FREADME.md;h=e5a1b637a57aa73fb71a6d6d4008d43db8544595;hb=5493b0faf67fc5b58b575880db528eb2b663d45a;hp=a43d9deceb0c5a2a44972918110a31f4d2374c04;hpb=ff5fb255f6c98317ffb69f40fc1f77e98bb650a6;p=nonrtric%2Fplt%2Fsme.git diff --git a/servicemanager/README.md b/servicemanager/README.md index a43d9de..e5a1b63 100644 --- a/servicemanager/README.md +++ b/servicemanager/README.md @@ -96,12 +96,27 @@ R1-SME-Manager is then available on the port configured in .env. ## Building the Docker Image -The application can also be built as a Docker image, by using the following command. We build the image without a .env file. This is supplied by volume mounting at container run-time. +The application can also be built as a Docker image, by using the following command. We build the image without a .env file. This is supplied by volume mounting at container run-time. Because we need to include Capifcore in the Docker build context, we build from the git repo's root directory, sme. ```sh -docker image build . -t servicemanager +docker build -t servicemanager -f servicemanager/Dockerfile . ``` +## Kongclearup + +Please note that a special executable has been provided for deleting Kong routes and services that have been created ServiceManager in Kong. This executable is called `kongclearup` and is found in the working directory of the ServiceManger Docker image, at `/app/kongclearup`. When we create a Kong route or service, we add Kong tags with information as follows. + * apfId + * aefId + * apiId + * apiVersion + * resourceName + +When we delete Kong routes and services using `kongclearup`, we check for the existance of these tags, specifically, apfId, apiId and aefId. Only if these tags exist and have values do we proceed to delete the Kong service or route. + +The executable `kongclearup` uses the volume-mounted .env file to load the configuration giving the location of Kong. + +Please refer to `sme/servicemanager/internal/kongclearup.go`. + ## Stand-alone Deployment on Kubernetes For a stand-alone deployment, please see the `deploy` folder for configurations to deploy to R1-SME-Manager to Kubernetes. We need the following steps. @@ -119,7 +134,7 @@ We consolidate the above steps into the script `deploy-to-k8s.sh`. To delete the - src/ - manifests/ -We store the Kubernetes manifests files in the manifests in the subfolder. We store the shell scripts in the src folder. +We store the Kubernetes manifests files in the manifests in the subfolder. We store the shell scripts in the src folder. In `deploy-to-k8s.sh`, we copy .env.example and use sed to replace the template values with values for testing/production. You will need to update this part of the script with your own values. There is an example sed replacement in function `substitute_manifest()` in `deploy-to-k8s.sh`. Here, you can substitute your own Docker images for Capifcore and Service Manager for local development.