Skip to content

Commit

Permalink
feat: allows to override ingress host
Browse files Browse the repository at this point in the history
  • Loading branch information
yelhouti committed May 14, 2024
1 parent bf8311f commit e1dd19a
Show file tree
Hide file tree
Showing 62 changed files with 281 additions and 186 deletions.
13 changes: 7 additions & 6 deletions helm/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/C++/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/C++/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/D/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/D/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/appserver/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/appserver/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/csharp/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/csharp/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/cwp/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/cwp/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/go-mongodb/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/go-mongodb/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
13 changes: 7 additions & 6 deletions packs/go/charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- if and (or .Values.ingress.host .Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
{{- $host := (.Values.ingress.host | default (printf "%s%s%s" .Values.service.name .Values.jxRequirements.ingress.namespaceSubDomain .Values.jxRequirements.ingress.domain)) | quote }}
{{- $annotations := dict }}
{{- $_ := merge $annotations .Values.ingress.annotations .Values.jxRequirements.ingress.annotations }}
{{- if not (hasKey $annotations "kubernetes.io/ingress.class") }}
Expand Down Expand Up @@ -31,19 +32,19 @@ spec:
number: {{ .Values.service.externalPort }}
{{- if eq "NodePort" .Values.jxRequirements.ingress.serviceType }}
path: "/{{ .Release.Namespace }}/hook"
{{- else if .Values.jxRequirements.ingress.domain }}
host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
{{- else if or .Values.ingress.host .Values.jxRequirements.ingress.domain }}
host: {{ $host }}
{{- end }}
{{- if .Values.jxRequirements.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
- {{ $host }}
{{- if and (hasKey .Values.jxRequirements.ingress.tls "secretName") (.Values.jxRequirements.ingress.tls.secretName) }}
secretName: "{{ .Values.jxRequirements.ingress.tls.secretName }}"
{{- else if .Values.jxRequirements.ingress.tls.production }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
{{- else }}
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
secretName: "tls-{{ .Values.ingress.host | default .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions packs/go/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ ingress:
classAnnotation: ""
# Add labels to the ingress
labels: {}
# defaults to .service.name + jxRequirements.ingress.namespaceSubDomain + jxRequirements.ingress.domain
host: ""

# ingress path type
pathType: ImplementationSpecific
Expand Down
Loading

0 comments on commit e1dd19a

Please sign in to comment.