persist_pubsub.py 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. from kubernetes.client import V1ObjectMeta, V1Service, V1ServicePort, V1ServiceSpec
  10. from materialize.cloudtest import DEFAULT_K8S_NAMESPACE
  11. from materialize.cloudtest.k8s.api.k8s_service import K8sService
  12. class PersistPubSubService(K8sService):
  13. def __init__(self, namespace: str = DEFAULT_K8S_NAMESPACE) -> None:
  14. super().__init__(namespace)
  15. self.service = V1Service(
  16. api_version="v1",
  17. kind="Service",
  18. metadata=V1ObjectMeta(name="persist-pubsub"),
  19. spec=V1ServiceSpec(
  20. type="ClusterIP",
  21. cluster_ip=None,
  22. ports=[
  23. V1ServicePort(
  24. name="grpc", port=6879, target_port=6879, protocol="TCP"
  25. )
  26. ],
  27. selector={"app": "environmentd"},
  28. ),
  29. )