add mlflow chart v1.5.0

This commit is contained in:
admin
2024-11-04 01:34:21 +00:00
parent 142b8eaaaf
commit 3b49c41746
170 changed files with 22991 additions and 0 deletions
@@ -0,0 +1,22 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.auth.enabled (not .Values.tracking.auth.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
data:
# We need to ad the username as it is required by the ServiceMonitor object
admin-user: {{ include "common.secrets.passwords.manage" (dict "secret" (include "mlflow.v0.tracking.fullname" .) "key" "admin-user" "providedValues" (list "tracking.auth.username") "context" $) }}
admin-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "mlflow.v0.tracking.fullname" .) "key" "admin-password" "providedValues" (list "tracking.auth.password") "context" $) }}
{{- end }}
@@ -0,0 +1,25 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.auth.enabled (not .Values.tracking.auth.overridesConfigMap) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-auth-overrides" (include "mlflow.v0.tracking.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
# Use render-template to substitute with environment variables
basic_auth_overrides.ini: |
database_uri = {{ print "{{ MLFLOW_DATABASE_AUTH_URI }}" }}
admin_username = {{ print "{{ MLFLOW_TRACKING_USERNAME }}" }}
admin_password = {{ print "{{ MLFLOW_TRACKING_PASSWORD }}" }}
{{- range $key, $value := .Values.tracking.auth.extraOverrides }}
{{ $key }} = {{ include "common.tplvalues.render" (dict "value" $value "context" $) }}
{{- end }}
{{- end }}
@@ -0,0 +1,341 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.tracking.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.tracking.autoscaling.hpa.enabled }}
replicas: {{ .Values.tracking.replicaCount }}
{{- end }}
{{- if .Values.tracking.updateStrategy }}
strategy: {{- toYaml .Values.tracking.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.tracking.podLabels .Values.commonLabels) "context" .) | fromYaml }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
template:
metadata:
{{- if or .Values.tracking.podAnnotations .Values.tracking.auth.enabled }}
annotations:
{{- if .Values.tracking.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.podAnnotations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.auth.enabled }}
checksum/auth: {{ include (print $.Template.BasePath "/tracking/configmap-overrides.yaml") . | sha256sum }}
{{- end }}
{{- end }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
spec:
serviceAccountName: {{ include "mlflow.v0.tracking.serviceAccountName" . }}
{{- include "mlflow.v0.imagePullSecrets" . | nindent 6 }}
automountServiceAccountToken: {{ .Values.tracking.automountServiceAccountToken }}
{{- if .Values.tracking.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.tracking.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.tracking.podAffinityPreset "component" "mlflow" "customLabels" $podLabels "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.tracking.podAntiAffinityPreset "component" "mlflow" "customLabels" $podLabels "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.tracking.nodeAffinityPreset.type "key" .Values.tracking.nodeAffinityPreset.key "values" .Values.tracking.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.tracking.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.tracking.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.tolerations "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.priorityClassName }}
priorityClassName: {{ .Values.tracking.priorityClassName | quote }}
{{- end }}
{{- if .Values.tracking.schedulerName }}
schedulerName: {{ .Values.tracking.schedulerName | quote }}
{{- end }}
{{- if .Values.tracking.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.tracking.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.tracking.terminationGracePeriodSeconds }}
{{- end }}
initContainers:
{{- if .Values.tracking.enableDefaultInitContainers }}
{{- if .Values.tracking.tls.enabled }}
{{- include "mlflow.v0.tracking.copyCertsInitContainer" . | nindent 8 }}
{{- end }}
{{- if and (include "mlflow.v0.database.enabled" .) }}
# Init container for PostgreSQL
{{- include "mlflow.v0.waitForServiceInitContainer" (dict "target" "database" "host" (include "mlflow.v0.database.host" .) "port" (include "mlflow.v0.database.port" .) "context" $) | nindent 8 }}
{{- if .Values.tracking.runUpgradeDB }}
# Perform upgrade of the Database
{{- include "mlflow.v0.tracking.upgradeDBInitContainer" . | nindent 8 }}
{{- end }}
{{- if .Values.tracking.auth.enabled }}
# Render basic auth configuration
{{- include "mlflow.v0.tracking.renderAuthConfInitContainer" . | nindent 8 }}
# Perform upgrade of the Auth Database
{{- include "mlflow.v0.tracking.upgradeDBAuthInitContainer" . | nindent 8 }}
{{- end }}
{{- if (include "mlflow.v0.s3.enabled" .) }}
# Wait for S3 backend to be ready
{{- include "mlflow.v0.waitForServiceInitContainer" (dict "target" "s3" "host" (include "mlflow.v0.s3.host" .) "port" (include "mlflow.v0.s3.port" .) "context" $) | nindent 8 }}
{{- end }}
{{- end }}
{{- if and .Values.volumePermissions.enabled .Values.tracking.persistence.enabled }}
# Adjust volume permissions
{{- include "mlflow.v0.volumePermissionsInitContainer" . | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.tracking.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: mlflow
image: {{ include "mlflow.v0.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.tracking.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.tracking.containerSecurityContext "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.tracking.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.command "context" $) | nindent 12 }}
{{- else }}
command:
- mlflow
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.tracking.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.args "context" $) | nindent 12 }}
{{- else }}
args:
- server
{{- if .Values.tracking.tls.enabled }}
- --gunicorn-opts
- --certfile {{ include "mlflow.v0.tracking.tlsCert" . }} --keyfile {{ include "mlflow.v0.tracking.tlsCertKey" . }} {{- if (include "mlflow.v0.tracking.tlsCACert" .)}} --ca-certs {{ include "mlflow.v0.tracking.tlsCACert" . }}{{- end }}
{{- end }}
{{- if (include "mlflow.v0.database.enabled" .) }}
- --backend-store-uri={{ include "mlflow.v0.database.uri" . }}
{{- else }}
- --backend-store-uri={{ .Values.tracking.persistence.mountPath }}/mlruns
{{- end }}
{{- if (include "mlflow.v0.s3.enabled" .) }}
- --artifacts-destination=s3://{{ include "mlflow.v0.s3.bucket" . }}
{{- else if (include "mlflow.v0.gcs.enabled" .) }}
- --artifacts-destination=gs://{{ .Values.externalGCS.bucket }}
{{- else }}
- --artifacts-destination={{ .Values.tracking.persistence.mountPath }}/mlartifacts
{{- end }}
{{- if and (not (include "mlflow.v0.s3.serveArtifacts" .)) (include "mlflow.v0.s3.enabled" .) }}
- --default-artifact-root=s3://{{ include "mlflow.v0.s3.bucket" . }}
- --no-serve-artifacts
{{- else if and (not .Values.externalGCS.serveArtifacts) (include "mlflow.v0.gcs.enabled" .) }}
- --default-artifact-root=gs://{{ .Values.externalGCS.bucket }}
- --no-serve-artifacts
{{ else }}
- --serve-artifacts
{{- end }}
- --host=0.0.0.0
- --port={{ .Values.tracking.containerPorts.http }}
{{- if .Values.tracking.metrics.enabled }}
- --expose-prometheus={{ .Values.tracking.persistence.mountPath }}/metrics
{{- end }}
{{- if .Values.tracking.auth.enabled }}
- --app-name=basic-auth
{{- end }}
{{- if .Values.tracking.extraArgs }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.extraArgs "context" $) | nindent 12 }}
{{- end }}
{{- end }}
env:
- name: BITNAMI_DEBUG
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
{{- if (include "mlflow.v0.database.enabled" .) }}
- name: MLFLOW_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "mlflow.v0.database.secretName" . }}
key: {{ include "mlflow.v0.database.passwordKey" . | quote }}
{{- end }}
{{- if (include "mlflow.v0.s3.enabled" .) }}
{{- if .Values.externalS3.useCredentialsInSecret }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ include "mlflow.v0.s3.secretName" . }}
key: {{ include "mlflow.v0.s3.accessKeyIDKey" . | quote }}
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "mlflow.v0.s3.secretName" . }}
key: {{ include "mlflow.v0.s3.secretAccessKeyKey" . | quote }}
{{- end }}
{{- end }}
{{- if (include "mlflow.v0.s3.enabled" .) }}
- name: MLFLOW_S3_ENDPOINT_URL
value: {{ printf "%s://%s:%v" (include "mlflow.v0.s3.protocol" .) (include "mlflow.v0.s3.host" .) (include "mlflow.v0.s3.port" .) | quote }}
{{- end }}
{{- if (include "mlflow.v0.gcs.enabled" .) }}
{{- if .Values.externalGCS.useCredentialsInSecret }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /bitnami/gcs/key.json
{{- end }}
{{- if .Values.externalGCS.googleCloudProject }}
- name: GOOGLE_CLOUD_PROJECT
value: {{ .Values.externalGCS.googleCloudProject }}
{{- end }}
{{- end }}
{{- if .Values.tracking.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.tracking.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.tracking.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.tracking.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.tracking.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- if .Values.tracking.resources }}
resources: {{- toYaml .Values.tracking.resources | nindent 12 }}
{{- else if ne .Values.tracking.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.tracking.resourcesPreset) | nindent 12 }}
{{- end }}
ports:
- name: {{ include "mlflow.v0.tracking.portName" . }}
containerPort: {{ .Values.tracking.containerPorts.http }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.tracking.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.tracking.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.tracking.livenessProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- pgrep
- -f
- mlflow.server
{{- end }}
{{- if .Values.tracking.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.tracking.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.tracking.readinessProbe "enabled") "context" $) | nindent 12 }}
{{- if .Values.tracking.auth.enabled }}
tcpSocket:
port: {{ include "mlflow.v0.tracking.portName" . }}
{{- else }}
httpGet:
path: /
port: {{ include "mlflow.v0.tracking.portName" . }}
{{- end }}
{{- end }}
{{- if .Values.tracking.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.tracking.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.tracking.startupProbe "enabled") "context" $) | nindent 12 }}
{{- if .Values.tracking.auth.enabled }}
tcpSocket:
port: {{ include "mlflow.v0.tracking.portName" . }}
{{- else }}
httpGet:
path: /
port: {{ include "mlflow.v0.tracking.portName" . }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.tracking.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
- name: tmp
mountPath: /tmp
- name: mlruns
mountPath: /app/mlruns
- name: mlartifacts
mountPath: /app/mlartifacts
{{- if .Values.tracking.tls.enabled }}
- name: mlflow-certificates
mountPath: /bitnami/mlflow/certs
readOnly: true
{{- end }}
{{- if .Values.tracking.auth.enabled }}
- name: rendered-basic-auth
mountPath: /bitnami/mlflow-basic-auth/basic_auth.ini
subPath: basic_auth.ini
{{- end }}
- name: data
mountPath: {{ .Values.tracking.persistence.mountPath }}
{{- if .Values.tracking.persistence.subPath }}
subPath: {{ .Values.tracking.persistence.subPath }}
{{- end }}
{{- if and (include "mlflow.v0.gcs.enabled" .) .Values.externalGCS.useCredentialsInSecret }}
- name: gcs-key
mountPath: /bitnami/gcs/key.json
subPath: key.json
{{- end }}
{{- if .Values.tracking.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.tracking.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.tracking.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
- name: mlruns
emptyDir: {}
- name: mlartifacts
emptyDir: {}
{{- if .Values.tracking.tls.enabled }}
- name: raw-certificates
secret:
secretName: {{ include "mlflow.v0.tracking.tlsSecretName" . }}
- name: mlflow-certificates
emptyDir: {}
{{- end }}
{{- if .Values.tracking.auth.enabled }}
- name: basic-auth-overrides
configMap:
name: {{ include "mlflow.v0.tracking.auth.overridesConfigMapName" . }}
- name: rendered-basic-auth
emptyDir: {}
{{- end }}
- name: data
{{- if .Values.tracking.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.tracking.persistence.existingClaim | default (include "mlflow.v0.tracking.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.tracking.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if and (include "mlflow.v0.gcs.enabled" .) .Values.externalGCS.useCredentialsInSecret }}
- name: gcs-key
secret:
secretName: {{ .Values.externalGCS.existingSecret }}
items:
- key: {{ .Values.externalGCS.existingSecretKey }}
path: key.json
{{- end }}
{{- end }}
@@ -0,0 +1,21 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled (not .Values.postgresql.enabled) (not .Values.externalDatabase.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mlflow.v0.database.secretName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque
data:
db-password: {{ .Values.externalDatabase.password | b64enc | quote }}
{{- end }}
@@ -0,0 +1,27 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and
.Values.tracking.enabled
.Values.externalS3.useCredentialsInSecret
(not .Values.minio.enabled)
(not .Values.externalS3.existingSecret)
}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mlflow.v0.s3.secretName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
type: Opaque
data:
{{ .Values.externalS3.existingSecretAccessKeyIDKey }}: {{ .Values.externalS3.accessKeyID | b64enc | quote }}
{{ .Values.externalS3.existingSecretKeySecretKey }}: {{ .Values.externalS3.accessKeySecret | b64enc | quote }}
{{- end }}
+50
View File
@@ -0,0 +1,50 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.autoscaling.hpa.enabled }}
apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
name: {{ include "mlflow.v0.tracking.fullname" . }}
minReplicas: {{ .Values.tracking.autoscaling.hpa.minReplicas }}
maxReplicas: {{ .Values.tracking.autoscaling.hpa.maxReplicas }}
metrics:
{{- if .Values.tracking.autoscaling.hpa.targetMemory }}
- type: Resource
resource:
name: memory
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.tracking.autoscaling.hpa.targetMemory }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.tracking.autoscaling.hpa.targetMemory }}
{{- end }}
{{- end }}
{{- if .Values.tracking.autoscaling.hpa.targetCPU }}
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.tracking.autoscaling.hpa.targetCPU }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.tracking.autoscaling.hpa.targetCPU }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,48 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.tracking.ingress.enabled }}
{{- if .Values.tracking.ingress.secrets }}
{{- range .Values.tracking.ingress.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ .certificate | b64enc }}
tls.key: {{ .key | b64enc }}
---
{{- end }}
{{- end }}
{{- if and .Values.tracking.ingress.tls .Values.tracking.ingress.selfSigned }}
{{- $secretName := printf "%s-tls" .Values.tracking.ingress.hostname }}
{{- $ca := genCA "mlflow-ca" 365 }}
{{- $cert := genSignedCert .Values.tracking.ingress.hostname nil (list .Values.tracking.ingress.hostname) 365 $ca }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }}
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }}
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }}
{{- end }}
{{- end }}
@@ -0,0 +1,61 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.ingress.enabled }}
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ template "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if or .Values.tracking.ingress.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" ( list .Values.tracking.ingress.annotations .Values.commonAnnotations ) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.tracking.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
ingressClassName: {{ .Values.tracking.ingress.ingressClassName | quote }}
{{- end }}
rules:
{{- if .Values.tracking.ingress.hostname }}
- host: {{ .Values.tracking.ingress.hostname }}
http:
paths:
{{- if .Values.tracking.ingress.extraPaths }}
{{- toYaml .Values.tracking.ingress.extraPaths | nindent 10 }}
{{- end }}
- path: {{ .Values.tracking.ingress.path }}
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.tracking.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "mlflow.v0.tracking.fullname" .) "servicePort" (include "mlflow.v0.tracking.protocol" $) "context" $) | nindent 14 }}
{{- end }}
{{- range .Values.tracking.ingress.extraHosts }}
- host: {{ .name | quote }}
http:
paths:
- path: {{ default "/" .path }}
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "mlflow.v0.tracking.fullname" $) "servicePort" (include "mlflow.v0.tracking.protocol" $) "context" $) | nindent 14 }}
{{- end }}
{{- if .Values.tracking.ingress.extraRules }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.ingress.extraRules "context" $) | nindent 4 }}
{{- end }}
{{- if or (and .Values.tracking.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.tracking.ingress.annotations )) .Values.tracking.ingress.selfSigned)) .Values.tracking.ingress.extraTls }}
tls:
{{- if and .Values.tracking.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.tracking.ingress.annotations )) .Values.tracking.ingress.selfSigned) }}
- hosts:
- {{ .Values.tracking.ingress.hostname | quote }}
secretName: {{ printf "%s-tls" .Values.tracking.ingress.hostname }}
{{- end }}
{{- if .Values.tracking.ingress.extraTls }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.ingress.extraTls "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,103 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.networkPolicy.enabled }}
kind: NetworkPolicy
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
metadata:
name: {{ template "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.podLabels .Values.commonLabels ) "context" . ) }}
podSelector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
policyTypes:
- Ingress
- Egress
{{- if .Values.tracking.networkPolicy.allowExternalEgress }}
egress:
- {}
{{- else }}
egress:
# Allow dns resolution
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
# Allow connection to these sources for downloading models
- port: 80
- port: 443
- port: 22
# Allow outbound connections to other pods
- ports:
- port: {{ .Values.tracking.containerPorts.http }}
- port: {{ include "mlflow.v0.tracking.port" . }}
to:
- podSelector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 14 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
# Allow outbound connections to the database
- ports:
- port: {{ include "mlflow.v0.database.port" . }}
{{- if .Values.postgresql.enabled }}
to:
- podSelector:
matchLabels:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
# Allow outbound connections to the S3 backend
- ports:
- port: {{ include "mlflow.v0.s3.port" . }}
{{- if .Values.minio.enabled }}
- port: {{ .Values.minio.containerPorts.api }}
to:
- podSelector:
matchLabels:
app.kubernetes.io/name: minio
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- if .Values.tracking.networkPolicy.extraEgress }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.networkPolicy.extraEgress "context" $) | nindent 4 }}
{{- end }}
{{- end }}
ingress:
- ports:
- port: {{ .Values.tracking.containerPorts.http }}
- port: {{ include "mlflow.v0.tracking.port" . }}
from:
{{- if not .Values.tracking.networkPolicy.allowExternal }}
- podSelector:
matchLabels:
{{ template "common.names.fullname" . }}-client: "true"
{{- end }}
{{- if .Values.tracking.networkPolicy.ingressNSMatchLabels }}
- namespaceSelector:
matchLabels:
{{- range $key, $value := .Values.tracking.networkPolicy.ingressNSMatchLabels }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- if .Values.tracking.networkPolicy.ingressNSPodMatchLabels }}
podSelector:
matchLabels:
{{- range $key, $value := .Values.tracking.networkPolicy.ingressNSPodMatchLabels }}
{{ $key | quote }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.tracking.networkPolicy.extraIngress }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.networkPolicy.extraIngress "context" $) | nindent 4 }}
{{- end }}
{{- end }}
+30
View File
@@ -0,0 +1,30 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.tracking.pdb.minAvailable }}
minAvailable: {{ .Values.tracking.pdb.minAvailable }}
{{- end }}
{{- if or .Values.tracking.pdb.maxUnavailable ( not .Values.tracking.pdb.minAvailable ) }}
maxUnavailable: {{ .Values.tracking.pdb.maxUnavailable | default 1 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.tracking.podLabels .Values.commonLabels) "context" .) | fromYaml }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- end }}
+39
View File
@@ -0,0 +1,39 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.enabled .Values.tracking.persistence.enabled (not .Values.tracking.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.persistence.labels .Values.commonLabels ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if or .Values.tracking.persistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- if not (empty .Values.tracking.persistence.accessModes) }}
{{- range .Values.tracking.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
{{- else }}
- {{ .Values.tracking.persistence.accessMode | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.tracking.persistence.size | quote }}
{{- if .Values.tracking.persistence.selector }}
selector: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.persistence.selector "context" $) | nindent 4 }}
{{- end -}}
{{- include "common.storage.class" (dict "persistence" .Values.tracking.persistence "global" .Values.global) | nindent 2 }}
{{- if .Values.tracking.persistence.dataSource }}
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.persistence.dataSource "context" $) | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,20 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.tracking.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "mlflow.v0.tracking.serviceAccountName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if or .Values.tracking.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" ( list .Values.tracking.serviceAccount.annotations .Values.commonAnnotations ) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.tracking.serviceAccount.automountServiceAccountToken }}
{{- end }}
@@ -0,0 +1,59 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.tracking.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.tracking.service.labels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.tracking.service.labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.tracking.service.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" ( list .Values.tracking.service.annotations .Values.commonAnnotations ) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.tracking.service.type }}
{{- if and .Values.tracking.service.clusterIP (eq .Values.tracking.service.type "ClusterIP") }}
clusterIP: {{ .Values.tracking.service.clusterIP }}
{{- end }}
{{- if .Values.tracking.service.sessionAffinity }}
sessionAffinity: {{ .Values.tracking.service.sessionAffinity }}
{{- end }}
{{- if .Values.tracking.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.tracking.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.tracking.service.type "LoadBalancer") (eq .Values.tracking.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.tracking.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if and (eq .Values.tracking.service.type "LoadBalancer") (not (empty .Values.tracking.service.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.tracking.service.loadBalancerSourceRanges }}
{{- end }}
{{- if and (eq .Values.tracking.service.type "LoadBalancer") (not (empty .Values.tracking.service.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.tracking.service.loadBalancerIP }}
{{- end }}
ports:
- name: {{ include "mlflow.v0.tracking.portName" . }}
port: {{ get .Values.tracking.service.ports (include "mlflow.v0.tracking.protocol" .) }}
protocol: TCP
{{- if and (or (eq .Values.tracking.service.type "NodePort") (eq .Values.tracking.service.type "LoadBalancer")) (not (empty (get .Values.tracking.service.nodePorts (include "mlflow.v0.tracking.protocol" .)))) }}
nodePort: {{ get .Values.tracking.service.nodePorts (include "mlflow.v0.tracking.protocol" .) }}
{{- else if eq .Values.tracking.service.type "ClusterIP" }}
nodePort: null
{{- end }}
targetPort: {{ include "mlflow.v0.tracking.portName" . }}
{{- if .Values.tracking.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.tracking.podLabels .Values.commonLabels) "context" .) | fromYaml }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- end }}
@@ -0,0 +1,59 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.tracking.metrics.enabled .Values.tracking.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ default (include "common.names.namespace" .) .Values.tracking.metrics.serviceMonitor.namespace | quote }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.metrics.serviceMonitor.labels .Values.commonLabels ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if or .Values.tracking.metrics.serviceMonitor.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.metrics.serviceMonitor.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ .Values.tracking.metrics.serviceMonitor.jobLabel | quote }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.tracking.metrics.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.tracking.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}
endpoints:
- port: {{ include "mlflow.v0.tracking.portName" . }}
{{- if .Values.tracking.auth.enabled }}
basicAuth:
password:
key: {{ include "mlflow.v0.tracking.passwordKey" . }}
name: {{ include "mlflow.v0.tracking.secretName" . }}
username:
key: {{ include "mlflow.v0.tracking.userKey" . }}
name: {{ include "mlflow.v0.tracking.secretName" . }}
{{- end }}
path: "/metrics"
{{- if .Values.tracking.metrics.serviceMonitor.interval }}
interval: {{ .Values.tracking.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.tracking.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.tracking.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.tracking.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.tracking.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.tracking.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.tracking.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.tracking.metrics.serviceMonitor.relabelings }}
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.tracking.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "common.names.namespace" . | quote }}
{{- end }}
@@ -0,0 +1,30 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if (include "mlflow.v0.tracking.createTlsSecret" . ) }}
{{- $secretName := printf "%s-crt" (include "mlflow.v0.tracking.fullname" .) }}
{{- $ca := genCA "mlflow-ca" 365 }}
{{- $fullname := include "mlflow.v0.tracking.fullname" . }}
{{- $releaseNamespace := include "common.names.namespace" . }}
{{- $clusterDomain := .Values.clusterDomain }}
{{- $altNames := list (printf "*.%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) "127.0.0.1" $fullname }}
{{- $cert := genSignedCert $fullname nil $altNames 365 $ca }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: kubernetes.io/tls
data:
tls.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.crt" "defaultValue" $cert.Cert "context" $) }}
tls.key: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "tls.key" "defaultValue" $cert.Key "context" $) }}
ca.crt: {{ include "common.secrets.lookup" (dict "secret" $secretName "key" "ca.crt" "defaultValue" $ca.Cert "context" $) }}
{{- end }}
+47
View File
@@ -0,0 +1,47 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and (.Capabilities.APIVersions.Has "autoscaling.k8s.io/v1/VerticalPodAutoscaler") .Values.tracking.autoscaling.vpa.enabled }}
apiVersion: {{ include "common.capabilities.vpa.apiVersion" . }}
kind: VerticalPodAutoscaler
metadata:
name: {{ include "mlflow.v0.tracking.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
{{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.image "chart" .Chart ) ) }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.commonLabels $versionLabel ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/part-of: mlflow
app.kubernetes.io/component: tracking
{{- if or .Values.tracking.autoscaling.vpa.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.tracking.autoscaling.vpa.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
resourcePolicy:
containerPolicies:
- containerName: mlflow
{{- with .Values.tracking.autoscaling.vpa.controlledResources }}
controlledResources:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tracking.autoscaling.vpa.maxAllowed }}
maxAllowed:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tracking.autoscaling.vpa.minAllowed }}
minAllowed:
{{- toYaml . | nindent 8 }}
{{- end }}
targetRef:
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
name: {{ include "mlflow.v0.tracking.fullname" . }}
{{- if .Values.tracking.autoscaling.vpa.updatePolicy }}
updatePolicy:
{{- with .Values.tracking.autoscaling.vpa.updatePolicy.updateMode }}
updateMode: {{ . }}
{{- end }}
{{- end }}
{{- end }}