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 https://github.com/apimatic/apimatic-kubernetes-operator.git
make deployto set up the APIMatic operator resources. This will deploy the
apimatic-systemnamespace as well as the CRD and the RBAC manifests.
Create a secret named
apimaticimagesecretto allow pulling the APIMatic CodeGen image using the Docker Hub username registered with APIMatic using the
kubectl create secretcommand. 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 /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:
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 apimatic-sample. Accessing
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.
Once done, you can remove the APIMatic resources using the
To deploy operator through OLM, go to the Deployment through OLM Docs.