397ec61e57
When using kind we forward the node's port to the host, so we only really care about the `nodePort` value. For acceptance clusters, we put an Ingress in front of a NodePort Service, so we only really care about the `port` value.
61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
#! Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
#! SPDX-License-Identifier: Apache-2.0
|
|
|
|
#@ load("@ytt:data", "data")
|
|
#@ load("helpers.lib.yaml", "defaultLabel", "labels", "namespace", "defaultResourceName", "defaultResourceNameWithSuffix")
|
|
|
|
#@ if data.values.service_nodeport_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("nodeport")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: #@ data.values.app_name
|
|
ports:
|
|
- protocol: TCP
|
|
port: #@ data.values.service_nodeport_port
|
|
targetPort: 80
|
|
#@ if data.values.service_nodeport_nodeport:
|
|
nodePort: #@ data.values.service_nodeport_nodeport
|
|
#@ end
|
|
#@ end
|
|
|
|
#@ if data.values.service_clusterip_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("clusterip")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: ClusterIP
|
|
selector: #@ defaultLabel()
|
|
ports:
|
|
- protocol: TCP
|
|
port: #@ data.values.service_clusterip_port
|
|
targetPort: 80
|
|
#@ end
|
|
|
|
#@ if data.values.service_loadbalancer_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("loadbalancer")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: LoadBalancer
|
|
selector: #@ defaultLabel()
|
|
ports:
|
|
- protocol: TCP
|
|
port: #@ data.values.service_loadbalancer_port
|
|
targetPort: 80
|
|
#@ end
|