Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for adding custom tika configuration #15

Merged
merged 9 commits into from
Apr 8, 2024
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ will work with the version of Tika you are installing.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Requirements](#requirements)
- [Installing](#installing)
- [Install released version using Helm repository](#install-released-version-using-helm-repository)
- [Install development version using master branch](#install-development-version-using-master-branch)
- [Upgrading](#upgrading)
- [Usage notes](#usage-notes)
- [Configuration](#configuration)
- [Deprecated](#deprecated)
- [FAQ](#faq)
- [Contributing](#contributing)
- [tika-helm](#tika-helm)
- [Requirements](#requirements)
- [Installing](#installing)
- [Install released version using Helm repository](#install-released-version-using-helm-repository)
- [Install development version using master branch](#install-development-version-using-master-branch)
- [Custom configuration for tika](#custom-configuration-for-tika)
- [Upgrading](#upgrading)
- [Usage notes](#usage-notes)
- [Configuration](#configuration)
- [Deprecated](#deprecated)
- [FAQ](#faq)
- [Contributing](#contributing)
- [More Information](#more-information)
- [Authors](#authors)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- Use this to update TOC: -->
Expand Down Expand Up @@ -84,6 +89,27 @@ while true; do kubectl --namespace tika-test port-forward $POD_NAME 9998:$CONTAI
* Install it:
- with Helm 3: `helm install tika . --set image.tag=latest-full`

### Custom configuration for tika

To use custom [configuration](https://tika.apache.org/1.9/configuring.html) values for apache tika, use the `tikaConfig` key in the `values.yaml`.
ahilmathew marked this conversation as resolved.
Show resolved Hide resolved
Example:
```
tikaConfig: |
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<parsers>
<!-- Default Parser for most things, except for 2 mime types -->
<parser class="org.apache.tika.parser.DefaultParser">
<mime-exclude>image/jpeg</mime-exclude>
<mime-exclude>application/pdf</mime-exclude>
</parser>
<!-- Use a different parser for PDF -->
ahilmathew marked this conversation as resolved.
Show resolved Hide resolved
<parser class="org.apache.tika.parser.EmptyParser">
<mime>application/pdf</mime>
</parser>
</parsers>
</properties>
```
## Upgrading

Please always check [CHANGELOG.md][] and [BREAKING_CHANGES.md][] before
Expand All @@ -97,15 +123,15 @@ upgrading to a new chart version.

## Configuration

| Parameter | Description | Default |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| `...` | ... | ... |
| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `...` | ... | ... |

### Deprecated

| Parameter | Description | Default |
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `...` | ... | `...` |
| Parameter | Description | Default |
| --------- | ----------- | ------- |
| `...` | ... | `...` |

## FAQ

Expand Down
9 changes: 9 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- if .Values.tikaConfig }}
ahilmathew marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-config
data:
tika-config.xml: |-
{{ .Values.tikaConfig | indent 4 }}
{{- end }}
13 changes: 13 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,28 @@ spec:
volumes:
- name: sec-ctx-vol
emptyDir: {}
{{- if .Values.tikaConfig }}
- name: tika-config
configMap:
name: {{ .Chart.Name }}-config
defaultMode: 0777
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if .Values.tikaConfig }}
args: ["-c" , "/tika-config/tika-config.xml"]
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: sec-ctx-vol
mountPath: /tmp
{{- if .Values.tikaConfig }}
- name: tika-config
mountPath: /tika-config
{{- end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
Loading