k8s_deployment.py 800 B

1234567891011121314151617181920212223242526
  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 V1Deployment
  10. from materialize.cloudtest.k8s.api.k8s_resource import K8sResource
  11. class K8sDeployment(K8sResource):
  12. deployment: V1Deployment
  13. def kind(self) -> str:
  14. return "deployment"
  15. def create(self) -> None:
  16. apps_v1_api = self.apps_api()
  17. apps_v1_api.create_namespaced_deployment(
  18. body=self.deployment, namespace=self.namespace()
  19. )