first-commit
This commit is contained in:
54
modules/k8s/controller/application/templates/ingress.yaml
Normal file
54
modules/k8s/controller/application/templates/ingress.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{.ObjectMeta.Name}}-ingress
|
||||
namespace: {{.ObjectMeta.Namespace}}
|
||||
labels:
|
||||
app: {{.ObjectMeta.Name}}
|
||||
devstar-resource-type: devstar-application
|
||||
app.kubernetes.io/name: {{.ObjectMeta.Name}}
|
||||
app.kubernetes.io/managed-by: devstar-operator
|
||||
{{- if .Spec.Ingress.Annotations}}
|
||||
annotations:
|
||||
{{- range $key, $value := .Spec.Ingress.Annotations}}
|
||||
{{$key}}: "{{$value}}"
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
spec:
|
||||
{{- if .Spec.Ingress.IngressClassName}}
|
||||
ingressClassName: {{.Spec.Ingress.IngressClassName}}
|
||||
{{- end}}
|
||||
|
||||
{{- if .Spec.Ingress.TLS}}
|
||||
tls:
|
||||
{{- range .Spec.Ingress.TLS}}
|
||||
- {{- if .Hosts}}
|
||||
hosts:
|
||||
{{- range .Hosts}}
|
||||
- {{.}}
|
||||
{{- end}}
|
||||
{{- else}}
|
||||
hosts:
|
||||
- {{$.Spec.Ingress.Host}}
|
||||
{{- end}}
|
||||
{{- if .SecretName}}
|
||||
secretName: {{.SecretName}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
||||
rules:
|
||||
- host: {{.Spec.Ingress.Host}}
|
||||
http:
|
||||
paths:
|
||||
- path: {{.Spec.Ingress.Path | default "/"}}
|
||||
pathType: {{.Spec.Ingress.PathType | default "Prefix"}}
|
||||
backend:
|
||||
service:
|
||||
name: {{.ObjectMeta.Name}}-svc
|
||||
port:
|
||||
{{- if .Spec.Template.Ports}}
|
||||
number: {{(index .Spec.Template.Ports 0).Port}}
|
||||
{{- else}}
|
||||
number: 80
|
||||
{{- end}}
|
Reference in New Issue
Block a user