Make Patroni Kubernetes native (#500)

* Use ConfigMaps or Endpoins for leader elections and to keep cluster state
* Label pods with a postgres role
* change behavior of pip install. From now on it will not install all dependencies, you have to specify explicitly DCS you want to use Patroni with: `pip install patroni[etcd,zookeeper,kubernetes]`
This commit is contained in:
Alexander Kukushkin
2017-12-08 16:55:00 +01:00
committed by GitHub
parent bd847fd2cc
commit 4328c15010
24 changed files with 1000 additions and 100 deletions
+16 -6
View File
@@ -115,13 +115,23 @@ def read(fname):
def setup_package():
# Assemble additional setup commands
cmdclass = {}
cmdclass['test'] = PyTest
cmdclass = {'test': PyTest}
# Some helper variables
version = os.getenv('GO_PIPELINE_LABEL', VERSION)
install_reqs = get_install_requirements('requirements.txt')
install_requires = []
extras_require = {'aws': ['boto'], 'etcd': ['python-etcd'], 'consul': ['python-consul'],
'exhibitor': ['kazoo'], 'zookeeper': ['kazoo'], 'kubernetes': ['kubernetes']}
for r in get_install_requirements('requirements.txt'):
extra = False
for e, v in extras_require.items():
if r.startswith(v[0]):
extras_require[e] = [r]
extra = True
if not extra:
install_requires.append(r)
command_options = {'test': {'test_suite': ('setup.py', 'tests')}}
if JUNIT_XML:
@@ -145,10 +155,10 @@ def setup_package():
test_suite='tests',
packages=find_packages(exclude=['tests', 'tests.*']),
package_data={MAIN_PACKAGE: ["*.json"]},
install_requires=install_reqs,
setup_requires=['flake8'],
install_requires=install_requires,
extras_require=extras_require,
cmdclass=cmdclass,
tests_require=['mock>=2.0.0', 'pytest-cov', 'pytest'],
tests_require=['flake8', 'mock>=2.0.0', 'pytest-cov', 'pytest'],
command_options=command_options,
entry_points={'console_scripts': CONSOLE_SCRIPTS},
)