Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[manifests] Fix kustomization build warnings #813

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion manifests/kustomize/base/model-registry-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
args: ["--grpc_port=9090",
"--mysql_config_database=$(MYSQL_DATABASE)",
"--mysql_config_host=$(MYSQL_HOST)",
"--mysql_config_port=$(MYSQL_PORT)",
"--mysql_config_port=MYSQL_PORT_PLACEHOLDER",
"--mysql_config_user=$(DBCONFIG_USER)",
"--mysql_config_password=$(DBCONFIG_PASSWORD)",
"--enable_database_upgrade=true"
Expand Down
49 changes: 37 additions & 12 deletions manifests/kustomize/overlays/db/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ resources:
- model-registry-db-service.yaml
- ../../base

patchesStrategicMerge:
- patches/model-registry-deployment.yaml

configMapGenerator:
- envs:
Expand All @@ -28,18 +26,45 @@ images:
newName: mysql
newTag: 8.0.39

vars:
- fieldref:
patches:
- path: patches/model-registry-deployment.yaml
replacements:
- source:
fieldPath: metadata.name
name: MLMD_DB_HOST
objref:
apiVersion: v1
kind: Service
name: model-registry-db
- name: MYSQL_PORT
objref:
version: v1
targets:
- fieldPaths:
- spec.template.spec.containers.1.args.1
options:
delimiter: =
index: 1
select: {}
- source:
fieldPath: data.MYSQL_PORT
kind: ConfigMap
name: model-registry-db-parameters
apiVersion: v1
fieldref:
fieldpath: data.MYSQL_PORT
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.[# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts]
select: {}
- fieldPaths:
- spec.template.spec.containers.1.args.3
options:
delimiter: =
index: 1
select: {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
metadata:
annotations:
# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts: $(MYSQL_PORT)
traffic.sidecar.istio.io/excludeOutboundPorts: MYSQL_PORT_PLACEHOLDER
spec:
containers:
- name: rest-container
Expand All @@ -34,8 +34,8 @@ spec:
- configMapRef:
name: model-registry-configmap
args: ["--grpc_port=$(MODEL_REGISTRY_GRPC_SERVICE_PORT)",
"--mysql_config_host=$(MLMD_DB_HOST)",
"--mysql_config_host=MLMD_DB_HOST_PLACEHOLDER",
"--mysql_config_database=$(MYSQL_DATABASE)",
"--mysql_config_port=$(MYSQL_PORT)",
"--mysql_config_port=MYSQL_PORT_PLACEHOLDER",
"--mysql_config_user=$(MYSQL_USER_NAME)",
"--mysql_config_password=$(MYSQL_ROOT_PASSWORD)"]
52 changes: 33 additions & 19 deletions manifests/kustomize/overlays/postgres/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow

bases:
- ../../base
resources:
- model-registry-db-pvc.yaml
- model-registry-db-deployment.yaml
- model-registry-db-service.yaml
- ../../base

patchesStrategicMerge:
- patches/model-registry-deployment.yaml

configMapGenerator:
- name: metadata-registry-db-parameters
envs:
- envs:
- params.env
name: metadata-registry-db-parameters
secretGenerator:
- name: metadata-registry-db-secrets
envs:
- envs:
- secrets.env
name: metadata-registry-db-secrets
generatorOptions:
disableNameSuffixHash: true

Expand All @@ -28,18 +25,35 @@ images:
newName: postgres
newTag: 14.7-alpine3.17

vars:
- name: MLMD_DB_HOST
objref:
patches:
- path: patches/model-registry-deployment.yaml
replacements:
- source:
fieldPath: metadata.name
kind: Service
name: metadata-postgres-db
apiVersion: v1
fieldref:
fieldpath: metadata.name
- name: POSTGRES_PORT
objref:
version: v1
targets:
- fieldPaths:
- spec.template.spec.containers.0.args.2
options:
delimiter: =
index: 1
select: {}
- source:
fieldPath: data.POSTGRES_PORT
kind: ConfigMap
name: metadata-registry-db-parameters
apiVersion: v1
fieldref:
fieldpath: data.POSTGRES_PORT
version: v1
targets:
- fieldPaths:
- |-
spec.template.metadata.annotations.[# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts]
select: {}
- fieldPaths:
- spec.template.spec.containers.0.args.3
options:
delimiter: =
index: 1
select: {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
metadata:
annotations:
# db doesn't use istio
traffic.sidecar.istio.io/excludeOutboundPorts: $(POSTGRES_PORT)
traffic.sidecar.istio.io/excludeOutboundPorts: POSTGRES_PORT_PLACEHOLDER
spec:
containers:
- name: grpc-container
Expand All @@ -23,8 +23,8 @@ spec:
name: model-registry-configmap
args: ["--grpc_port=$(MODEL_REGISTRY_GRPC_SERVICE_PORT)",
"--metadata_source_config_type=postgresql",
"--postgres_config_host=$(MLMD_DB_HOST)",
"--postgres_config_port=$(POSTGRES_PORT)",
"--postgres_config_host=MLMD_DB_HOST_PLACEHOLDER",
"--postgres_config_port=POSTGRES_PORT_PLACEHOLDER",
"--postgres_config_dbname=$(POSTGRES_DBNAME)",
"--postgres_config_user=$(POSTGRES_USER)",
"--postgres_config_password=$(POSTGRES_PASSWORD)",
Expand Down
Loading