Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/gitops-runtime/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ Get ingress url for both tunnel based and ingress based runtimes
{{- else }}
{{ fail (printf "ERROR: Unsupported protocol %s for ingress. Only http and https supported" .Values.global.runtime.ingress.protocol)}}
{{- end }}
{{- else if .Values.global.runtime.httpRoute.enabled }}
{{- if has .Values.global.runtime.httpRoute.protocol $supportedProtocols }}
{{- printf "%s://%s" .Values.global.runtime.httpRoute.protocol (index .Values.global.runtime.httpRoute.hostnames 0)}}
{{- else }}
{{ fail (printf "ERROR: Unsupported protocol %s for httpRoute. Only http and https supported" .Values.global.runtime.httpRoute.protocol)}}
{{- end }}
{{/* If tunnel client is enabled - ingress url is <accoundId>-<runtimename>.<tunnel-subdomain> */}}
{{- else if index .Values "tunnel-client" "enabled" }}
{{- $accoundId := required "global.codefresh.accountId is required for tunnel based runtime" .Values.global.codefresh.accountId }}
Expand Down
46 changes: 46 additions & 0 deletions charts/gitops-runtime/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- if .Values.global.runtime.httpRoute.enabled -}}
{{- $svcName := include "internal-router.fullname" (dict "Values" (get .Values "internal-router")) -}}
{{- $svcPort := index .Values "internal-router" "service" "port" -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: codefresh-gitops-runtime
labels:
{{- include "codefresh-gitops-runtime.labels" . | nindent 4 }}
{{- with .Values.global.runtime.httpRoute.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.global.runtime.httpRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs:
{{- if .Values.global.runtime.httpRoute.parentRefs }}
{{- toYaml .Values.global.runtime.httpRoute.parentRefs | nindent 4 }}
{{- else }}
{{- fail "ERROR: global.runtime.httpRoute.parentRefs is required when httpRoute is enabled" }}
{{- end }}
hostnames:
{{- if .Values.global.runtime.httpRoute.hostnames }}
{{- toYaml .Values.global.runtime.httpRoute.hostnames | nindent 4 }}
{{- else }}
{{- fail "ERROR: global.runtime.httpRoute.hostnames is required when httpRoute is enabled" }}
{{- end }}
rules:
- matches:
- path:
type: PathPrefix
value: /webhooks
- path:
type: PathPrefix
value : /app-proxy
{{- if (index (get $.Values "argo-workflows") "enabled") }}
- path:
type: PathPrefix
value : /workflows
{{- end }}
backendRefs:
- name: {{ $svcName }}
port: {{ $svcPort }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gitops-runtime/templates/tunnel-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ to intruduce the subdomainPrefix to the tunnel.
Since the prefix is comprised of <accoundId>-<runtime name>, we can tempalate it and thus
reduce complexity of installation and number or mandatory values to provide for the installation to work.
*/}}
{{- if and ( not .Values.global.runtime.ingress.enabled) (index .Values "tunnel-client" "enabled") }}
{{- if and ( not .Values.global.runtime.ingress.enabled) ( not .Values.global.runtime.httpRoute.enabled) (index .Values "tunnel-client" "enabled") }}
{{ $tunnelClientContext := (index .Subcharts "tunnel-client")}}
{{ $accoundId := required "codefresh.accountId is required" .Values.global.codefresh.accountId }}
{{ $runtimeName := required "runtime.name is required" .Values.global.runtime.name }}
Expand Down
23 changes: 23 additions & 0 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,29 @@ global:
labels: {}
# -- Hosts for runtime ingress. Note that Codefresh platform will always use the first host in the list to access the runtime.
hosts: []
# -- HTTPRoute settings
httpRoute:
# -- Enable HTTPRoute
enabled: false
# -- The protocol that Codefresh platform will use to access the runtime. Can be http or https.
protocol: https
# -- Required! List of parent Gateway references this HTTPRoute should attach to
# ref: https://gateway-api.sigs.k8s.io/reference/api-spec/main/spec/#parentreference
# E.g.
# parentRefs:
# - name: traefik-gateway
# namespace: traefik
parentRefs: []
# -- List of hostnames to be covered by this HTTPRoute
# ref: https://gateway-api.sigs.k8s.io/reference/api-spec/main/spec/#hostname
# E.g.
# hostnames:
# - runtime.example.com
hostnames: []
# -- Set annotations on the HTTPRoute resource
annotations: {}
# -- Set labels on the HTTPRoute resource
labels: {}
# -- Explicit url for runtime ingress. Provide this value only if you don't want the chart to create and ingress (global.runtime.ingress.enabled=false) and tunnel-client is not used (tunnel-client.enabled=false)
ingressUrl: ""
# -- is the runtime set as a "configuration runtime".
Expand Down