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

Metadata: Adding metadata-grpc config map #2723

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ spec:
- name: MYSQL_DATABASE
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_database
name: metadata-mysql-configmap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this around and add a new config map to maintain backward compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

key: MYSQL_DATABASE
- name: MYSQL_HOST
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_host
name: metadata-mysql-configmap
key: MYSQL_HOST
- name: MYSQL_PORT
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_port
name: metadata-mysql-configmap
key: MYSQL_PORT
command: ["/bin/metadata_store_server"]
args: ["--grpc_port=8080",
"--mysql_config_database=$(MYSQL_DATABASE)",
Expand Down Expand Up @@ -140,3 +140,30 @@ data:
mysql_port: "3306"
username: "root"
password: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: metadata-mysql-configmap
labels:
component: metadata-server
data:
{{ if .Values.managedstorage.databaseNamePrefix }}
MYSQL_DATABASE: '{{ .Values.managedstorage.databaseNamePrefix }}_metadata'
{{ else }}
mysql_database: '{{ .Release.Name | replace "-" "_" | replace "." "_"}}_metadata'
{{ end }}
MYSQL_HOST: "mysql"
MYSQL_PORT: "3306"
username: "root"
password: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: metadata-grpc-configmap
labels:
component: metadata-server
data:
METADATA_GRPC_SERVICE_HOST: "metadata-service"
METADATA_GRPC_SERVICE_PORT: "8080"
22 changes: 22 additions & 0 deletions manifests/kustomize/base/metadata/metadata-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# metadata-config is retained for backward compatibility reasons.
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -8,3 +9,24 @@ data:
mysql_database: "metadb"
mysql_host: "mysql"
mysql_port: "3306"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: metadata-mysql-configmap
labels:
component: metadata-server
data:
MYSQL_DATABASE: "metadb"
MYSQL_HOST: "mysql"
MYSQL_PORT: "3306"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: metadata-grpc-configmap
labels:
component: metadata-server
data:
METADATA_GRPC_SERVICE_HOST: "metadata-service"
METADATA_GRPC_SERVICE_PORT: "8080"
12 changes: 6 additions & 6 deletions manifests/kustomize/base/metadata/metadata-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ spec:
- name: MYSQL_DATABASE
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_database
name: metadata-mysql-configmap
key: MYSQL_DATABASE
- name: MYSQL_HOST
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_host
name: metadata-mysql-configmap
key: MYSQL_HOST
- name: MYSQL_PORT
valueFrom:
configMapKeyRef:
name: metadata-configmap
key: mysql_port
name: metadata-mysql-configmap
key: MYSQL_PORT
command: ["/bin/metadata_store_server"]
args: ["--grpc_port=8080",
"--mysql_config_database=$(MYSQL_DATABASE)",
Expand Down