Add model registry v0.2.19

This commit is contained in:
wbsong111
2025-07-01 14:28:17 +09:00
parent f8d6965288
commit 6e83726fb3
68 changed files with 2018 additions and 0 deletions
@@ -0,0 +1,69 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- model-registry-db-pvc.yaml
- model-registry-db-deployment.yaml
- model-registry-db-service.yaml
- ../../base
configMapGenerator:
- envs:
- params.env
name: model-registry-db-parameters
secretGenerator:
- envs:
- secrets.env
name: model-registry-db-secrets
generatorOptions:
disableNameSuffixHash: true
images:
- name: mysql
newName: mysql
newTag: 8.3.0
patches:
- path: patches/model-registry-deployment.yaml
replacements:
- source:
fieldPath: metadata.name
kind: Service
name: model-registry-db
version: v1
targets:
- fieldPaths:
- spec.template.spec.containers.1.args.1
options:
delimiter: =
index: 1
select:
group: apps
kind: Deployment
name: model-registry-deployment
version: v1
- source:
fieldPath: data.MYSQL_PORT
kind: ConfigMap
name: model-registry-db-parameters
version: v1
targets:
- fieldPaths:
- spec.template.spec.containers.1.args.3
options:
delimiter: =
index: 1
select:
group: apps
kind: Deployment
name: model-registry-deployment
version: v1
- fieldPaths:
- spec.template.metadata.annotations.[traffic.sidecar.istio.io/excludeOutboundPorts]
select:
group: apps
kind: Deployment
name: model-registry-deployment
version: v1
@@ -0,0 +1,62 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: model-registry-db
labels:
component: db
spec:
selector:
matchLabels:
component: db
replicas: 1
strategy:
type: Recreate
template:
metadata:
name: db
labels:
component: db
sidecar.istio.io/inject: "false"
spec:
securityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
containers:
- name: db-container
image: mysql:8.3.0
args:
- --datadir
- /var/lib/mysql/datadir
- --default-authentication-plugin=mysql_native_password
envFrom:
- configMapRef:
name: model-registry-db-parameters
- secretRef:
name: model-registry-db-secrets
ports:
- name: dbapi
containerPort: 3306
readinessProbe:
exec:
command:
- "/bin/bash"
- "-c"
- "mysql -D $$MYSQL_DATABASE -u$$MYSQL_USER_NAME -p$$MYSQL_ROOT_PASSWORD -e 'SELECT 1'"
initialDelaySeconds: 5
periodSeconds: 2
timeoutSeconds: 1
volumeMounts:
- name: metadata-mysql
mountPath: /var/lib/mysql
securityContext:
runAsUser: 999
runAsGroup: 999
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumes:
- name: metadata-mysql
persistentVolumeClaim:
claimName: metadata-mysql
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: metadata-mysql
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: model-registry-db
labels:
component: db
spec:
type: ClusterIP
ports:
- port: 3306
protocol: TCP
name: dbapi
selector:
component: db
@@ -0,0 +1,3 @@
MYSQL_DATABASE=metadb
MYSQL_PORT=3306
MYSQL_ALLOW_EMPTY_PASSWORD=true
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: model-registry-deployment
spec:
template:
metadata:
annotations:
# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts: MYSQL_PORT_PLACEHOLDER
spec:
containers:
- name: rest-container
# Remove existing environment variables
env:
- $patch: replace
envFrom:
- configMapRef:
name: model-registry-configmap
args:
- --hostname=0.0.0.0
- --port=$(MODEL_REGISTRY_REST_SERVICE_PORT)
- --mlmd-hostname=localhost
- --mlmd-port=$(MODEL_REGISTRY_GRPC_SERVICE_PORT)
- --datastore-type=$(MODEL_REGISTRY_DATA_STORE_TYPE)
- name: grpc-container
# Remove existing environment variables
env:
- $patch: replace
envFrom:
- configMapRef:
name: model-registry-db-parameters
- secretRef:
name: model-registry-db-secrets
- configMapRef:
name: model-registry-configmap
args: ["--grpc_port=$(MODEL_REGISTRY_GRPC_SERVICE_PORT)",
"--mysql_config_host=MLMD_DB_HOST_PLACEHOLDER",
"--mysql_config_database=$(MYSQL_DATABASE)",
"--mysql_config_port=MYSQL_PORT_PLACEHOLDER",
"--mysql_config_user=$(MYSQL_USER_NAME)",
"--mysql_config_password=$(MYSQL_ROOT_PASSWORD)"]
@@ -0,0 +1,2 @@
MYSQL_USER_NAME=root
MYSQL_ROOT_PASSWORD=test