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 clonecommand.
git clone https://github.com/apimatic/apimatic-kubernetes-operator.git
Run
make deployto set up the APIMatic operator resources. This will deploy theapimatic-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 thekubectl create secretcommand. If you have not done so, please contactsupport@apimatic.iofor 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:
apiVersion: v1
data:
License.lic: \"<License file contents here>\"
kind: ConfigMap
metadata:
name: apimaticlicense
namespace: default
- Now run the sample using the
kubectl applycommand.
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. Accessinghttp://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 resources using the
make undeploycommand.
make undeploy
To deploy operator through OLM, go to the Deployment through OLM Docs.