Git Product home page Git Product logo

metabase-gke's Introduction

Metabase in Google Kubernetes Engine

This repo demonstrates deploying Metabase as a docker container in Google Kubernetes Engine (GKE).

Kubernetes config

Specifically, this Kubernetes (k8s) configuration comprises:

  • k8-deployment.yaml
    Deployment of pod template with metabase docker image and "sidecar" container running GCP cloud sql proxy for database access.

  • k8-service.yaml
    NodePort service to open automatic "high port" on each node that the loadbalancer can proxy

  • k8-ingress.yaml
    Ingress resource that loadbalances traffic and terminates SSL/TLS. This configuration utilizes the "gce" loadbalancer class

Preparation

  • Download the GKE credentials:
gcloud container clusters get-credentials <cluster_name>
  • Apply GKE credentials as kubectl context:

    • List available contexts:
    kubectl config get-contexts
    • Set context:
    kubectl config use-context <context>
  • Reserve a GCP static ip:

gcloud compute addresses create metabase-ip --global
  • Modify ./metabase/k8-deployment.yaml:

    • replace <INSTANCE_CONNETION_STRING> with your cloud_sql_proxy connection string
    • Update all environment vars prefixed MB_DB_... to match your cloud_sql_proxy configuration
  • Create ./secrets/cloudsql-gcp-key.json with GCP service account key

  • Create metabase user credentials as text files:

echo -n "metabase" > secrets/metabase-db-username.txt
echo -n "password" > secrets/metabase-db-password.txt
  • Store the SSL/TLS cert and private key as secrets/tls.crt and secrets/tls.key

Run

Provided shell script k8.sh can create and delete this Kuberentes configuration in the cluster.

  • To create secrets, issue k8.sh secrets
  • Deploy metabase to the cluster with k8.sh create
  • Delete everything with k8.sh delete

Resources

metabase-gke's People

Contributors

zenyui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.