Skip to content

Commit

Permalink
fix: address umbrella deployments with connector-side-by-side.
Browse files Browse the repository at this point in the history
  • Loading branch information
drcgjung committed May 10, 2024
1 parent 83c564c commit ff06a36
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 72 deletions.
51 changes: 15 additions & 36 deletions charts/agent-plane-azure-vault/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,34 @@ If release name contains chart name it will be used as a full name.
{{- end }}

{{/*
Create chart name and version as used by the chart label.
Create a default fully qualified app name for the connector.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "txap.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- define "txap.connector.fullname" -}}
{{- if .Values.connector }}
{{- printf "%s-%s" .Release.Name .Values.connector | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Control Common labels
Create chart name and version as used by the chart label.
*/}}
{{- define "txap.labels" -}}
helm.sh/chart: {{ include "txap.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- define "txap.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Control Common labels
*/}}
{{- define "txap.controlplane.labels" -}}
{{- define "txap.labels" -}}
helm.sh/chart: {{ include "txap.chart" . }}
{{ include "txap.controlplane.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: edc-controlplane
app.kubernetes.io/part-of: edc
{{- end }}

{{/*
Expand All @@ -91,14 +90,6 @@ app.kubernetes.io/component: edc-dataplane
app.kubernetes.io/part-of: edc
{{- end }}

{{/*
Control Selector labels
*/}}
{{- define "txap.controlplane.selectorLabels" -}}
app.kubernetes.io/name: {{ include "txap.name" . }}-controlplane
app.kubernetes.io/instance: {{ .Release.Name }}-controlplane
{{- end }}

{{/*
Data Selector labels (Expects the Chart Root to be accessible via .root, the current dataplane via .dataplane)
*/}}
Expand All @@ -107,17 +98,6 @@ app.kubernetes.io/name: {{ include "txap.name" . }}-{{ .Values.name }}
app.kubernetes.io/instance: {{ .Release.Name }}-{{ .Values.name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "txap.controlplane.serviceaccount.name" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "txap.fullname" . ) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
Expand All @@ -144,7 +124,7 @@ Control DSP URL
{{- printf "http://%s" .hostname -}}
{{- end }}{{/* end if tls */}}
{{- else }}{{/* else when ingress not enabled */}}
{{- printf "http://%s-controlplane:%v" ( include "txap.fullname" $ ) .Values.controlplane.endpoints.protocol.port -}}
{{- printf "http://%s-controlplane:%v" ( include "txap.connector.fullname" $ ) .Values.controlplane.endpoints.protocol.port -}}
{{- end }}{{/* end if ingress */}}
{{- end }}{{/* end with ingress */}}
{{- end }}{{/* end if .Values.controlplane.url.protocol */}}
Expand All @@ -154,7 +134,7 @@ Control DSP URL
Validation URL
*/}}
{{- define "txap.controlplane.url.validation" -}}
{{- printf "http://%s-controlplane:%v%s/token" ( include "txap.fullname" $ ) .Values.controlplane.endpoints.control.port .Values.controlplane.endpoints.control.path -}}
{{- printf "http://%s-controlplane:%v%s/token" ( include "txap.connector.fullname" $ ) .Values.controlplane.endpoints.control.port .Values.controlplane.endpoints.control.path -}}
{{- end }}

{{/*
Expand Down Expand Up @@ -196,7 +176,6 @@ Create the name of the service account to use
{{- end }}
{{- end }}


{{/*
join a map
*/}}
Expand Down
3 changes: 3 additions & 0 deletions charts/agent-plane-azure-vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ iatp:
id:
secret_alias:

# -- Name of the connector deployment
connector: ""

# -- References to the control plane deployment
controlplane:
endpoints:
Expand Down
51 changes: 15 additions & 36 deletions charts/agent-plane/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,34 @@ If release name contains chart name it will be used as a full name.
{{- end }}

{{/*
Create chart name and version as used by the chart label.
Create a default fully qualified app name for the connector.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "txap.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- define "txap.connector.fullname" -}}
{{- if .Values.connector }}
{{- printf "%s-%s" .Release.Name .Values.connector | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Control Common labels
Create chart name and version as used by the chart label.
*/}}
{{- define "txap.labels" -}}
helm.sh/chart: {{ include "txap.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- define "txap.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Control Common labels
*/}}
{{- define "txap.controlplane.labels" -}}
{{- define "txap.labels" -}}
helm.sh/chart: {{ include "txap.chart" . }}
{{ include "txap.controlplane.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: edc-controlplane
app.kubernetes.io/part-of: edc
{{- end }}

{{/*
Expand All @@ -91,14 +90,6 @@ app.kubernetes.io/component: edc-dataplane
app.kubernetes.io/part-of: edc
{{- end }}

{{/*
Control Selector labels
*/}}
{{- define "txap.controlplane.selectorLabels" -}}
app.kubernetes.io/name: {{ include "txap.name" . }}-controlplane
app.kubernetes.io/instance: {{ .Release.Name }}-controlplane
{{- end }}

{{/*
Data Selector labels (Expects the Chart Root to be accessible via .root, the current dataplane via .dataplane)
*/}}
Expand All @@ -107,17 +98,6 @@ app.kubernetes.io/name: {{ include "txap.name" . }}-{{ .Values.name }}
app.kubernetes.io/instance: {{ .Release.Name }}-{{ .Values.name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "txap.controlplane.serviceaccount.name" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "txap.fullname" . ) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
Expand All @@ -144,7 +124,7 @@ Control DSP URL
{{- printf "http://%s" .hostname -}}
{{- end }}{{/* end if tls */}}
{{- else }}{{/* else when ingress not enabled */}}
{{- printf "http://%s-controlplane:%v" ( include "txap.fullname" $ ) .Values.controlplane.endpoints.protocol.port -}}
{{- printf "http://%s-controlplane:%v" ( include "txap.connector.fullname" $ ) .Values.controlplane.endpoints.protocol.port -}}
{{- end }}{{/* end if ingress */}}
{{- end }}{{/* end with ingress */}}
{{- end }}{{/* end if .Values.controlplane.url.protocol */}}
Expand All @@ -154,7 +134,7 @@ Control DSP URL
Validation URL
*/}}
{{- define "txap.controlplane.url.validation" -}}
{{- printf "http://%s-controlplane:%v%s/token" ( include "txap.fullname" $ ) .Values.controlplane.endpoints.control.port .Values.controlplane.endpoints.control.path -}}
{{- printf "http://%s-controlplane:%v%s/token" ( include "txap.connector.fullname" $ ) .Values.controlplane.endpoints.control.port .Values.controlplane.endpoints.control.path -}}
{{- end }}

{{/*
Expand Down Expand Up @@ -196,7 +176,6 @@ Create the name of the service account to use
{{- end }}
{{- end }}


{{/*
join a map
*/}}
Expand Down
3 changes: 3 additions & 0 deletions charts/agent-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ iatp:
id:
secret_alias:

# -- Name of the connector deployment
connector: ""

# -- References to the control plane deployment
controlplane:
endpoints:
Expand Down

0 comments on commit ff06a36

Please sign in to comment.