https://pulumi.com logo
#python
Title
# python
f

future-traffic-93788

07/12/2019, 11:45 PM
i.e.
Copy code
class NginxService(Service):

    def __init__(self, service_app_name):
        app_labels = {
            "app": service_app_name
        }

        metadata = {
                       "labels": deployment.spec["template"]["metadata"]["labels"],
                   },
        spec = {
            "type": "ClusterIP",
            "ports": [{"port": 80, "target_port": 80, "protocol": "TCP"}],
            "selector": app_labels,
        }
        super(NginxService, self).__init__(service_app_name, metadata=metadata, spec=spec)