diff --git a/docker/kubernetes/Dockerfile b/docker/kubernetes/Dockerfile new file mode 100644 index 00000000..1dbbcd31 --- /dev/null +++ b/docker/kubernetes/Dockerfile @@ -0,0 +1,57 @@ +FROM python:3.13-slim AS builder + +ENV PYTHONUNBUFFERED=1 +ENV DEBIAN_FRONTEND=noninteractive + +#====================================================== +# Builder - Create virtualenv for Pulsar +#====================================================== +RUN apt-get update \ + && apt-get install -y --no-install-recommends apt-transport-https \ + # Install packages + && apt-get update \ + && apt-get install -y --no-install-recommends gcc \ + libcurl4-openssl-dev \ + bzip2 virtualenv \ + && mkdir /pulsar + +WORKDIR /pulsar + +COPY pulsar_app-*-py2.py3-none-any.whl . +COPY requirements.txt . + +# Install Pulsar Python requirements +RUN virtualenv .venv \ + && . .venv/bin/activate \ + && pip install wheel pykube-ng \ + && pip install -r requirements.txt Paste \ + && pip install `ls pulsar_app-*-py2.py3-none-any.whl`\[galaxy_extended_metadata,web,amqp\] + +# generate default pulsar config +RUN .venv/bin/pulsar-config --host 0.0.0.0 + +#====================================================== +# Final image - Copy virtualenv for Pulsar +#====================================================== +FROM python:3.13-slim + +ENV PYTHONUNBUFFERED=1 +ENV DEBIAN_FRONTEND=noninteractive +ENV PULSAR_CONFIG_PRIVATE_TOKEN=change_me + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libcurl4-openssl-dev \ + bzip2 virtualenv \ + && adduser --disabled-password --gecos '' pulsar \ + && mkdir /pulsar \ + && chown pulsar:pulsar /pulsar + +WORKDIR /pulsar +COPY --chown=pulsar:pulsar --from=builder /pulsar . + +USER pulsar + +EXPOSE 8913 + +CMD [".venv/bin/pulsar"] diff --git a/docker/kubernetes/Makefile b/docker/kubernetes/Makefile new file mode 100644 index 00000000..df68cf9e --- /dev/null +++ b/docker/kubernetes/Makefile @@ -0,0 +1,9 @@ + + +dist: + cd ../..; make dist; cp dist/pulsar*whl docker/kubernetes; cp requirements.txt docker/kubernetes + +docker-image: + docker build -t 'galaxy/pulsar-kubernetes:0.15.7' . + +all: dist docker-image diff --git a/docs/install.rst b/docs/install.rst index b1336536..cbfd0e5d 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -97,6 +97,32 @@ be called with an explicit URL using the argument ``--url=http://localhost:8913``. Likewise if a private token has been configured it can be supplied using ``--private_token=``. +From a Helm chart +---------------------- + +Pulsar can be deployed to a Kubernetes cluster using the `Pulsar Helm chart +`_. Currently, the only supported +method of authentication to Pulsar when deployed via Helm is using a private +token. The token can be set in the ``values.yaml`` via ``api_key``. + +The Helm chart can be installed using the following commands:: + + $ git clone https://github.com/galaxyproject/pulsar-helm + $ cd pulsar-helm + $ helm install -n pulsar mypulsar . + +Pulsar will be available on port 80. + +Building a container image for Kubernetes +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By default, the chart uses ``galaxy/pulsar-kubernetes`` on Docker Hub as the +container image. To update or customize this image, use the Kubernetes-specific +Dockerfile (``docker/kubernetes/Dockerfile``):: + + $ cd docker/kubernetes + $ make all + From Source ----------------------