Skip to main content

Direct Deployment of Operator

There are two ways to deploy and run the APIMatic Operator after installing the prerequisites given in the Operator Overview Docs. One of them is using Direct Deployment. The detailed steps required to run the operator through direct deployment method are given below.

  1. Clone the APIMatic repository into your working directory using the git clone command.
git clone https://github.com/apimatic/apimatic-kubernetes-operator.git
  1. Run make deploy to set up the APIMatic operator resources. This will deploy the apimatic-system namespace as well as the CRD and the RBAC manifests.

  2. Create a secret named apimaticimagesecret to allow pulling the APIMatic CodeGen image using the Docker Hub username registered with APIMatic using the kubectl create secret command. If you have not done so, please contact support@apimatic.io for 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>
  1. Create a configmap resource named apimaticlicense that 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 /usr/local/apimatic/license/.
kubectl create configmap apimaticlicense --from-file /usr/local/apimatic/license/License.lic
  1. This will deploy a ConfigMap resource with the following definition:
apiVersion: v1
data:
License.lic: \"<License file contents here>\"
kind: ConfigMap
metadata:
name: apimaticlicense
namespace: default
  1. Now run the sample using the kubectl apply command.
kubectl apply -f config/samples/apicodegen_v1beta1_apimatic.yaml
  1. You will now see a new Deployment with replica count of 3 and Service of type NodePort created, both named apimatic-sample. Accessing http://localhost:32000 from your browser (or using curl from within the Minikube or Kind cluster, if using that) should now show the APIMatic Titan page.

  2. 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.

  3. Once done, you can remove the APIMatic resources using the make undeploy command.

make undeploy

To deploy operator through OLM, go to the Deployment through OLM Docs.