OLM Deployment of Operator
The other method to run the APIMatic Operator is through the OLM Deployment. OLM is a component of the Operator Framework, an open source toolkit to manage Kubernetes native applications called Operators in an effective, automated, and scalable way.
To utilize Operator LifeCycle Manager (OLM) to deploy the APIMatic operator, follow the detailed steps given below.
- Clone the APIMatic repository into your working directory using the
git clone https://github.com/apimatic/apimatic-kubernetes-operator.git
Run the following script to install the resources required by OLM to deploy the APIMatic operator in the Kubernetes cluster within the
apimatic-systemnamespace. Information about the different resources required can be found using the steps given in the Operator Framework Docs.
kubectl apply -f olm/manifests.yaml
- This should spin up the
ClusterServiceVersionof the operator in the
apimatic-systemnamespace, following which the operator pod will spin up. To ensure the that the operator installed successfully, check for the
ClusterServiceVersionand the operator deployment in the namespace it was installed in using
kubectl get csv -n apimatic-system
kubectl get deployment -n apimatic-system
- Create a secret named
kubectl create secretcommand to allow pulling the APIMatic CodeGen image using the Docker Hub username registered with APIMatic. If you have not done so, please contact
firstname.lastname@example.org the steps required.
kubectl create secret docker-registry apimaticimagesecret --docker-server=https://index.docker.io/v1/ --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>
- Create a configmap resource named
apimaticlicensethat will serve as the volume storing the APIMatic license. An example of this is given below which will create the ConfigMap using the License.lic file located at /user/local/apimatic/license/.
kubectl create configmap apimaticlicense --from-file /usr/local/apimatic/license/License.lic
- This will deploy a ConfigMap resource with the following definition:
License.lic: \"<License file contents here>\"
- Now run the sample using the
kubectl apply -f config/samples/apicodegen_v1beta1_apimatic.yaml
You will now see a new Deployment with replica count of 3 and Service of type
NodePortcreated, both named
http://localhost:32000from your browser (or using curl from within the Minikube or Kind cluster, if using that) should now show the APIMatic Titan page.
You can now use the exposed APIMatic CodeGen API to generate API SDKs and Docs using curl, Postman or your own custom Web application that consumes the APIMatic CodeGen API service.
Once done, you can remove the APIMatic operator resources using the
kubectl delete -f olm/manifests.yaml