fcea48c8f9
I tried to follow a principle of encapsulation here - we can still default to peeps making connections to 80/443 on a Service object, but internally we will use 8080/8443. Signed-off-by: Andrew Keesler <akeesler@vmware.com>
94 lines
2.6 KiB
YAML
94 lines
2.6 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_http_nodeport_port or data.values.service_https_nodeport_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("nodeport")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: #@ data.values.app_name
|
|
ports:
|
|
#@ if data.values.service_http_nodeport_port:
|
|
- name: http
|
|
protocol: TCP
|
|
port: #@ data.values.service_http_nodeport_port
|
|
targetPort: 8080
|
|
#@ if data.values.service_http_nodeport_nodeport:
|
|
nodePort: #@ data.values.service_http_nodeport_nodeport
|
|
#@ end
|
|
#@ end
|
|
#@ if data.values.service_https_nodeport_port:
|
|
- name: https
|
|
protocol: TCP
|
|
port: #@ data.values.service_https_nodeport_port
|
|
targetPort: 8443
|
|
#@ if data.values.service_https_nodeport_nodeport:
|
|
nodePort: #@ data.values.service_https_nodeport_nodeport
|
|
#@ end
|
|
#@ end
|
|
#@ end
|
|
|
|
#@ if data.values.service_http_clusterip_port or data.values.service_https_clusterip_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("clusterip")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: ClusterIP
|
|
selector: #@ defaultLabel()
|
|
ports:
|
|
#@ if data.values.service_http_clusterip_port:
|
|
- name: http
|
|
protocol: TCP
|
|
port: #@ data.values.service_http_clusterip_port
|
|
targetPort: 8080
|
|
#@ end
|
|
#@ if data.values.service_https_clusterip_port:
|
|
- name: https
|
|
protocol: TCP
|
|
port: #@ data.values.service_https_clusterip_port
|
|
targetPort: 8443
|
|
#@ end
|
|
#@ end
|
|
|
|
#@ if data.values.service_http_loadbalancer_port or data.values.service_https_loadbalancer_port:
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: #@ defaultResourceNameWithSuffix("loadbalancer")
|
|
namespace: #@ namespace()
|
|
labels: #@ labels()
|
|
spec:
|
|
type: LoadBalancer
|
|
selector: #@ defaultLabel()
|
|
#@ if data.values.service_loadbalancer_ip:
|
|
loadBalancerIP: #@ data.values.service_loadbalancer_ip
|
|
#@ end
|
|
ports:
|
|
#@ if data.values.service_http_loadbalancer_port:
|
|
- name: http
|
|
protocol: TCP
|
|
port: #@ data.values.service_http_loadbalancer_port
|
|
targetPort: 8080
|
|
#@ end
|
|
#@ if data.values.service_https_loadbalancer_port:
|
|
- name: https
|
|
protocol: TCP
|
|
port: #@ data.values.service_https_loadbalancer_port
|
|
targetPort: 8443
|
|
#@ end
|
|
#@ end
|