2020-10-14 22:05:42 +00:00
|
|
|
#! Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
|
|
#! SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-10-09 23:00:11 +00:00
|
|
|
#@ load("@ytt:data", "data")
|
2020-10-14 22:05:42 +00:00
|
|
|
#@ load("helpers.lib.yaml", "defaultLabel", "labels", "namespace", "defaultResourceName", "defaultResourceNameWithSuffix")
|
2020-10-09 23:00:11 +00:00
|
|
|
|
|
|
|
#@ if data.values.service_nodeport_port:
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceNameWithSuffix("nodeport")
|
|
|
|
namespace: #@ namespace()
|
|
|
|
labels: #@ labels()
|
2020-10-09 23:00:11 +00:00
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
selector:
|
|
|
|
app: #@ data.values.app_name
|
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
2020-10-22 22:37:35 +00:00
|
|
|
port: #@ data.values.service_nodeport_port
|
2020-10-09 23:00:11 +00:00
|
|
|
targetPort: 80
|
2020-10-22 22:37:35 +00:00
|
|
|
#@ if data.values.service_nodeport_nodeport:
|
|
|
|
nodePort: #@ data.values.service_nodeport_nodeport
|
|
|
|
#@ end
|
2020-10-09 23:00:11 +00:00
|
|
|
#@ end
|
|
|
|
|
|
|
|
#@ if data.values.service_clusterip_port:
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceNameWithSuffix("clusterip")
|
|
|
|
namespace: #@ namespace()
|
|
|
|
labels: #@ labels()
|
2020-10-09 23:00:11 +00:00
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
2020-10-14 22:05:42 +00:00
|
|
|
selector: #@ defaultLabel()
|
2020-10-09 23:00:11 +00:00
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: #@ data.values.service_clusterip_port
|
|
|
|
targetPort: 80
|
|
|
|
#@ end
|
|
|
|
|
|
|
|
#@ if data.values.service_loadbalancer_port:
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2020-10-14 22:05:42 +00:00
|
|
|
name: #@ defaultResourceNameWithSuffix("loadbalancer")
|
|
|
|
namespace: #@ namespace()
|
|
|
|
labels: #@ labels()
|
2020-10-09 23:00:11 +00:00
|
|
|
spec:
|
|
|
|
type: LoadBalancer
|
2020-10-14 22:05:42 +00:00
|
|
|
selector: #@ defaultLabel()
|
2020-10-09 23:00:11 +00:00
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: #@ data.values.service_loadbalancer_port
|
|
|
|
targetPort: 80
|
|
|
|
#@ end
|