diff --git a/openstack_operator/templates/memcached/statefulset.yml.j2 b/openstack_operator/templates/memcached/statefulset.yml.j2 index a1f4a15c..5ed70d64 100644 --- a/openstack_operator/templates/memcached/statefulset.yml.j2 +++ b/openstack_operator/templates/memcached/statefulset.yml.j2 @@ -63,11 +63,11 @@ spec: containerPort: 9150 livenessProbe: httpGet: - path: /metrics + path: / port: metrics readinessProbe: httpGet: - path: /metrics + path: / port: metrics resources: limits: diff --git a/openstack_operator/tests/unit/base.py b/openstack_operator/tests/unit/base.py index 6f554e26..4fd55021 100644 --- a/openstack_operator/tests/unit/base.py +++ b/openstack_operator/tests/unit/base.py @@ -63,6 +63,21 @@ class KubernetesAppTestCaseMixin: for container in self.object['spec']['template']['spec']['containers']: self.assertIn('resources', container) + def test_container_http_probes_have_no_metrics_path(self): + """Ensure that http probes (liveness/rediness) of all containers + don't have metrics path""" + for container in self.object['spec']['template']['spec']['containers']: + if 'httpGet' in container['readinessProbe']: + self.assertNotEqual( + container['readinessProbe']['httpGet']['path'], + '/metrics' + ) + if 'httpGet' in container['livenessProbe']: + self.assertNotEqual( + container['livenessProbe']['httpGet']['path'], + '/metrics' + ) + class DeploymentTestCase(KubernetesObjectTestCase, KubernetesAppTestCaseMixin):