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.
- Clone the APIMatic repository into your working directory using the
git clone
command.
git clone https://github.com/apimatic/apimatic-kubernetes-operator.git
Run
make deploy
to set up the APIMatic operator resources. This will deploy theapimatic-system
namespace as well as the CRD and the RBAC manifests.Create a secret named
apimaticimagesecret
to allow pulling the APIMatic CodeGen image using the Docker Hub username registered with APIMatic using thekubectl create secret
command. If you have not done so, please contactsupport@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>
- 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
- 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
- Now run the sample using the
kubectl apply
command.
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
NodePort
created, both named apimatic-sample. Accessinghttp://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.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 resources using the
make undeploy
command.
make undeploy
To deploy operator through OLM, go to the Deployment through OLM Docs.