{"id":29020336,"url":"https://github.com/appbaseio/reactivesearch-api-k8s","last_synced_at":"2026-02-17T10:05:36.707Z","repository":{"id":80402433,"uuid":"224141528","full_name":"appbaseio/reactivesearch-api-k8s","owner":"appbaseio","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-12T10:41:26.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T03:06:41.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appbaseio.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-11-26T08:34:26.000Z","updated_at":"2023-05-12T10:40:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"210295e4-4577-496b-b568-2a6026250aee","html_url":"https://github.com/appbaseio/reactivesearch-api-k8s","commit_stats":null,"previous_names":["appbaseio/reactivesearch-api-k8s"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/appbaseio/reactivesearch-api-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Freactivesearch-api-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Freactivesearch-api-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Freactivesearch-api-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Freactivesearch-api-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appbaseio","download_url":"https://codeload.github.com/appbaseio/reactivesearch-api-k8s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Freactivesearch-api-k8s/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978910,"owners_count":23239417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T01:05:24.961Z","updated_at":"2025-10-07T12:24:44.902Z","avatar_url":"https://github.com/appbaseio.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# K8S setup for Appbase.io + ElasticSearch\n\n[Appbase.io](https://appbase.io) acts as an API gateway for ElasticSearch and augments the search experience by offering:\n\n- Out-of-the-box search and click analytics,\n- Fine-grained security controls but without any restrictions (Apache 2.0 licensed),\n- A superior development experience: Import data via GUI, build and test search relevancy visually with no code, set query rules and advanced query suggestions.\n\nThis example demonstrates how you can deploy ElasticSearch kubernetes operator, i.e. [Elastic Cloud on Kubernetes (ECK)](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-overview.html) with [Appbase.io](https://appbase.io/) on any kubernetes cluster.\n\n## Quick Start\n\n\u003e Note: Steps described here assumes a [kubernetes](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installation on the system. This will allow you to execute `kubectl` commands.\n\n- **Step 1 -** Create kubernetes cluster with your favourite provider. Here are some of the well known Kubernetes Cluster providers.\n\n  - [Google Cloud](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster)\n  - [AWS](https://aws.amazon.com/kubernetes/)\n  - [Azure](https://azure.microsoft.com/en-in/services/kubernetes-service/)\n  - [Digital Ocean](https://www.digitalocean.com/products/kubernetes/)\n\n  _Here is an example on how you can create a cluster on Google Cloud._\n\n  \u003e _Note: We assume that you have `gcloud` sdk installed on your machine, if not you can install from [here](https://cloud.google.com/sdk/install). Also you have a project on [Google Cloud](https://console.cloud.google.com/) with [Kubernetes Engine](https://console.cloud.google.com/apis/library/container.googleapis.com?q=kubernetes%20engine\u0026_ga=2.12989943.-1532196267.1571335381) enabled_\n\n  _1. Login and Initialized Google Cloud_\n\n  ```bash\n  gcloud init\n  ```\n\n  _2. Create Cluster_\n\n  ```bash\n\n  gcloud container clusters create YOUR_CLUSTER_NAME --num-nodes 1 --machine-type  e2-standard-2 --zone us-east1-b --node-locations us-east1-b --cluster-version latest --network default --create-subnetwork range=/19 --enable-ip-alias --no-enable-autoupgrade --project YOUR_PROJECT\n  ```\n\n  _For more configuration options, you can go through `glcoud container cluster create` command [docs](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create). Also in the above command, you can choose a different zone, machine size, number of nodes, etc based on your requirements._\n\n  _Once the cluster is created you will get cluster IP + status in output._\n\n  ![](https://i.imgur.com/yq9gS3Y.png)\n\n  \u003e _Note: For GKE clusters you will need to have cluster admin role added. Following is the command: `kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin`_\n\n- **Step 2 -** Get custom resources for ECK k8s operator\n\n  ```bash\n  kubectl apply -f https://download.elastic.co/downloads/eck/1.1.2/all-in-one.yaml\n  ```\n\n  ![](https://i.imgur.com/yUX4pYx.png)\n\n- **Step 3 -** Deploy ElasticSearch\n\n  Here is a basic Kubernetes configuration which will allow you to quickly deploy a single node ElasticSearch cluster, with 4gb RAM, 2 core CPU, and 5GB storage.\n\n  ```bash\n  cat \u003c\u003cEOF | kubectl apply -f -\n  apiVersion: elasticsearch.k8s.elastic.co/v1\n  kind: Elasticsearch\n  metadata:\n      name: elasticsearch\n  spec:\n    version: 7.9.0\n    http:\n      tls:\n        selfSignedCertificate:\n          disabled: true\n    nodeSets:\n    - name: default\n      count: 1\n      config:\n        node.master: true\n        node.data: true\n        node.ingest: true\n        node.store.allow_mmap: false\n        network.publish_host: localhost\n      volumeClaimTemplates:\n      - metadata:\n          name: elasticsearch-data\n        spec:\n          accessModes:\n          - ReadWriteOnce\n          resources:\n            requests:\n              storage: 5Gi\n          storageClassName: standard\n      podTemplate:\n        spec:\n          containers:\n          - name: elasticsearch\n            env:\n            - name: ES_JAVA_OPTS\n              value: -Xms2g -Xmx2g\n            resources:\n              requests:\n                memory: 2Gi\n                cpu: 0.5\n              limits:\n                memory: 2.5Gi\n                cpu: 2\n  EOF\n  ```\n\n  \u003e Note: For more configuration options you can check [Elastic Cloud on Kubernetes docs](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-overview.html)\n\n- **Step 4 -** Monitor cluster health \u0026 creation process\n\n  ```bash\n  kubectl get elasticsearch\n\n  ```\n\n  ![](https://i.imgur.com/ChTgd2v.png)\n\n  \u003e **Note:** Wait until health shows up as `green`. It can take upto 3-4 min.\n\n- **Step 5 -** Create Appbase.io instance. Appbase.io instance will enable you to access Appbase.io Dashboard. While following instance creation process, you will get an `APPBASE_ID` , which will help you successfully deploy appbase.io on the cluster.\n  Follow the steps listed below to successfully create an appbase.io instance.\n\n  - Go to [Appbase.io Dashboard](https://dash.appbase.io/install)\n\n  ![](https://i.imgur.com/qVSHx0F.png)\n\n  - Enter your email address\n\n  - You will receive an OTP on an entered email address. Enter OTP to verify the email address.\n\n  - You will receive an email with APPBASE_ID which can be used with Appbase.io configuration.\n\n\n- **Step 6 -** Deploy Appbase.io\n\n  ```bash\n  kubectl apply -f https://raw.githubusercontent.com/appbaseio/arc-k8s/master/appbase.yaml\n  ```\n\n  ![](https://i.imgur.com/3K5HsWj.png)\n\n- **Step 7 -** Get Environment Variables. By now all the resources are deployed but Appbase.io service will need the following environment variables to start successfully.\n\n  - `APPBASE_ID`\n  - `ES_CLUSTER_URL`\n  - `USERNAME`\n  - `PASSWORD`\n\n  We have already obtained APPBASE_ID , in step 5. Now we need ElasticSearch cluster URL, i.e. `ES_CLUSTER_URL`. Since we are using Kubernetes orchestration, we can connect to ElasticSearch using its service name and port number. But [ECK](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-quickstart.html) comes with [xpack](http://elastic.co/guide/en/elasticsearch/reference/current/security-settings.html) security which has basic auth enabled. So first let's get the user name password to successfully connect with ElasticSearch. Username here defaults to elastic , so we only need a way to get the password, which is stored in the secrets of Kubernetes.\n\n  Here is the command to get the Password for ElasticSearch\n\n  ```bash\n  kubectl get secret elasticsearch-es-elastic-user -o=jsonpath='{.data.elastic}' | base64 --decode\n  ```\n\n  ![](https://i.imgur.com/YL2NGHT.png)\n\n  Once we have password our `ES_CLUSTER_URL` looks like\n\n  ```bash\n  http://elastic:jwg7k9fc9l89trb7l98jmhf2@elasticsearch-es-http:9200/\n  ```\n\n  Also, default `USERNAME` and `PASSWORD` are set to `admin:admin` you can change them before deploying for production as these credentials will act as master credentials to access Appbase Dashboard.\n\n- **Step 8 -** Configure fluent bit. Update the `ELASTICSEARCH_PASSWORD` password obtained in step 7 and execute the following command\n\n  ```bash\n  cat \u003c\u003cEOF | kubectl apply -f -\n  apiVersion: apps/v1\n  kind: DaemonSet\n  metadata:\n    name: fluent-bit\n    labels:\n      k8s-app: fluent-bit-logging\n      version: v1\n      kubernetes.io/cluster-service: \"true\"\n  spec:\n    selector:\n      matchLabels:\n        k8s-app: fluent-bit-logging\n    template:\n      metadata:\n        labels:\n          k8s-app: fluent-bit-logging\n          version: v1\n          kubernetes.io/cluster-service: \"true\"\n        annotations:\n          prometheus.io/scrape: \"true\"\n          prometheus.io/port: \"2020\"\n          prometheus.io/path: /api/v1/metrics/prometheus\n      spec:\n        containers:\n          - name: fluent-bit\n            image: fluent/fluent-bit:1.9.4\n            imagePullPolicy: Always\n            ports:\n              - containerPort: 2020\n            env:\n              - name: ELASTICSEARCH_HOST\n                value: \"elasticsearch-es-http\"\n              - name: ELASTICSEARCH_PORT\n                value: \"9200\"\n              - name: ELASTICSEARCH_USERNAME\n                value: elastic\n              - name: ELASTICSEARCH_PASSWORD\n                value: ELASTICSEARCH_PASSWORD\n            volumeMounts:\n              - name: varlog\n                mountPath: /var/log\n                subPath: es.json\n              - name: fluent-bit-config\n                mountPath: /fluent-bit/etc/\n        terminationGracePeriodSeconds: 10\n        volumes:\n          - name: varlog\n            hostPath:\n              path: /var/log\n          - name: varlibdockercontainers\n            hostPath:\n              path: /var/lib/docker/containers\n          - name: fluent-bit-config\n            configMap:\n              name: fluent-bit-config\n        serviceAccountName: fluent-bit\n        tolerations:\n          - key: node-role.kubernetes.io/master\n            operator: Exists\n            effect: NoSchedule\n          - operator: \"Exists\"\n            effect: \"NoExecute\"\n          - operator: \"Exists\"\n            effect: \"NoSchedule\"\n  EOF\n  ```\n\n- **Step 9 -** Configure Environment Variables and redeploy appbase. You can update values gathered in the above step in the following command and execute it\n\n  ```bash\n  cat \u003c\u003cEOF | kubectl apply -f -\n  apiVersion: apps/v1\n  kind: Deployment\n  metadata:\n    annotations:\n      deployment.kubernetes.io/revision: \"1\"\n    generation: 1\n    name: appbase\n  spec:\n    selector:\n      matchLabels:\n        app: appbase\n    strategy:\n      type: RollingUpdate\n    template:\n      metadata:\n        creationTimestamp: null\n        labels:\n          app: appbase\n      spec:\n        containers:\n          - env:\n              - name: USERNAME\n                value: admin\n              - name: PASSWORD\n                value: admin\n              - name: APPBASE_ID\n                value: YOUR_APPBASE_ID\n              - name: ES_CLUSTER_URL\n                value: \"http://elastic:PASSWORD@elasticsearch-es-http:9200/\"\n              - name: LOG_FILE_PATH\n                value: \"/var/log/es.json\"\n            image: appbaseio/reactivesearch-api:8.13.0\n            imagePullPolicy: IfNotPresent\n            name: appbase\n            ports:\n              - containerPort: 8000\n                name: http\n                protocol: TCP\n            volumeMounts:\n              - name: varlog\n                mountPath: /var/log\n                subPath: es.json\n        volumes:\n          - name: varlog\n            hostPath:\n              path: /var/log\n          - name: varlibdockercontainers\n            hostPath:\n              path: /var/lib/docker/containers\n    replicas: 1\n  EOF\n  ```\n\n  Now, we have successfully configured appbase. Let's test it. Following command will help you get the Load Balancer IP address using which our service can be accessed.\n\n  ```bash\n  kubectl get services ingress-nginx -n ingress-nginx\n  ```\n\n  ![](https://i.imgur.com/sgI9FZk.png)\n\n  Now that we have external IP, let us execute the following command with correct IP which will help us get the cluster health and see if it is running correctly.\n\n  ```bash\n  curl http://YOUR_EXTERNAL_IP/_cluster/health\\?pretty -u admin:admin\n  ```\n\n  ![](https://i.imgur.com/SltUEFy.png)\n\n  As you can see our ElasticSearch cluster is running with a healthy state, i.e. green , means we have successfully deployed ElasticSearch + Appbase.io services 🎉.\n\n- **Step 10 -** Configure TLS certificate + custom domain. We highly recommend using https enabled hosts so that you can seamlessly use your cluster with Appbase.io dashboard. For this, we have configured the Nginx server with reverse proxy to Appbase.io deployment.\n\n  You can replace domain name in the following command and execute it to make sure you can access services using your domain name instead of IP address\n\n  ```bash\n  apiVersion: extensions/v1beta1\n  kind: Ingress\n  metadata:\n    annotations:\n      kubernetes.io/ingress.class: nginx\n      kubernetes.io/tls-acme: \"false\"\n      nginx.ingress.kubernetes.io/configuration-snippet: |\n        add_header 'access-control-expose-headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Search-Id,X-Search-Click,X-Search-ClickPosition,X-Search-Suggestions-Click,X-Search-Suggestions-ClickPosition,X-Search-Conversion,X-Search-Query,X-Search-Filters,X-Request-Tag,X-Query-Tag,X-Search-State,X-Search-CustomEvent,X-User-Id,X-Search-Client,X-Enable-Telemetry,X-Timestamp,X-Cache,X-Took' always;\n      nginx.ingress.kubernetes.io/cors-allow-credentials: \"false\"\n      nginx.ingress.kubernetes.io/cors-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,X-Search-Id,X-Search-Click,X-Search-ClickPosition,X-Search-Suggestions-Click,X-Search-Suggestions-ClickPosition,X-Search-Conversion,X-Search-Query,X-Search-Filters,X-Request-Tag,X-Query-Tag,X-Search-State,X-Search-CustomEvent,X-User-Id,X-Search-Client,X-Enable-Telemetry,X-Timestamp,X-Cache,X-Took\n      nginx.ingress.kubernetes.io/cors-allow-methods:\n        GET, PUT, POST, DELETE, PATCH,\n        OPTIONS, HEAD\n      nginx.ingress.kubernetes.io/enable-cors: \"true\"\n      nginx.ingress.kubernetes.io/proxy-body-size: 100m\n      nginx.ingress.kubernetes.io/rewrite-target: /\n      nginx.ingress.kubernetes.io/ssl-redirect: \"false\"\n    generation: 2\n    name: appbase-ingress\n    namespace: default\n  spec:\n    rules:\n      - http:\n          paths:\n            - backend:\n                serviceName: appbase\n                servicePort: 8000\n              path: /\n        # host: es.mydomain.com\n    tls:\n      - hosts:\n        - es.mydomain.com\n      - secretName: ssl\n  EOF\n  ```\n\n  \u003e Note: if you do not update the host, then also you will be able to access the appbase URL using Load Balancer IP.\n\n  You can update the [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security) certificate, Key and Root CA values in the following command and execute it so that the correct certificate is attached to your domain. Make sure that the values of certificates and keys are encoded in base64.\n\n  ```bash\n  cat \u003c\u003cEOF | kubectl apply -f -\n  apiVersion: v1\n  kind: Secret\n  metadata:\n      name: ssl\n  type: Opaque\n  data:\n      tls.crt: BASE64 ENDCODED CERTIFICATE CONTENT\n      tls.key: BASE64 ENCODED KEY CONTENT\n      ca.crt: BASE64 ENCODED ROOT CERTIFICATE CONTENT\n  EOF\n  ```\n\n  🚀 Hurray! our deployment is complete.\n\n- **Step 11 -** Access Appbase.io Dashboard. Now that all our configurations are complete, in order to access all the Appbase.io Services, let us sign in to the [appbase.io dashboard](https://dash.appbase.io/login).\n  - Visit \u003chttps://dash.appbase.io\u003e\n  - Enter appbase URL, i.e. Cluster IP obtained in step 8 or domain configured on step 10.\n  - Enter master credentials, i.e. username and password configured on step 7.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Freactivesearch-api-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappbaseio%2Freactivesearch-api-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Freactivesearch-api-k8s/lists"}