meilisearch / meilisearch-kubernetes

Meilisearch on Kubernetes Helm charts and manifests
https://www.meilisearch.com
MIT License
212 stars 59 forks source link

Add initContainer support #227

Closed zfalen closed 6 months ago

zfalen commented 6 months ago

Pull Request

Related issue

Fixes #226

What does this PR do?

Example

I was able to create an initContainer pattern that pulled a .dump file from S3 and mounted it into the Meili pod using the following values:

initContainers:
  - name: aws-copy
    image: amazon/aws-cli
    envFrom:
      - configMapRef:
          name: env-with-s3-creds
    command:
      - "/bin/sh"
      - "-c"
      - aws s3 cp "s3://$S3_BUCKET/meilisearch_dumps" /meili_data/dumps --recursive
    volumeMounts:
      - name: meili-dumps
        mountPath: /meili_data/dumps
volumes:
  - name: meili-dumps
    emptyDir: {}
volumeMounts:
  - name: meili-dumps
    mountPath: /meili_data/dumps
environment:
  MEILI_IMPORT_DUMP: /meili_data/dumps/myClonedDumpFile.dump
  MEILI_ENV: development
  MEILI_MASTER_KEY: someReallyCoolKeyAlsoWookiesRule
  MEILI_NO_ANALYTICS: true

PR checklist

Please check if your PR fulfills the following requirements:

Thank you so much for contributing to Meilisearch!

zfalen commented 6 months ago

My prettier config messed some formatting up it looks like. We can resolve prior to merge.

brunoocasali commented 6 months ago

@meilisearch sync-manifest

meili-bors[bot] commented 6 months ago

Build succeeded: