first commit

This commit is contained in:
2026-01-21 17:37:42 +11:00
commit bd1ed71ac4
142 changed files with 18994 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
Thank you for installing the {{ .Chart.Name }} chart for the Amplify Integration Platform.
Your release is named {{ .Release.Name }}.
To learn more about the release, try:
$ helm status {{ .Release.Name }}
$ helm get all {{ .Release.Name }}

View File

@@ -0,0 +1,67 @@
{{- define "predeploy.name" -}}
{{- default "predeploy" .Values.predeploy.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
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 "predeploy.fullname" -}}
{{- if .Values.predeploy.fullnameOverride }}
{{- .Values.predeploy.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default "predeploy" .Values.predeploy.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "predeploy.labels" -}}
{{ include "dataplane.labels" . }}
{{ include "predeploy.selectorLabels" . }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "predeploy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "predeploy.name" . }}
app: {{ include "predeploy.appName" . }}
dplane: "predeploy"
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "predeploy.serviceAccountName" -}}
{{- if .Values.predeploy.serviceAccount.enabled }}
{{- default (include "predeploy.fullname" .) .Values.predeploy.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.predeploy.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Custom templates start here
*/}}
{{- define "predeploy.appName" -}}
{{- $name := default "predeploy" .Values.predeploy.nameOverride -}}
{{- $env := default "predeploy" .Values.global.appEnv -}}
{{- printf "%s-%s" $name $env | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{/*
Image name
*/}}
{{- define "image.finalname" -}}
{{- printf "%s/%s:%s" .Values.predeploy.image.server "predeploy" .Chart.AppVersion }}
{{- end }}

View File

@@ -0,0 +1,13 @@
{{- if .Values.predeploy.calicoNetpol.enabled }}
apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:
name: {{ template "predeploy.appName" . }}
namespace: {{ .Release.Namespace }}
spec:
order: 10
selector: ampint.ddplane == 'cache-copy-job'
types:
- Ingress
- Egress
{{- end }}

View File

@@ -0,0 +1,36 @@
{{- if eq .Values.common.externalConfigMaps false }}
{{- if .Values.common.azfiles.forceCloseHandles.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: predeploy-entrypoint-override.sh
data:
predeploy-entrypoint-override.sh: |
set -e
{{- if .Values.common.azfiles.forceCloseHandles.enabled }}
client_id={{ .Values.common.azfiles.forceCloseHandles.vmssManagedIdentityClientId }}
storage_account={{ .Values.common.azfiles.storageAccountName }}
fileshare={{ .Values.common.azfiles.fileshareName }}
echo "closing remaining handles on component and event cache:"
echo "1/4: get an oauth2 access token based on your managed identity (client_id: ${client_id}), authorizing access to your storage account ${storage_account}"
response=$(curl -s "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&client_id=${client_id}&resource=https%3A%2F%2F${storage_account}.file.core.windows.net" -H Metadata:true)
access_token=$(printf "${response}" | sed 's/^.*"access_token":"\([^"]*\)".*$/\1/g')
echo "2/4: list active file handles in component-cache & event-cache"
curl -s --request GET -H "x-ms-version: 2023-01-03" -H "x-ms-file-request-intent: backup" -H "x-ms-recursive: true" -H "Authorization: Bearer ${access_token}" \
"https://${storage_account}.file.core.windows.net/${fileshare}/component-cache?comp=listhandles"
curl -s --request GET -H "x-ms-version: 2023-01-03" -H "x-ms-file-request-intent: backup" -H "x-ms-recursive: true" -H "Authorization: Bearer ${access_token}" \
"https://${storage_account}.file.core.windows.net/${fileshare}/event-cache?comp=listhandles"
echo "3/4: force close handles in component-cache"
curl -s --request PUT -i -d "" -H "x-ms-version: 2023-01-03" -H "x-ms-file-request-intent: backup" -H "x-ms-recursive: true" -H "x-ms-handle-id: *" -H "Authorization: Bearer ${access_token}" \
"https://${storage_account}.file.core.windows.net/${fileshare}/component-cache?comp=forceclosehandles"
echo "4/4: force close handles in event-cache"
curl -s --request PUT -i -d "" -H "x-ms-version: 2023-01-03" -H "x-ms-file-request-intent: backup" -H "x-ms-recursive: true" -H "x-ms-handle-id: *" -H "Authorization: Bearer ${access_token}" \
"https://${storage_account}.file.core.windows.net/${fileshare}/event-cache?comp=forceclosehandles"
echo "closed handles"
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,13 @@
{{- if ( and .Values.predeploy.serviceAccount.enabled ( not .Values.predeploy.serviceAccount.preexisting ) ) -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "predeploy.serviceAccountName" . }}
labels:
{{- include "predeploy.labels" . | nindent 4 }}
{{- with .Values.predeploy.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.predeploy.serviceAccount.automountServiceAccountToken }}
{{- end }}