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

Conversation

thecodemustgrow
Copy link

Hey there 👋 ,

I am using kustomize to deploy typesense as specified in this repo. I wanted to deploy this cool dashboard along my typesense deployment to kubernetes and this is the result.

Right now I have a kustomization file like this

resources:
- github.com/typesense/typesense-kubernetes/base
- github.com/thecodemustgrow/typesense-dashboard/kustomize/base?ref=feature/kustomize

@bfritscher
Copy link
Owner

Hi, thanks for your contribution. I am not sure yet if this should be in the same repository as the code or in a separate one. As it only depends on the image, and might rapidely get deprecated if not maintained. However the pull request is a good example how such a configuration can be done.

@thecodemustgrow
Copy link
Author

Hey, yeah let me know if you would want it in a different way or just close it.

I am not using this repo directly to deploy. I have a separate repo that is referencing this one and https://github.com/typesense/typesense-kubernetes and adding all the patches to create a full deployment of Typesense and the Typesense dashboard.

This is my full kustomization file right now. I am building and deploying my own dashboard image. Just the image and the second secret are related to this repo.

resources:
- github.com/typesense/typesense-kubernetes/base
- github.com/thecodemustgrow/typesense-dashboard/kustomize/base?ref=feature/kustomize
- certificate.yml
- ingress.yml

namespace: typesense

images:
- name: typesense-dashboard
  newName: <my-image>
  newTag: latest

secretGenerator:
- files:
  - secrets/api-key
  name: typesense-api-key
  options:
    disableNameSuffixHash: true
  type: Opaque
- files:
  - secrets/config.json
  name: typesense-dashboard-config
  behavior: replace
  options:
    disableNameSuffixHash: true
  type: Opaque

patches:
- patch: |-
    - op: replace
      path: /spec/template/spec/containers/0/image
      value: typesense/typesense:0.25.0
    - op: replace
      path: /spec/volumeClaimTemplates/0/spec/resources/requests/storage
      value: "10Gi"
    - op: replace
      path: /spec/template/spec/containers/0/command
      value:
      - "/opt/typesense-server"
      - "-d"
      - "/usr/share/typesense/data"
      - "--api-port"
      - "8108"
      - "--peering-port"
      - "8107"
      - "--nodes"
      - "/usr/share/typesense/nodes"
      - "--reset-peers-on-error"
      - "--enable-cors"
    - op: add
      path: /spec/template/spec/containers/0/env
      value:
      - name: TYPESENSE_API_KEY
        valueFrom:
          secretKeyRef:
            name: typesense-api-key
            key: api-key
    - op: replace
      path: /spec/replicas
      value: 1
    - op: replace
      path: /spec/volumeClaimTemplates/0/spec/storageClassName
      value: do-block-storage-retain
  target:
    kind: StatefulSet
    name: typesense
- patch: |-
    - op: replace
      path: /data/nodes
      value: "typesense-0.ts.typesense.svc.cluster.local:8107:8108"
  target:
    kind: ConfigMap
    name: nodeslist
- patch: |-
    - op: replace
      path: /data/nodes
      value: "typesense-0.ts.typesense.svc.cluster.local:8107:8108"
  target:
    kind: ConfigMap
    name: nodeslist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants