0

We are using tika to extract text from a lot of documents, for this we need to give tika service custom config file (xml)

While in docker you can do it just the same as it appears in tika docker image instructions:

docker run -d -p 9998:9998 -v `pwd`/tika-config.xml:/tika-config.xml apache/tika:1.25-full --config /tika-config.xml

I don't know how to achieve the same result with k8s deployment

The deployment I'm using now is this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tika
  labels:
    app: tika
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tika
  template:
    metadata:
      labels:
        app: tika
    spec:
      containers:
        - name: tika
          image: apache/tika:2.4.0

How can I add a custom config to this image?

NNH
  • 265
  • 3
  • 10
  • 1
    I would convert the .xml files using [this tool](https://jsonformatter.org/xml-to-yaml) to a Kubernetes yaml configmap. Then I would follow [this guide](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/). Let me know if it works. – Hector Martinez Rodriguez Jun 23 '22 at 22:26

1 Answers1

1

Kubernetes configmap can be used to load xml file.

Nataraj Medayhal
  • 980
  • 1
  • 2
  • 12