added init container (installation / update)... (#2)
- added memcached container (currently develop branch needed) - put all zammad services in one kubernetes pod to be able to use empty dir volume for tmp - switched to kubernetes deployments - switched to ReadWriteOnce kubernetes volume claims - added init container to elasticsearch & zammad kubernetes deployments - added IMAGE_REPO var for docker compose to .env file - run nginx from zammad container (preparation for stateless updates) - removed docker-compose-build.yml - use private docker repos in compose & kubernetes - change compose volume names
This commit is contained in:
parent
fe319eb46f
commit
ce696bad8b
3
.env
3
.env
@ -1,3 +1,4 @@
|
|||||||
# don't forget to add the minus before the version
|
# don't forget to add the minus before the version
|
||||||
# it should look like: VERSION=-2.1.0-13
|
# example: VERSION=-2.1.0-13
|
||||||
|
IMAGE_REPO=monotek/zammad-docker-compose
|
||||||
VERSION=
|
VERSION=
|
||||||
|
@ -15,7 +15,9 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
|||||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||||
|
|
||||||
# docker init
|
# docker init
|
||||||
|
USER root
|
||||||
COPY containers/zammad-memcached/docker-entrypoint.sh /
|
COPY containers/zammad-memcached/docker-entrypoint.sh /
|
||||||
RUN chmod +x /docker-entrypoint.sh
|
RUN chmod +x /docker-entrypoint.sh
|
||||||
|
USER memcache
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
CMD ["zammad-memcached"]
|
CMD ["zammad-memcached"]
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$1" = 'zammad-memcached' ]; then
|
if [ "$1" = 'zammad-memcached' ]; then
|
||||||
|
echo "starting memcached..."
|
||||||
|
|
||||||
exec memcached -m ${MEMCACHED_SIZE}
|
exec memcached -m ${MEMCACHED_SIZE}
|
||||||
fi
|
fi
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM cpuguy83/nfs-server
|
FROM cpuguy83/nfs-server
|
||||||
MAINTAINER Zanmmad <info@zammad.org>
|
MAINTAINER Zanmmad <info@zammad.org>
|
||||||
|
|
||||||
ENV NFS_DIR /mnt/zammad
|
ENV NFS_DIR /exports
|
||||||
ENV TMPFS_SIZE 1G
|
ENV TMPFS_SIZE 256M
|
||||||
|
|
||||||
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||||
org.label-schema.name="Zammad" \
|
org.label-schema.name="Zammad" \
|
||||||
|
@ -3,14 +3,17 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$1" = 'zammad-nfs' ]; then
|
if [ "$1" = 'zammad-nfs' ]; then
|
||||||
echo "create & mount tmpfs"
|
echo "creating nfs dir"
|
||||||
mkdir -p ${NFS_DIR}
|
|
||||||
chmod 777 ${NFS_DIR}
|
test -d ${NFS_DIR}/data || mkdir -p ${NFS_DIR}/data
|
||||||
mount -t tmpfs -o size=${TMPFS_SIZE} none ${NFS_DIR}
|
test -d ${NFS_DIR}/uploads || mkdir -p ${NFS_DIR}/uploads
|
||||||
|
chmod -R 777 ${NFS_DIR}
|
||||||
|
|
||||||
echo "create nfs exports"
|
echo "create nfs exports"
|
||||||
echo "# NFS Export for Zammad" > /etc/exports
|
echo "# NFS Export for Zammad" > /etc/exports
|
||||||
echo "${NFS_DIR} *(rw,sync,no_subtree_check,fsid=0,no_root_squash)" >> /etc/exports
|
echo "${NFS_DIR} *(rw,sync,no_subtree_check,fsid=0,no_root_squash)" >> /etc/exports
|
||||||
|
echo "${NFS_DIR}/data *(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports
|
||||||
|
echo "${NFS_DIR}/uploads *(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports
|
||||||
|
|
||||||
exec runsvdir /etc/sv
|
exec runsvdir /etc/sv
|
||||||
fi
|
fi
|
||||||
|
@ -4,7 +4,7 @@ ARG BUILD_DATE
|
|||||||
|
|
||||||
ENV BACKUP_SLEEP 86400
|
ENV BACKUP_SLEEP 86400
|
||||||
ENV HOLD_DAYS 10
|
ENV HOLD_DAYS 10
|
||||||
ENV ZAMMAD_DIR /home/zammad
|
ENV ZAMMAD_DIR /opt/zammad
|
||||||
ENV BACKUP_DIR /var/tmp/zammad
|
ENV BACKUP_DIR /var/tmp/zammad
|
||||||
|
|
||||||
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
function check_railsserver_available {
|
function check_railsserver_available {
|
||||||
# wait for zammad process coming up
|
|
||||||
until (echo > /dev/tcp/zammad-railsserver/3000) &> /dev/null; do
|
until (echo > /dev/tcp/zammad-railsserver/3000) &> /dev/null; do
|
||||||
echo "backup waiting for zammads railsserver to be ready..."
|
echo "waiting for railsserver to be ready..."
|
||||||
sleep 2
|
sleep 60
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,14 +2,15 @@ FROM ruby:2.4.1-slim
|
|||||||
MAINTAINER Zammad <info@zammad.org>
|
MAINTAINER Zammad <info@zammad.org>
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
|
|
||||||
ENV ZAMMAD_DIR /home/zammad
|
ENV ZAMMAD_DIR /opt/zammad
|
||||||
ENV ZAMMAD_TMP_DIR /tmp/zammad
|
ENV ZAMMAD_TMP_DIR /tmp/zammad
|
||||||
ENV ZAMMAD_USER zammad
|
ENV ZAMMAD_USER zammad
|
||||||
ENV RAILS_ENV production
|
ENV RAILS_ENV production
|
||||||
ENV RAILS_SERVER puma
|
ENV RAILS_SERVER puma
|
||||||
ENV GIT_URL https://github.com/zammad/zammad.git
|
ENV GIT_URL https://github.com/zammad/zammad.git
|
||||||
ENV GIT_BRANCH stable
|
ENV GIT_BRANCH develop
|
||||||
ENV GOSU_VERSION 1.10
|
ENV GOSU_VERSION 1.10
|
||||||
|
ENV ZAMMAD_READY_FILE tmp/zammad.ready
|
||||||
|
|
||||||
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||||
org.label-schema.name="Zammad" \
|
org.label-schema.name="Zammad" \
|
||||||
@ -23,7 +24,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
|||||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||||
|
|
||||||
# install dependencies, GOSU & zammad
|
# install dependencies, GOSU & zammad
|
||||||
RUN BUILD_DEPENDENCIES="git build-essential libffi-dev libpq5 libpq-dev nfs-common rsync" \
|
RUN BUILD_DEPENDENCIES="git build-essential libffi-dev libpq5 libpq-dev nfs-common nginx rsync" \
|
||||||
GOSU_DEPENDENCIES="ca-certificates wget" \
|
GOSU_DEPENDENCIES="ca-certificates wget" \
|
||||||
set -ex \
|
set -ex \
|
||||||
&& apt-get update && apt-get install -y --force-yes --no-install-recommends ${BUILD_DEPENDENCIES} ${GOSU_DEPENDENCIES} && rm -rf /var/lib/apt/lists/* \
|
&& apt-get update && apt-get install -y --force-yes --no-install-recommends ${BUILD_DEPENDENCIES} ${GOSU_DEPENDENCIES} && rm -rf /var/lib/apt/lists/* \
|
||||||
@ -45,6 +46,7 @@ RUN BUILD_DEPENDENCIES="git build-essential libffi-dev libpq5 libpq-dev nfs-comm
|
|||||||
&& bundle exec rake assets:precompile \
|
&& bundle exec rake assets:precompile \
|
||||||
&& sed -e 's#.*adapter: postgresql# adapter: postgresql#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < config/database.yml.pkgr > config/database.yml \
|
&& sed -e 's#.*adapter: postgresql# adapter: postgresql#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < config/database.yml.pkgr > config/database.yml \
|
||||||
&& rm -r tmp/cache \
|
&& rm -r tmp/cache \
|
||||||
|
&& sed -e 's#server localhost:3000#server zammad-railsserver:3000#g' -e 's#localhost:6042#zammad-websocket:6042#g' -e 's#server_name localhost#server_name _#g' -e 's#.*\(access\|error\)_log.*log;##g' < contrib/nginx/zammad.conf > /etc/nginx/sites-enabled/default \
|
||||||
&& chown -R ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_TMP_DIR}
|
&& chown -R ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_TMP_DIR}
|
||||||
|
|
||||||
# docker init
|
# docker init
|
||||||
|
@ -2,38 +2,40 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function check_railsserver_available {
|
function check_zammad_ready {
|
||||||
# wait for zammad process coming up
|
until [ -f "${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}" ]; do
|
||||||
until (echo > /dev/tcp/zammad-railsserver/3000) &> /dev/null; do
|
echo "waiting for install or update to be ready..."
|
||||||
echo "backup waiting for zammads railsserver to be ready..."
|
sleep 5
|
||||||
sleep 2
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function mount_nfs {
|
function mount_nfs {
|
||||||
if [ -n "$(env|grep KUBERNETES)" ]; then
|
if [ -n "$(env|grep KUBERNETES)" ]; then
|
||||||
mount -t nfs4 zammad-nfs:/ /home/zammad/tmp
|
test -d ${ZAMMAD_DIR} || mkdir -p ${ZAMMAD_DIR}
|
||||||
|
mount -t nfs4 zammad-nfs:/data /opt/zammad
|
||||||
|
chown ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_DIR}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# zammad-railsserver
|
# zammad init
|
||||||
if [ "$1" = 'zammad-railsserver' ]; then
|
if [ "$1" = 'zammad-init' ]; then
|
||||||
|
|
||||||
# wait for postgres process coming up on zammad-postgresql
|
|
||||||
until (echo > /dev/tcp/zammad-postgresql/5432) &> /dev/null; do
|
until (echo > /dev/tcp/zammad-postgresql/5432) &> /dev/null; do
|
||||||
echo "zammad railsserver waiting for postgresql server to be ready..."
|
echo "zammad railsserver waiting for postgresql server to be ready..."
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "railsserver can access postgresql server now..."
|
|
||||||
|
|
||||||
rsync -a --delete --exclude 'storage/fs/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR}
|
|
||||||
cd ${ZAMMAD_DIR}
|
|
||||||
gem update bundler
|
|
||||||
bundle install
|
|
||||||
|
|
||||||
mount_nfs
|
mount_nfs
|
||||||
|
|
||||||
|
# install / update zammad
|
||||||
|
rsync -a --delete --exclude 'storage/fs/*' --exclude 'public/assets/images/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR}
|
||||||
|
rsync -a ${ZAMMAD_TMP_DIR}/public/assets/images/ ${ZAMMAD_DIR}/public/assets/images
|
||||||
|
|
||||||
|
cd ${ZAMMAD_DIR}
|
||||||
|
|
||||||
|
# enable memcached
|
||||||
|
sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, 'zammad-memcached:11211'\n config.session_store = :dalli_store, 'zammad-memcached:11211'/" config/application.rb
|
||||||
|
|
||||||
|
echo "initialising / updating database..."
|
||||||
# db mirgrate
|
# db mirgrate
|
||||||
set +e
|
set +e
|
||||||
bundle exec rake db:migrate &> /dev/null
|
bundle exec rake db:migrate &> /dev/null
|
||||||
@ -41,52 +43,95 @@ if [ "$1" = 'zammad-railsserver' ]; then
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "${DB_CHECK}" != "0" ]; then
|
if [ "${DB_CHECK}" != "0" ]; then
|
||||||
echo "creating db & searchindex..."
|
|
||||||
bundle exec rake db:create
|
bundle exec rake db:create
|
||||||
bundle exec rake db:migrate
|
bundle exec rake db:migrate
|
||||||
bundle exec rake db:seed
|
bundle exec rake db:seed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "changing settings..."
|
||||||
# es config
|
# es config
|
||||||
bundle exec rails r "Setting.set('es_url', 'http://zammad-elasticsearch:9200')"
|
bundle exec rails r "Setting.set('es_url', 'http://zammad-elasticsearch:9200')"
|
||||||
|
|
||||||
|
until (echo > /dev/tcp/zammad-elasticsearch/9200) &> /dev/null; do
|
||||||
|
echo "zammad railsserver waiting for elasticsearch server to be ready..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "rebuilding es searchindex..."
|
||||||
bundle exec rake searchindex:rebuild
|
bundle exec rake searchindex:rebuild
|
||||||
|
|
||||||
|
# chown everything to zammad user
|
||||||
chown -R ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_DIR}
|
chown -R ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_DIR}
|
||||||
|
|
||||||
# run zammad
|
# create install ready file
|
||||||
echo "starting zammad..."
|
su -c "echo 'zammad-init' > ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}" ${ZAMMAD_USER}
|
||||||
echo "zammad will be accessable on http://localhost in some seconds"
|
fi
|
||||||
|
|
||||||
if [ "${RAILS_SERVER}" == "puma" ]; then
|
|
||||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec puma -b tcp://0.0.0.0:3000 -e ${RAILS_ENV}
|
# zammad nginx
|
||||||
elif [ "${RAILS_SERVER}" == "unicorn" ]; then
|
if [ "$1" = 'zammad-nginx' ]; then
|
||||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec unicorn -p 3000 -c config/unicorn.rb -E ${RAILS_ENV}
|
mount_nfs
|
||||||
|
|
||||||
|
if [ -n "$(env|grep KUBERNETES)" ]; then
|
||||||
|
sed -i -e 's#server zammad-\(railsserver\|websocket\):#server zammad:#g' /etc/nginx/sites-enabled/default
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
until [ -f "${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}" ] && [ -n "$(grep zammad-railsserver < ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE})" ] && [ -n "$(grep zammad-scheduler < ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE})" ] && [ -n "$(grep zammad-websocket < ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE})" ] ; do
|
||||||
|
echo "waiting for all zammad services to start..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
rm ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}
|
||||||
|
|
||||||
|
echo "starting nginx..."
|
||||||
|
|
||||||
|
exec /usr/sbin/nginx -g 'daemon off;'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# zammad-railsserver
|
||||||
|
if [ "$1" = 'zammad-railsserver' ]; then
|
||||||
|
mount_nfs
|
||||||
|
|
||||||
|
check_zammad_ready
|
||||||
|
|
||||||
|
cd ${ZAMMAD_DIR}
|
||||||
|
|
||||||
|
echo "starting railsserver..."
|
||||||
|
|
||||||
|
echo "zammad-railsserver" >> ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}
|
||||||
|
|
||||||
|
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec puma -b tcp://0.0.0.0:3000 -e ${RAILS_ENV}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# zammad-scheduler
|
# zammad-scheduler
|
||||||
if [ "$1" = 'zammad-scheduler' ]; then
|
if [ "$1" = 'zammad-scheduler' ]; then
|
||||||
check_railsserver_available
|
|
||||||
|
|
||||||
echo "scheduler can access raillsserver now..."
|
|
||||||
|
|
||||||
mount_nfs
|
mount_nfs
|
||||||
|
|
||||||
# start scheduler
|
check_zammad_ready
|
||||||
|
|
||||||
cd ${ZAMMAD_DIR}
|
cd ${ZAMMAD_DIR}
|
||||||
|
|
||||||
|
echo "starting scheduler..."
|
||||||
|
|
||||||
|
echo "zammad-scheduler" >> ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}
|
||||||
|
|
||||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/scheduler.rb run
|
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/scheduler.rb run
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# zammad-websocket
|
# zammad-websocket
|
||||||
if [ "$1" = 'zammad-websocket' ]; then
|
if [ "$1" = 'zammad-websocket' ]; then
|
||||||
check_railsserver_available
|
|
||||||
|
|
||||||
echo "websocket server can access raillsserver now..."
|
|
||||||
|
|
||||||
mount_nfs
|
mount_nfs
|
||||||
|
|
||||||
|
check_zammad_ready
|
||||||
|
|
||||||
cd ${ZAMMAD_DIR}
|
cd ${ZAMMAD_DIR}
|
||||||
|
|
||||||
|
echo "starting websocket server..."
|
||||||
|
|
||||||
|
echo "zammad-websocket" >> ${ZAMMAD_DIR}/${ZAMMAD_READY_FILE}
|
||||||
|
|
||||||
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/websocket-server.rb -b 0.0.0.0 start
|
exec gosu ${ZAMMAD_USER}:${ZAMMAD_USER} bundle exec script/websocket-server.rb -b 0.0.0.0 start
|
||||||
fi
|
fi
|
||||||
|
@ -1,93 +0,0 @@
|
|||||||
version: '3.3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
zammad-backup:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad-postgresql/Dockerfile
|
|
||||||
depends_on:
|
|
||||||
- zammad-railsserver
|
|
||||||
links:
|
|
||||||
- zammad-postgresql
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- data-zammad:/home/zammad
|
|
||||||
- backup-zammad:/var/tmp/zammad
|
|
||||||
entrypoint: /usr/local/bin/backup.sh
|
|
||||||
command: ["zammad-backup"]
|
|
||||||
|
|
||||||
zammad-elasticsearch:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad-elasticsearch/Dockerfile
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
zammad-nginx:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad-nginx/Dockerfile
|
|
||||||
depends_on:
|
|
||||||
- zammad-railsserver
|
|
||||||
links:
|
|
||||||
- zammad-railsserver
|
|
||||||
- zammad-websocket
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- data-zammad:/home/zammad
|
|
||||||
|
|
||||||
zammad-postgresql:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad-postgresql/Dockerfile
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
zammad-railsserver:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad/Dockerfile
|
|
||||||
depends_on:
|
|
||||||
- zammad-postgresql
|
|
||||||
links:
|
|
||||||
- zammad-elasticsearch
|
|
||||||
- zammad-postgresql
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- data-zammad:/home/zammad
|
|
||||||
command: ["zammad-railsserver"]
|
|
||||||
|
|
||||||
zammad-scheduler:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad/Dockerfile
|
|
||||||
depends_on:
|
|
||||||
- zammad-railsserver
|
|
||||||
links:
|
|
||||||
- zammad-elasticsearch
|
|
||||||
- zammad-postgresql
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- data-zammad:/home/zammad
|
|
||||||
command: ["zammad-scheduler"]
|
|
||||||
|
|
||||||
zammad-websocket:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: containers/zammad/Dockerfile
|
|
||||||
depends_on:
|
|
||||||
- zammad-railsserver
|
|
||||||
links:
|
|
||||||
- zammad-elasticsearch
|
|
||||||
- zammad-postgresql
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- data-zammad:/home/zammad
|
|
||||||
command: ["zammad-websocket"]
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
backup-zammad:
|
|
||||||
driver: local
|
|
||||||
data-zammad:
|
|
||||||
driver: local
|
|
@ -3,32 +3,54 @@ version: '3.3'
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
zammad-backup:
|
zammad-backup:
|
||||||
|
command: ["zammad-backup"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: zammad/zammad-docker-compose:zammad-postgresql${VERSION}
|
entrypoint: /usr/local/bin/backup.sh
|
||||||
|
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
links:
|
links:
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-zammad:/home/zammad
|
- zammad-backup:/var/tmp/zammad
|
||||||
- backup-zammad:/var/tmp/zammad
|
- zammad-data:/opt/zammad
|
||||||
entrypoint: /usr/local/bin/backup.sh
|
|
||||||
command: zammad-backup
|
|
||||||
|
|
||||||
zammad-elasticsearch:
|
zammad-elasticsearch:
|
||||||
image: zammad/zammad-docker-compose:zammad-elasticsearch${VERSION}
|
image: ${IMAGE_REPO}:zammad-elasticsearch${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-elasticsearch:/usr/share/elasticsearch/data
|
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||||
|
|
||||||
|
zammad-init:
|
||||||
|
command: ["zammad-init"]
|
||||||
|
depends_on:
|
||||||
|
- zammad-postgresql
|
||||||
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
|
labels:
|
||||||
|
io.rancher.container.pull_image: always
|
||||||
|
links:
|
||||||
|
- zammad-elasticsearch
|
||||||
|
- zammad-postgresql
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- zammad-data:/opt/zammad
|
||||||
|
|
||||||
|
zammad-memcached:
|
||||||
|
command: ["zammad-memcached"]
|
||||||
|
image: ${IMAGE_REPO}:zammad-memcached${VERSION}
|
||||||
|
labels:
|
||||||
|
io.rancher.container.pull_image: always
|
||||||
|
restart: always
|
||||||
|
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
|
command: ["zammad-nginx"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: zammad/zammad-docker-compose:zammad-nginx${VERSION}
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
links:
|
links:
|
||||||
@ -36,59 +58,65 @@ services:
|
|||||||
- zammad-websocket
|
- zammad-websocket
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-zammad:/home/zammad
|
- zammad-data:/opt/zammad
|
||||||
|
|
||||||
zammad-postgresql:
|
zammad-postgresql:
|
||||||
image: zammad/zammad-docker-compose:zammad-postgresql${VERSION}
|
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
zammad-railsserver:
|
zammad-railsserver:
|
||||||
|
command: ["zammad-railsserver"]
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- zammad-memcached
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
image: zammad/zammad-docker-compose:zammad${VERSION}
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
links:
|
links:
|
||||||
- zammad-elasticsearch
|
- zammad-elasticsearch
|
||||||
|
- zammad-memcached
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-zammad:/home/zammad
|
- zammad-data:/opt/zammad
|
||||||
command: ["zammad-railsserver"]
|
|
||||||
|
|
||||||
zammad-scheduler:
|
zammad-scheduler:
|
||||||
|
command: ["zammad-scheduler"]
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- zammad-memcached
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: zammad/zammad-docker-compose:zammad${VERSION}
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
links:
|
links:
|
||||||
- zammad-elasticsearch
|
- zammad-elasticsearch
|
||||||
|
- zammad-memcached
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-zammad:/home/zammad
|
- zammad-data:/opt/zammad
|
||||||
command: ["zammad-scheduler"]
|
|
||||||
|
|
||||||
zammad-websocket:
|
zammad-websocket:
|
||||||
|
command: ["zammad-websocket"]
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- zammad-memcached
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: zammad/zammad-docker-compose:zammad${VERSION}
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
labels:
|
labels:
|
||||||
io.rancher.container.pull_image: always
|
io.rancher.container.pull_image: always
|
||||||
links:
|
links:
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
|
- zammad-memcached
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- data-zammad:/home/zammad
|
- zammad-data:/opt/zammad
|
||||||
command: ["zammad-websocket"]
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
backup-zammad:
|
elasticsearch-data:
|
||||||
driver: local
|
driver: local
|
||||||
data-zammad:
|
zammad-backup:
|
||||||
driver: local
|
driver: local
|
||||||
data-elasticsearch:
|
zammad-data:
|
||||||
driver: local
|
driver: local
|
||||||
|
@ -2,42 +2,40 @@
|
|||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-postgresql
|
name: zammad
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
annotations:
|
|
||||||
volume.beta.kubernetes.io/storage-class: standard
|
|
||||||
spec:
|
spec:
|
||||||
|
storageClassName: standard
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 10G
|
storage: 10G
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-elasticsearch
|
name: zammad-elasticsearch
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
annotations:
|
|
||||||
volume.beta.kubernetes.io/storage-class: standard
|
|
||||||
spec:
|
spec:
|
||||||
|
storageClassName: standard
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 10G
|
storage: 10G
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-home
|
name: zammad-postgresql
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
annotations:
|
|
||||||
volume.beta.kubernetes.io/storage-class: standard
|
|
||||||
spec:
|
spec:
|
||||||
|
storageClassName: standard
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 10G
|
storage: 10G
|
||||||
|
|
||||||
|
87
kubernetes/40_deployment_zammad.yaml
Normal file
87
kubernetes/40_deployment_zammad.yaml
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: zammad
|
||||||
|
namespace: zammad
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: zammad
|
||||||
|
component: services
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
# volumes:
|
||||||
|
# - name: cache-volume
|
||||||
|
# emptyDir: {}
|
||||||
|
# - name: data
|
||||||
|
# nfs:
|
||||||
|
# # FIXME: use the nfs service IP instead of 'zammad-nfs'
|
||||||
|
# server: zammad-nfs
|
||||||
|
# path: /data
|
||||||
|
# - name: uploads
|
||||||
|
# nfs:
|
||||||
|
# # FIXME: use nfs service IP instead of 'zammad-nfs'
|
||||||
|
# server: zammad-nfs
|
||||||
|
# path: /uploads
|
||||||
|
|
||||||
|
initContainers:
|
||||||
|
- name: zammad-init
|
||||||
|
image: monotek/zammad-docker-compose:zammad
|
||||||
|
args: [ "zammad-init" ]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# volumeMounts:
|
||||||
|
# - name: cache-volume
|
||||||
|
# mountPath: /opt/zammad/tmp
|
||||||
|
# - name: data
|
||||||
|
# mountPath: /opt/zammad/storage
|
||||||
|
# - name: uploads
|
||||||
|
# mountPath: /opt/zammad/assets/uploads
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: zammad-scheduler
|
||||||
|
image: monotek/zammad-docker-compose:zammad
|
||||||
|
args: [ "zammad-scheduler" ]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# volumeMounts:
|
||||||
|
# - name: cache-volume
|
||||||
|
# mountPath: /opt/zammad/tmp
|
||||||
|
# - name: data
|
||||||
|
# mountPath: /opt/zammad/storage
|
||||||
|
|
||||||
|
- name: zammad-railsserver
|
||||||
|
image: monotek/zammad-docker-compose:zammad
|
||||||
|
args: ["zammad-railsserver"]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: railsserver
|
||||||
|
containerPort: 3000
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# volumeMounts:
|
||||||
|
# - name: cache-volume
|
||||||
|
# mountPath: /opt/zammad/tmp
|
||||||
|
# - name: data
|
||||||
|
# mountPath: /opt/zammad/storage
|
||||||
|
# - name: uploads
|
||||||
|
# mountPath: /opt/zammad/assets/uploads
|
||||||
|
|
||||||
|
- name: zammad-websocket
|
||||||
|
image: monotek/zammad-docker-compose:zammad
|
||||||
|
args: [ "zammad-websocket" ]
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: websocket
|
||||||
|
containerPort: 6042
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# volumeMounts:
|
||||||
|
# - name: cache-volume
|
||||||
|
# mountPath: /opt/zammad/tmp
|
||||||
|
# - name: data
|
||||||
|
# mountPath: /opt/zammad/storage
|
33
kubernetes/41_deployment_nginx.yaml
Normal file
33
kubernetes/41_deployment_nginx.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: zammad-nginx
|
||||||
|
namespace: zammad
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
component: webserver
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
# volumes:
|
||||||
|
# - name: uploads
|
||||||
|
# nfs:
|
||||||
|
# # FIXME: use nfs service IP instead of 'zammad-nfs'
|
||||||
|
# server: zammad-nfs
|
||||||
|
# path: /uploads
|
||||||
|
containers:
|
||||||
|
- name: zammad-nginx
|
||||||
|
image: monotek/zammad-docker-compose:zammad
|
||||||
|
args: [ "zammad-nginx" ]
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
name: nginx
|
||||||
|
imagePullPolicy: Always
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# volumeMounts:
|
||||||
|
# - name: uploads
|
||||||
|
# mountPath: /opt/zammad/assets/uploads
|
23
kubernetes/42_deployment_memcached.yaml
Normal file
23
kubernetes/42_deployment_memcached.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: zammad-memcached
|
||||||
|
namespace: zammad
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: memcached
|
||||||
|
component: cache
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: zammad-memcached
|
||||||
|
image: monotek/zammad-docker-compose:zammad-memcached
|
||||||
|
args: [ "zammad-memcached" ]
|
||||||
|
ports:
|
||||||
|
- containerPort: 11211
|
||||||
|
name: memcached
|
||||||
|
imagePullPolicy: Always
|
@ -1,13 +1,9 @@
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: StatefulSet
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-postgresql
|
name: zammad-postgresql
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
|
||||||
component: database
|
|
||||||
app: postgresql
|
|
||||||
spec:
|
spec:
|
||||||
serviceName: zammad-postgresql
|
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
@ -20,13 +16,14 @@ spec:
|
|||||||
- name: zammad-postgresql
|
- name: zammad-postgresql
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: zammad-postgresql
|
claimName: zammad-postgresql
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: zammad-postgresql
|
- name: zammad-postgresql
|
||||||
image: zammad/zammad-docker-compose:zammad-postgresql
|
image: monotek/zammad-docker-compose:zammad-postgresql
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5432
|
- name: postgresql
|
||||||
name: postgresql
|
containerPort: 5432
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /var/lib/postgresql
|
- name: zammad-postgresql
|
||||||
name: zammad-postgresql
|
mountPath: /var/lib/postgresql
|
@ -1,13 +1,9 @@
|
|||||||
apiVersion: apps/v1beta1
|
apiVersion: apps/v1beta1
|
||||||
kind: StatefulSet
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-elasticsearch
|
name: zammad-elasticsearch
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
|
||||||
component: database
|
|
||||||
app: elasticsearch
|
|
||||||
spec:
|
spec:
|
||||||
serviceName: zammad-elasticsearch
|
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
@ -20,19 +16,21 @@ spec:
|
|||||||
- name: zammad-elasticsearch
|
- name: zammad-elasticsearch
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: zammad-elasticsearch
|
claimName: zammad-elasticsearch
|
||||||
|
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: sysctl
|
- name: sysctl
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ["sysctl", "-w", "vm.max_map_count=262144"]
|
command: ["sysctl", "-w", "vm.max_map_count=262144"]
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
|
||||||
containers:
|
containers:
|
||||||
- name: zammad-elasticsearch
|
- name: zammad-elasticsearch
|
||||||
image: zammad/zammad-docker-compose:zammad-elasticsearch
|
image: monotek/zammad-docker-compose:zammad-elasticsearch
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9200
|
- name: elasticsearch
|
||||||
name: elasticsearch
|
containerPort: 9200
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /usr/share/elasticsearch/data
|
- name: zammad-elasticsearch
|
||||||
name: zammad-elasticsearch
|
mountPath: /usr/share/elasticsearch/data
|
33
kubernetes/45_deployment_nfs.yaml
Normal file
33
kubernetes/45_deployment_nfs.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
apiVersion: apps/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: zammad-nfs
|
||||||
|
namespace: zammad
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
component: networkstorage
|
||||||
|
app: nfs
|
||||||
|
spec:
|
||||||
|
terminationGracePeriodSeconds: 10
|
||||||
|
volumes:
|
||||||
|
- name: zammad
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: zammad
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: zammad-nfs
|
||||||
|
image: monotek/zammad-docker-compose:zammad-nfs
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: nfsserver
|
||||||
|
containerPort: 2049
|
||||||
|
- name: rpc
|
||||||
|
containerPort: 111
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: zammad
|
||||||
|
mountPath: /exports
|
@ -1,35 +0,0 @@
|
|||||||
apiVersion: apps/v1beta1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: zammad-railsserver
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: railsserver
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
serviceName: zammad-railsserver
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
component: railsserver
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
volumes:
|
|
||||||
- name: zammad-home
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: zammad-home
|
|
||||||
containers:
|
|
||||||
- name: zammad-railsserver
|
|
||||||
image: zammad/zammad-docker-compose:zammad
|
|
||||||
imagePullPolicy: Always
|
|
||||||
args: ["zammad-railsserver"]
|
|
||||||
ports:
|
|
||||||
- containerPort: 3000
|
|
||||||
name: railsserver
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /home/zammad
|
|
||||||
name: zammad-home
|
|
@ -1,35 +0,0 @@
|
|||||||
apiVersion: apps/v1beta1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: zammad-websocket
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: websocket
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
serviceName: zammad-websocket
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
component: websocket
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
volumes:
|
|
||||||
- name: zammad-home
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: zammad-home
|
|
||||||
containers:
|
|
||||||
- name: zammad-websocket
|
|
||||||
image: zammad/zammad-docker-compose:zammad
|
|
||||||
args: [ "zammad-websocket" ]
|
|
||||||
ports:
|
|
||||||
- containerPort: 6042
|
|
||||||
name: websocket
|
|
||||||
imagePullPolicy: Always
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /home/zammad
|
|
||||||
name: zammad-home
|
|
@ -1,34 +0,0 @@
|
|||||||
apiVersion: apps/v1beta1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: zammad-nginx
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: nginx
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
serviceName: zammad-nginx
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
component: nginx
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
volumes:
|
|
||||||
- name: zammad-home
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: zammad-home
|
|
||||||
containers:
|
|
||||||
- name: zammad-nginx
|
|
||||||
image: zammad/zammad-docker-compose:zammad-nginx
|
|
||||||
ports:
|
|
||||||
- containerPort: 80
|
|
||||||
name: nginx
|
|
||||||
- containerPort: 6042
|
|
||||||
name: nginx-ws
|
|
||||||
imagePullPolicy: Always
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /home/zammad
|
|
||||||
name: zammad-home
|
|
@ -1,32 +0,0 @@
|
|||||||
apiVersion: apps/v1beta1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: zammad-scheduler
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: scheduler
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
serviceName: zammad-scheduler
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
component: scheduler
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
volumes:
|
|
||||||
- name: zammad-home
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: zammad-home
|
|
||||||
containers:
|
|
||||||
- name: zammad-scheduler
|
|
||||||
image: zammad/zammad-docker-compose:zammad
|
|
||||||
args: [ "zammad-scheduler" ]
|
|
||||||
imagePullPolicy: Always
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- mountPath: /home/zammad
|
|
||||||
name: zammad-home
|
|
@ -1,30 +0,0 @@
|
|||||||
apiVersion: apps/v1beta1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: zammad-nfs
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: netfs
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
serviceName: zammad-nfs
|
|
||||||
replicas: 1
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
component: netfs
|
|
||||||
app: nfs
|
|
||||||
spec:
|
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
containers:
|
|
||||||
- name: zammad-nfs
|
|
||||||
image: zammad/zammad-docker-compose:zammad-nfs
|
|
||||||
args: [ "zammad-nfs" ]
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- containerPort: 2049
|
|
||||||
name: nfsserver
|
|
||||||
- containerPort: 111
|
|
||||||
name: rpc
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
@ -2,19 +2,22 @@
|
|||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-postgresql
|
name: zammad
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
labels:
|
||||||
component: database
|
app: zammad
|
||||||
app: postgresql
|
component: services
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: postgresql
|
- name: railsserver
|
||||||
port: 5432
|
port: 3000
|
||||||
|
- name: websocket
|
||||||
|
port: 6042
|
||||||
selector:
|
selector:
|
||||||
component: database
|
app: zammad
|
||||||
app: postgresql
|
component: services
|
||||||
type: NodePort
|
type: NodePort
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@ -22,67 +25,35 @@ metadata:
|
|||||||
name: zammad-elasticsearch
|
name: zammad-elasticsearch
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
labels:
|
||||||
component: searchindex
|
|
||||||
app: elasticsearch
|
app: elasticsearch
|
||||||
|
component: searchindex
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: elasticsearch
|
- name: elasticsearch
|
||||||
port: 9200
|
port: 9200
|
||||||
selector:
|
selector:
|
||||||
component: searchindex
|
|
||||||
app: elasticsearch
|
app: elasticsearch
|
||||||
|
component: searchindex
|
||||||
type: NodePort
|
type: NodePort
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: zammad-railsserver
|
name: zammad-memcached
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
labels:
|
||||||
component: railsserver
|
app: memcached
|
||||||
app: zammad
|
component: cache
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: railsserver
|
- name: memcached
|
||||||
port: 3000
|
port: 11211
|
||||||
selector:
|
selector:
|
||||||
component: railsserver
|
app: memcached
|
||||||
app: zammad
|
component: cache
|
||||||
type: NodePort
|
|
||||||
---
|
|
||||||
kind: Service
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: zammad-websocket
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: websocket
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- name: websocket
|
|
||||||
port: 6042
|
|
||||||
selector:
|
|
||||||
component: websocket
|
|
||||||
app: zammad
|
|
||||||
type: NodePort
|
|
||||||
---
|
|
||||||
kind: Service
|
|
||||||
apiVersion: v1
|
|
||||||
metadata:
|
|
||||||
name: zammad-nginx
|
|
||||||
namespace: zammad
|
|
||||||
labels:
|
|
||||||
component: nginx
|
|
||||||
app: zammad
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- name: nginx
|
|
||||||
port: 80
|
|
||||||
selector:
|
|
||||||
component: nginx
|
|
||||||
app: zammad
|
|
||||||
type: NodePort
|
type: NodePort
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: Service
|
kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@ -90,8 +61,8 @@ metadata:
|
|||||||
name: zammad-nfs
|
name: zammad-nfs
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
labels:
|
||||||
component: netfs
|
|
||||||
app: nfs
|
app: nfs
|
||||||
|
component: networkstorage
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: nfsserver
|
- name: nfsserver
|
||||||
@ -99,6 +70,42 @@ spec:
|
|||||||
- name: rpc
|
- name: rpc
|
||||||
port: 111
|
port: 111
|
||||||
selector:
|
selector:
|
||||||
component: netfs
|
|
||||||
app: nfs
|
app: nfs
|
||||||
|
component: networkstorage
|
||||||
|
type: NodePort
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: zammad-nginx
|
||||||
|
namespace: zammad
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
component: webserver
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: nginx
|
||||||
|
port: 80
|
||||||
|
selector:
|
||||||
|
app: nginx
|
||||||
|
component: webserver
|
||||||
|
type: NodePort
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: zammad-postgresql
|
||||||
|
namespace: zammad
|
||||||
|
labels:
|
||||||
|
app: postgresql
|
||||||
|
component: database
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: postgresql
|
||||||
|
port: 5432
|
||||||
|
selector:
|
||||||
|
app: postgresql
|
||||||
|
component: database
|
||||||
type: NodePort
|
type: NodePort
|
@ -4,7 +4,7 @@ metadata:
|
|||||||
name: zammad.example.com
|
name: zammad.example.com
|
||||||
namespace: zammad
|
namespace: zammad
|
||||||
labels:
|
labels:
|
||||||
component: website
|
component: webserver
|
||||||
app: zammad
|
app: zammad
|
||||||
host: zammad.example.com
|
host: zammad.example.com
|
||||||
annotations:
|
annotations:
|
||||||
@ -23,4 +23,4 @@ spec:
|
|||||||
- path: /
|
- path: /
|
||||||
backend:
|
backend:
|
||||||
serviceName: zammad-nginx
|
serviceName: zammad-nginx
|
||||||
servicePort: 80
|
servicePort: 80
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
# Zammad kubernetes example deployment (beta)
|
# Zammad kubernetes example deployment
|
||||||
|
|
||||||
|
This is a proof of concept of a Kubernetes deployment, which should be considered
|
||||||
|
beta and not ready for production.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Change the ingress to your needs.
|
- Change the ingress to your needs
|
||||||
|
|
||||||
|
|
||||||
## Deploy zammad
|
## Deploy Zammad
|
||||||
|
|
||||||
### Install on Minikube example
|
### Install on Minikube
|
||||||
|
|
||||||
* Install kubectl
|
* Install kubectl
|
||||||
* https://kubernetes.io/docs/tasks/tools/install-kubectl/
|
* https://kubernetes.io/docs/tasks/tools/install-kubectl/
|
||||||
@ -22,3 +25,26 @@
|
|||||||
* open "Overview" and wait until all pods are green
|
* open "Overview" and wait until all pods are green
|
||||||
* access zammad on:
|
* access zammad on:
|
||||||
* http://zammad.example.com
|
* http://zammad.example.com
|
||||||
|
|
||||||
|
|
||||||
|
### Install on Google Kubernetes Engine
|
||||||
|
* connect to cluster via gcloud command
|
||||||
|
* kubectl apply -f .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## If you want to help to improve the Kuberntes deployments here are some todos:
|
||||||
|
* fix the nfs mount from entrypoint, which is currently used because of:
|
||||||
|
* https://github.com/kubernetes/kubernetes/issues/8735
|
||||||
|
* otherwise you have to manually:
|
||||||
|
* kubectl apply -f 00_namespace.yaml -f 80_svc.yaml
|
||||||
|
* kubectl --namespace=zammad describe services zammad-nfs
|
||||||
|
* use the NFS server IP to update
|
||||||
|
* 40_deployment_zammad.yaml
|
||||||
|
* 41_deployment_nginx.yaml
|
||||||
|
* kubectl apply -f 10_pvc.yaml -f 40_deployment_zammad.yaml -f 41_deployment_nginx.yaml -f 42_deployment_memcached.yaml -f 43_deployment_postgesql.yaml -f 44_deployment_elasticsearch.yaml -f 45_deployment_nfs.yaml -f 90_ingress.yaml
|
||||||
|
* create config map for nginx
|
||||||
|
* create a zammad helm chart
|
||||||
|
* document steps to use existing helm charts for elasticsearch, postgresql and so on
|
||||||
|
* add cpu & mem limits
|
||||||
|
* add rolling upgrade strategy to deployments
|
||||||
|
@ -10,6 +10,14 @@ services:
|
|||||||
scale: 1
|
scale: 1
|
||||||
start_on_create: true
|
start_on_create: true
|
||||||
|
|
||||||
|
zammad-init:
|
||||||
|
scale: 1
|
||||||
|
start_on_create: true
|
||||||
|
|
||||||
|
zammad-memcached:
|
||||||
|
scale: 1
|
||||||
|
start_on_create: true
|
||||||
|
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
scale: 1
|
scale: 1
|
||||||
start_on_create: true
|
start_on_create: true
|
||||||
|
Loading…
Reference in New Issue
Block a user