feat: support targetPort option in goctl kube (#2378)

This commit is contained in:
Kevin Wan
2022-09-12 20:42:41 +08:00
committed by GitHub
parent 66c2a28e66
commit 3e96994b7b
4 changed files with 122 additions and 5 deletions

View File

@@ -59,11 +59,12 @@ metadata:
namespace: {{.Namespace}}
spec:
ports:
{{if .UseNodePort}}- nodePort: {{.NodePort}}
port: {{.Port}}
protocol: TCP
targetPort: {{.Port}}
type: NodePort{{else}}- port: {{.Port}}{{end}}
{{if .UseNodePort}}- nodePort: {{.NodePort}}
port: {{.Port}}
protocol: TCP
targetPort: {{.TargetPort}}
type: NodePort{{else}}- port: {{.Port}}
targetPort: {{.TargetPort}}{{end}}
selector:
app: {{.Name}}