This is an example deployment of cloaked-search, along with a demo deployment of Elasticsearch. The configurations can be used as a starting point for a customized, production deployment.
- cs-deploy.yaml: The Deployment of the Cloaked Search Proxy.
- cs-svc.yaml: A Service that clients can use to connect to the Cloaked Search Proxy from within the same Kubernetes cluster. For access from external clients, consider setting up an Ingress.
- es-deploy.yaml: An example Deployment of Elasticsearch. Unlike a production deployment, this has only one replica.
- es-svc.yaml: A Service that will be used by the Cloaked Search Proxy to send requests to Elasticsearch.
- kustomization.yaml: A minimal Kustomize configuration to
control image tags and configuration used by the other files. If you don't want to use Kustomize,
kubectl kustomize . > csp.yaml
from this directory will combine all the YAML configuration into a singlecsp.yaml
file. - ns.yaml: Creates a dedicated Namespace for use by the CSP.
- pvc.yaml: A PersistentVolumeClaim used by Elasticsearch to store its data. There is no PVC for the CSP, because it's stateless.
Examine the config file in config/deploy.yml
and make changes if desired. The standalone keys referenced in this file are defined
in kustomization.yaml
, in the secretGenerator
stanza.
- Use
kubectl apply -k .
in this directory to start everything up.
If you're no longer running the Docker example from the parent directory, you can use the populate_index.sh
script to store data
to this Kubernetes deployment.
kubectl port-forward -n cloaked-search svc/cloaked-search 8675
- In another terminal,
./populate_index.sh
from the root directory of this repository.
After starting this demo instance of elasticsearch, and after storing your first document, you need to tell it not to replicate its indices, since there's only one ES instance.
kubectl port-forward -n cloaked-search svc/elasticsearch 9200
curl -X PUT -H "Content-type: application/json" -d '{ "index": { "number_of_replicas": 0 }}' http://localhost:9200/_settings
If you don't do this, elasticsearch status will change to yellow, which Kubernetes will interpret as "not ready" and take it out of the service load balancer.
Make sure you have a kubectl port-forward
running, as described above, for port 8675. Then you can query the Kubernetes deployment
using the instructions in the repo root.