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
|
|
|
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_nodeport_port or data.values.service_https_nodeport_port:
|
2020-10-09 23:00:11 +00:00
|
|
|
---
|
|
|
|
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:
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_nodeport_port:
|
|
|
|
- name: http
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_http_nodeport_port
|
2020-10-09 23:00:11 +00:00
|
|
|
targetPort: 80
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_nodeport_nodeport:
|
|
|
|
nodePort: #@ data.values.service_http_nodeport_nodeport
|
2020-10-22 22:37:35 +00:00
|
|
|
#@ end
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ end
|
|
|
|
#@ if data.values.service_https_nodeport_port:
|
|
|
|
- name: https
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_https_nodeport_port
|
|
|
|
targetPort: 443
|
|
|
|
#@ if data.values.service_https_nodeport_nodeport:
|
|
|
|
nodePort: #@ data.values.service_https_nodeport_nodeport
|
|
|
|
#@ end
|
|
|
|
#@ end
|
2020-10-09 23:00:11 +00:00
|
|
|
#@ end
|
|
|
|
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_clusterip_port or data.values.service_https_clusterip_port:
|
2020-10-09 23:00:11 +00:00
|
|
|
---
|
|
|
|
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:
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_clusterip_port:
|
|
|
|
- name: http
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_http_clusterip_port
|
2020-10-09 23:00:11 +00:00
|
|
|
targetPort: 80
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ end
|
|
|
|
#@ if data.values.service_https_clusterip_port:
|
|
|
|
- name: https
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_https_clusterip_port
|
|
|
|
targetPort: 443
|
|
|
|
#@ end
|
2020-10-09 23:00:11 +00:00
|
|
|
#@ end
|
|
|
|
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_loadbalancer_port or data.values.service_https_loadbalancer_port:
|
2020-10-09 23:00:11 +00:00
|
|
|
---
|
|
|
|
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-28 23:45:23 +00:00
|
|
|
#@ if data.values.service_loadbalancer_ip:
|
|
|
|
loadBalancerIP: #@ data.values.service_loadbalancer_ip
|
|
|
|
#@ end
|
2020-10-09 23:00:11 +00:00
|
|
|
ports:
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ if data.values.service_http_loadbalancer_port:
|
|
|
|
- name: http
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_http_loadbalancer_port
|
2020-10-09 23:00:11 +00:00
|
|
|
targetPort: 80
|
2020-10-27 00:03:26 +00:00
|
|
|
#@ end
|
|
|
|
#@ if data.values.service_https_loadbalancer_port:
|
|
|
|
- name: https
|
|
|
|
protocol: TCP
|
|
|
|
port: #@ data.values.service_https_loadbalancer_port
|
|
|
|
targetPort: 443
|
|
|
|
#@ end
|
2020-10-09 23:00:11 +00:00
|
|
|
#@ end
|