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

feat: add kustomize to use along typesense/typesense-kubernetes #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions kustomize/base/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"apiKey": "xyz",
"node": {
"host":"somehost",
"port":"443",
"protocol":"https",
"path":"",
"tls":true
}
}
50 changes: 50 additions & 0 deletions kustomize/base/install.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resources:
- install.yaml

secretGenerator:
- files:
- config.json
name: typesense-dashboard-config
options:
disableNameSuffixHash: true
type: Opaque
10 changes: 10 additions & 0 deletions kustomize/overlays/dev/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"apiKey": "my-api-key",
"node": {
"host":"somehost",
"port":"443",
"protocol":"http",
"path":"",
"tls":false
}
}
19 changes: 19 additions & 0 deletions kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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