Skip to content

Commit

Permalink
Manifests: Rename metadata gRPC server's resources to metadata-grpc-*
Browse files Browse the repository at this point in the history
The metadata service deployed is a gRPC server.

Proper KF installation deploys both an HTTP server, naming the required
resources as 'metadata-deployment' and 'metadata-service', as well as a
gRPC server, naming the corresponding resources
'metadata-grpc-deployment' and 'metadata-grpc-service'.

KFP standalone installation manifests deploy solely the gRPC server, but
use naming identical to the KF's HTTP server one.
Applying them on top of an existing KF cluster breaks Metadata service.

In this PR we change the naming making it not diverge from a proper KF
installation. We also make MetadataWriter aware of that change.

Closes kubeflow#2889.

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
  • Loading branch information
elikatsis committed Feb 18, 2020
1 parent 9f328a7 commit 3d828d0
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 26 deletions.
6 changes: 4 additions & 2 deletions backend/metadata_writer/src/metadata_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@


def connect_to_mlmd() -> metadata_store.MetadataStore:
metadata_service_host = os.environ.get('METADATA_SERVICE_SERVICE_HOST', 'metadata-service')
metadata_service_port = int(os.environ.get('METADATA_SERVICE_SERVICE_PORT', 8080))
metadata_service_host = os.environ.get(
'METADATA_GRPC_SERVICE_SERVICE_HOST', 'metadata-grpc-service')
metadata_service_port = int(os.environ.get(
'METADATA_GRPC_SERVICE_SERVICE_PORT', 8080))

mlmd_connection_config = metadata_store_pb2.MetadataStoreClientConfig(
host=metadata_service_host,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ metadata:
labels:
app: metadata
app.kubernetes.io/name: {{ .Release.Name }}
name: metadata-service
name: metadata-grpc-service
spec:
ports:
- name: md-backendapi
port: 8080
protocol: TCP
selector:
component: metadata-server
component: metadata-grpc-server
app.kubernetes.io/name: {{ .Release.Name }}
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
labels:
component: metadata-server
component: metadata-grpc-server
app.kubernetes.io/name: {{ .Release.Name }}
name: metadata-deployment
name: metadata-grpc-deployment
spec:
replicas: 1
selector:
matchLabels:
component: metadata-server
component: metadata-grpc-server
app.kubernetes.io/name: {{ .Release.Name }}
template:
metadata:
labels:
component: metadata-server
component: metadata-grpc-server
app.kubernetes.io/name: {{ .Release.Name }}
spec:
containers:
Expand Down Expand Up @@ -129,7 +129,7 @@ kind: ConfigMap
metadata:
name: metadata-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
{{ if .Values.managedstorage.databaseNamePrefix }}
mysql_database: '{{ .Values.managedstorage.databaseNamePrefix }}_metadata'
Expand All @@ -146,7 +146,7 @@ kind: ConfigMap
metadata:
name: metadata-mysql-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
{{ if .Values.managedstorage.databaseNamePrefix }}
MYSQL_DATABASE: '{{ .Values.managedstorage.databaseNamePrefix }}_metadata'
Expand All @@ -163,9 +163,9 @@ kind: ConfigMap
metadata:
name: metadata-grpc-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
METADATA_GRPC_SERVICE_HOST: "metadata-service"
METADATA_GRPC_SERVICE_HOST: "metadata-grpc-service"
METADATA_GRPC_SERVICE_PORT: "8080"
---
apiVersion: apps/v1
Expand Down
18 changes: 18 additions & 0 deletions manifests/kustomize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ kubectl kustomize base/crds | kubectl delete -f -
```

## Upgrade
Note - Do **NOT** follow these instructions if you are upgrading KFP in a
proper Kubeflow installation.

If you have already deployed a standalone KFP installation and you want to
upgrade it, make sure the following resources do not exist:
`metadata-deployment`, `metadata-service`.
```
kubectl -n <KFP_NAMESPACE> get deployments | grep metadata-deployment
kubectl -n <KFP_NAMESPACE> get service | grep metadata-service
```

If they exist, you can delete them by running the following commands:
```
kubectl -n <KFP_NAMESPACE> delete deployment metadata-deployment
kubectl -n <KFP_NAMESPACE> delete service metadata-service
```

## Troubleshooting

### Permission error installing Kubeflow Pipelines to a cluster
Expand Down
4 changes: 2 additions & 2 deletions manifests/kustomize/base/metadata/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: Kustomization
resources:
- metadata-configmap.yaml
- metadata-mysql-secret.yaml
- metadata-deployment.yaml
- metadata-service.yaml
- metadata-grpc-deployment.yaml
- metadata-grpc-service.yaml
- metadata-envoy-deployment.yaml
- metadata-envoy-service.yaml
- metadata-writer-deployment.yaml
Expand Down
8 changes: 4 additions & 4 deletions manifests/kustomize/base/metadata/metadata-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: ConfigMap
metadata:
name: metadata-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
mysql_database: "metadb"
mysql_host: "mysql"
Expand All @@ -15,7 +15,7 @@ kind: ConfigMap
metadata:
name: metadata-mysql-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
MYSQL_DATABASE: "metadb"
MYSQL_HOST: "mysql"
Expand All @@ -26,7 +26,7 @@ kind: ConfigMap
metadata:
name: metadata-grpc-configmap
labels:
component: metadata-server
component: metadata-grpc-server
data:
METADATA_GRPC_SERVICE_HOST: "metadata-service"
METADATA_GRPC_SERVICE_HOST: "metadata-grpc-service"
METADATA_GRPC_SERVICE_PORT: "8080"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: metadata-envoy
name: metadata-envoy-deployment
labels:
component: metadata-envoy
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
labels:
app: metadata
app: metadata-envoy
name: metadata-envoy-service
spec:
selector:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: metadata-deployment
name: metadata-grpc-deployment
labels:
component: metadata-server
component: metadata-grpc-server
spec:
replicas: 1
selector:
matchLabels:
component: metadata-server
component: metadata-grpc-server
template:
metadata:
labels:
component: metadata-server
component: metadata-grpc-server
spec:
containers:
- name: container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ apiVersion: v1
metadata:
labels:
app: metadata
name: metadata-service
name: metadata-grpc-service
spec:
selector:
component: metadata-server
component: metadata-grpc-server
type: ClusterIP
ports:
- port: 8080
Expand Down

0 comments on commit 3d828d0

Please sign in to comment.