24 lines
625 B
YAML
24 lines
625 B
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{.ObjectMeta.Name}}-svc
|
|
namespace: {{.ObjectMeta.Namespace}}
|
|
spec:
|
|
selector:
|
|
app: {{.ObjectMeta.Name}}
|
|
devstar-resource-type: devstar-devcontainer
|
|
type: NodePort
|
|
ports:
|
|
- name: ssh-port
|
|
protocol: TCP
|
|
port: 22
|
|
targetPort: {{.Spec.StatefulSet.ContainerPort}}
|
|
{{ if .Spec.Service.NodePort}}
|
|
nodePort: {{.Spec.Service.NodePort}}
|
|
{{ end }}
|
|
{{- range .Spec.Service.ExtraPorts }}
|
|
- name: {{ .Name | default (printf "port-%d" .ServicePort) }}
|
|
protocol: TCP
|
|
port: {{ .ServicePort }}
|
|
targetPort: {{ .ContainerPort }}
|
|
{{- end }} |