Flightdeck Zookeeper is a minimalist Zookeeper container for Drupal sites on Kubernetes and Docker. You can use it both for local development and production.
Features:
- ConfigMap-friendly YAML configuration
- Supports ensemble mode
There are several tags available for this container, each with different Zookeeper and Drupal module support:
Tags | Zookeeper Version |
---|---|
latest | 3.7 |
x.y.z | 3.7 |
Instead of a large number of environment variables, this container relies on a file to perform all runtime configuration, flightdeck-zookeeper.yml
. Inside the file, create following:
---
flightdeck_zookeeper: {}
All configuration is done as items under the flightdeck_zookeeper
variable. See the following sections for details as to particular configurations.
You can provide this file in one of three ways to the container:
- Mount the configuration file at path
/config/zookeeper/flightdeck-zookeeper.yml
inside the container using a bind mount, configmap, or secret. - Mount the config file anywhere in the container, and set the
FLIGHTDECK_CONFIG_FILE
environment variable to the path of the file. - Encode the contents of
flightdeck-zookeeper.yml
as base64 and assign the result to theFLIGHTDECK_CONFIG
environment variable.
---
flightdeck_zookeeper:
tickTime: "1000"
dataDir: "/data"
clientPort: "2181"
Where:
- tickTime is the basic time unit in milliseconds used by ZooKeeper. Optional, defaults to
1000
. - dataDir is the directory to store Zookeeper files. Optional, defaults to
/data
. - clientPort is the port on which to listen for client connections. Optional, defaults to
2181
.
Often, you will want to run multiple Zookeeper instances as an ensemble, or a redundant cluster of instances. There are several settings needed to configure an ensemble for this container:
---
flightdeck_zookeeper:
initLimit: "120"
syncLimit: "120"
myId: "1"
myIdFromHostname: false
servers:
- hostname: "zookeeper-0"
quorumPort: 2888
leaderPort: 3888
- hostname: "zookeeper-1"
- hostname: "zookeeper-2"
Where:
- initLimit is the amount of time in ticks (see
tickTime
) for a Zookeeper ensemble to reach a quorum. Optional, defaults to120
. - syncLimit is the amount of time in ticks (see
tickTime
) a Zookeeper follower instance can be out of sync from the Zookeeper leader instance. Optional, defaults to120
. - myId is the server ID number greater than 0. Required unless
myIdFromHostname
istrue
. - myIdFromHostname instructs the container to attempt to extract the value of
myid
from the container hostname. Optional, defaults totrue
. - servers is a list of items specifying the Zookeeper
host
, thequorumPort
(default2888
), and theleaderPort
(default3888
).
The myIdFromHostname
setting is particularly useful when deploying this container as a Statefulset in Kubernetes, as hostnames end in -n
where n is a zero indexed replica number. Whatever number extracted from the hostname is incremented by one (0 -> 1) so as to meet Zookeeper myid
requirements.
Zookeeper retains snapshots of the dataDir
. You can control this behavior under the autopurge
key:
---
flightdeck_zookeeper:
autopurge:
state: true
snapRetainCount: 3
purgeInterval: 24
Where:
- state is if snapshot autopurging is enabled. Optional, defaults to
true
. - snapRetainCount is the number of snapshots to retain. Optional, defaults to
3
. - purgeInterval is the time in hours to purge previous snapshots. Optional, defaults to
24
.
Create the flightdeck-zookeeper.yml
file relative to your docker-compose.yml
. Define the Zookeeper
service mounting the file as a volume:
version: '3'
services:
Zookeeper:
image: ten7/flight-deck-Zookeeper
volumes:
- ./flightdeck-zookeeper.yml:/config/Zookeeper/flightdeck-zookeeper.yml
ports:
- "8003:8983"
This container is part of the Flightdeck library of containers for Drupal local development and production workloads on Docker, Swarm, and Kubernetes.
Flightdeck is used and supported by TEN7.
If you need to get verbose output from the entrypoint, set flightdeck_debug
to true
or yes
in the config file.
---
flightdeck_debug: yes
This container uses Ansible to perform start-up tasks. To get even more verbose output from the start up scripts, set the ANSIBLE_VERBOSITY
environment variable to 4
.
If the container will not start due to a failure of the entrypoint, set the FLIGHTDECK_SKIP_ENTRYPOINT
environment variable to true
or 1
, then restart the container.
Flightdeck is licensed under GPLv3. See LICENSE for the complete language.