rename pooler parts and add example to manifest

This commit is contained in:
Felix Kunde
2020-03-27 13:43:35 +01:00
parent ba9cf68650
commit ecbe3b5e1d
35 changed files with 638 additions and 624 deletions
+13 -13
View File
@@ -350,32 +350,32 @@ class EndToEndTestCase(unittest.TestCase):
k8s.update_config(unpatch_custom_service_annotations)
@timeout_decorator.timeout(TEST_TIMEOUT_SEC)
def test_enable_disable_connection_pool(self):
def test_enable_disable_connection_pooler(self):
'''
For a database without connection pool, then turns it on, scale up,
For a database without connection pooler, then turns it on, scale up,
turn off and on again. Test with different ways of doing this (via
enableConnectionPool or connectionPool configuration section). At the
end turn the connection pool off to not interfere with other tests.
enableConnectionPooler or connectionPooler configuration section). At the
end turn the connection pooler off to not interfere with other tests.
'''
k8s = self.k8s
service_labels = {
'cluster-name': 'acid-minimal-cluster',
}
pod_labels = dict({
'connection-pool': 'acid-minimal-cluster-pooler',
'connection-pooler': 'acid-minimal-cluster-pooler',
})
pod_selector = to_selector(pod_labels)
service_selector = to_selector(service_labels)
try:
# enable connection pool
# enable connection pooler
k8s.api.custom_objects_api.patch_namespaced_custom_object(
'acid.zalan.do', 'v1', 'default',
'postgresqls', 'acid-minimal-cluster',
{
'spec': {
'enableConnectionPool': True,
'enableConnectionPooler': True,
}
})
k8s.wait_for_pod_start(pod_selector)
@@ -384,7 +384,7 @@ class EndToEndTestCase(unittest.TestCase):
'default', label_selector=pod_selector
).items
self.assertTrue(pods, 'No connection pool pods')
self.assertTrue(pods, 'No connection pooler pods')
k8s.wait_for_service(service_selector)
services = k8s.api.core_v1.list_namespaced_service(
@@ -395,15 +395,15 @@ class EndToEndTestCase(unittest.TestCase):
if s.metadata.name.endswith('pooler')
]
self.assertTrue(services, 'No connection pool service')
self.assertTrue(services, 'No connection pooler service')
# scale up connection pool deployment
# scale up connection pooler deployment
k8s.api.custom_objects_api.patch_namespaced_custom_object(
'acid.zalan.do', 'v1', 'default',
'postgresqls', 'acid-minimal-cluster',
{
'spec': {
'connectionPool': {
'connectionPooler': {
'numberOfInstances': 2,
},
}
@@ -417,7 +417,7 @@ class EndToEndTestCase(unittest.TestCase):
'postgresqls', 'acid-minimal-cluster',
{
'spec': {
'enableConnectionPool': False,
'enableConnectionPooler': False,
}
})
k8s.wait_for_pods_to_stop(pod_selector)
@@ -427,7 +427,7 @@ class EndToEndTestCase(unittest.TestCase):
'postgresqls', 'acid-minimal-cluster',
{
'spec': {
'enableConnectionPool': True,
'enableConnectionPooler': True,
}
})
k8s.wait_for_pod_start(pod_selector)