diff --git a/README.md b/README.md index 712f254..4fac384 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ As a web application, only typesense server started with `--enable-cors` will wo Use https://bfritscher.github.io/typesense-dashboard/ or build and install on your own server #### Limitation -When using in your browser from an https adresse your server must also be behind SSL. Or you will get a MixedContent Network Error. (You might allow mix content in your browser, but this is not recommended). +When using in your browser from an https address your server must also be behind SSL. Or you will get a MixedContent Network Error. (You might allow mix content in your browser, but this is not recommended). #### Docker @@ -63,7 +63,38 @@ Sample config.json (same data as saved in localStorage of the browser). "tls":true } } -```` +``` + +#### Kustomize + +To use along [Kustomize deployment for Typesense](https://github.com/typesense/typesense-kubernetes) + +Example usage [here](kustomize/overlays/dev) + +Create `config.json` file with your configuration and API key. + +Create kustomization file. +```yml +resources: +- github.com/typesense/typesense-kubernetes/base +- github.com/bfritscher/typesense-dashboard/kustomize/base + +namespace: typesense + +images: +- name: typesense-dashboard + newName: typesense-dashboard + newTag: latest + +secretGenerator: +- files: + - config.json + name: typesense-dashboard-config + behavior: replace + options: + disableNameSuffixHash: true + type: Opaque +``` ### Desktop diff --git a/kustomize/base/config.json b/kustomize/base/config.json new file mode 100644 index 0000000..e0eb353 --- /dev/null +++ b/kustomize/base/config.json @@ -0,0 +1,10 @@ +{ + "apiKey": "xyz", + "node": { + "host":"somehost", + "port":"443", + "protocol":"https", + "path":"", + "tls":true + } +} \ No newline at end of file diff --git a/kustomize/base/install.yaml b/kustomize/base/install.yaml new file mode 100644 index 0000000..aec6e8b --- /dev/null +++ b/kustomize/base/install.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +kind: Service +metadata: + name: typesense-dashboard-service + namespace: typesense +spec: + selector: + app: typesense-dashboard + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: ClusterIP +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: typesense-dashboard-deployment + namespace: typesense +spec: + replicas: 1 + selector: + matchLabels: + app: typesense-dashboard + template: + metadata: + labels: + app: typesense-dashboard + spec: + containers: + - name: typesense-dashboard-container + image: typesense-dashboard + ports: + - containerPort: 80 + resources: + requests: + memory: "128Mi" + cpu: "50m" + limits: + memory: "128Mi" + cpu: "50m" + volumeMounts: + - name: config-volume + mountPath: /srv/config.json + subPath: config.json + volumes: + - name: config-volume + secret: + secretName: typesense-dashboard-config \ No newline at end of file diff --git a/kustomize/base/kustomization.yaml b/kustomize/base/kustomization.yaml new file mode 100644 index 0000000..6d53b29 --- /dev/null +++ b/kustomize/base/kustomization.yaml @@ -0,0 +1,10 @@ +resources: +- install.yaml + +secretGenerator: +- files: + - config.json + name: typesense-dashboard-config + options: + disableNameSuffixHash: true + type: Opaque \ No newline at end of file diff --git a/kustomize/overlays/dev/config.json b/kustomize/overlays/dev/config.json new file mode 100644 index 0000000..116951a --- /dev/null +++ b/kustomize/overlays/dev/config.json @@ -0,0 +1,10 @@ +{ + "apiKey": "my-api-key", + "node": { + "host":"somehost", + "port":"443", + "protocol":"http", + "path":"", + "tls":false + } +} \ No newline at end of file diff --git a/kustomize/overlays/dev/kustomization.yaml b/kustomize/overlays/dev/kustomization.yaml new file mode 100644 index 0000000..1457d21 --- /dev/null +++ b/kustomize/overlays/dev/kustomization.yaml @@ -0,0 +1,19 @@ +resources: +- ../../base +# - github.com/bfritscher/typesense-dashboard/kustomize/base + +namespace: typesense + +images: +- name: typesense-dashboard + newName: typesense-dashboard + newTag: latest + +secretGenerator: +- files: + - config.json + name: typesense-dashboard-config + behavior: replace + options: + disableNameSuffixHash: true + type: Opaque