GKE on Google Cloud Platform Deployment
OpenMetadata supports the Installation and Running of Application on Google Kubernetes Engine through Helm Charts. However, there are some additional configurations which needs to be done as prerequisites for the same.
Google Kubernetes Engine (GKE) Auto Pilot Mode is not compatible with one of OpenMetadata Dependencies - ElasticSearch. The reason being that ElasticSearch Pods require Elevated permissions to run initContainers for changing configurations which is not allowed by GKE AutoPilot PodSecurityPolicy.
All the code snippets in this section assume the default
namespace for kubernetes.
Prerequisites
Cloud Database with CloudSQL and ElasticCloud for GCP as Search Engine
It is recommended to use GCP Cloud SQL services for Database and Elastic Cloud GCP for Search Engine for Production.
We support -
- Cloud SQL (MySQL) engine version 8 or higher
- Cloud SQL (postgreSQL) engine version 12 or higher
- ElasticSearch Engine version 8.X (upto 8.10.X)
We recommend -
- CloudSQL to be Multi Zone Available
- Elastic Cloud Environment with multiple zones and minimum 2 nodes
Once you have the Database and Search Engine configured and available, update the helm values below for OpenMetadata kubernetes deployments to connect with Database and ElasticSearch.
For Database as PostgreSQL, the use the below config for database values -
Persistent Volumes with ReadWriteMany Access Modes
OpenMetadata helm chart depends on Airflow and Airflow expects a persistent disk that support ReadWriteMany (the volume can be mounted as read-write by many nodes).
The workaround is to create nfs-server disk on Google Kubernetes Engine and use that as the persistent claim and deploy OpenMetadata by implementing the following steps in order.
Create NFS Share
Provision GCP Persistent Disk for Google Kubernetes Engine
Run the below command to create a gcloud compute zonal disk. For more information on Google Cloud Disk Options, please visit here.
Deploy NFS Server in GKE
Code Samples
Run the commands below and ensure the pods are running.
We create a ClusterIP Service for pods to access NFS within the cluster at a fixed IP/DNS.
Provision NFS backed PV and PVC for Airflow DAGs and Airflow Logs
Update <NFS_SERVER_CLUSTER_IP>
with the NFS Service Cluster IP Address for below code snippets. You can get the clusterIP using the following command
Code Samples for PV and PVC for Airflow DAGs
Create Persistent Volumes and Persistent Volume claims with the below command.
Code Samples for PV and PVC for Airflow Logs
Create Persistent Volumes and Persistent Volume claims with the below command.
Change owner and permission manually on disks
Since airflow pods run as non root users, they would not have write access on the nfs server volumes. In order to fix the permission here, spin up a pod with persistent volumes attached and run it once.
Airflow runs the pods with linux user name as airflow and linux user id as 50000.
Run the below command to create the pod and fix the permissions
Once the permissions pod is up and running, execute the below commands within the container.
Create OpenMetadata dependencies Values
Override openmetadata dependencies airflow helm values to bind the nfs persistent volumes for DAGs and logs.
For more information on airflow helm chart values, please refer to airflow-helm.
When deploying openmeteadata dependencies helm chart, use the below command -
The above command uses configurations defined here. You can modify any configuration and deploy by passing your own values.yaml
Once the openmetadata dependencies helm chart deployed, you can then run the below command to install the openmetadata helm chart -
Troubleshooting
Pods are stuck in Pending State due to Persistent Volume Creation Failure
If you came across invalid access type while creating the pvc
, and the permission pod is stuck in "pending" state.
The above error might have occurred due to the pvc volumes not setup or pvc volumes are not mounted properly.
Permission pod events
Please validate:
- all the prerequisites mentioned in this section
- the configuration of
dags_pv_pvc.yml
file storageClassName
field in YAML file