Coder Social home page Coder Social logo

esgf-kubernetes's Introduction

esgf-kubernetes

This repository contains configuration files for deploying the ESGF/Docker software stack on a Kubernetes cluster.

Quick Start

The following instructions describe how to deploy ESGF/Docker on a single-node minikube cluster, for the specific case of a Mac OSX laptop.

Pre-requisites

The following packages must be installed on your system:

  • kubectl
  • minikube
  • xhyve VM driver

Setup

Start minikube with enough memory:

minikube start --vm-driver=xhyve --memory=4096

Enable the Kubernetes Ingress controller:

minikube addons enable ingress

Define environment variables for the node hostname, and an empty directory that will contain the node specific configuration and secrets:

export ESGF_HOSTNAME="esgf.$(minikube ip).xip.io"
export ESGF_CONFIG=/Users/cinquini/data/ESGF_CONFIG_CEDA

Note: for OpenID authentication to work, the node hostname must be resolvable inside each Kubernetes Pod. Simply choosing a hostname and mapping it to the minikube node IP in /etc/hosts won't work...

Create the site configuration and certificates using the helper container that is part of the esgf-docker distribution. The resulting files (passwords and certificates) will be located under $ESGF_CONFIG:

cd <any directory>
git clone https://github.com/cedadev/esgf-helm.git
cd esgf-helm
docker-compose run esgf-setup generate-secrets
docker-compose run esgf-setup generate-test-certificates
docker-compose run esgf-setup create-trust-bundle

Deployment

Run the following script to create Kubernetes ConfigMap and Secret objects that contain the certificates and passwords from the $ESGF_CONFIG directory:

cd <any directory>
git clone https://github.com/LucaCinquini/esgf-kubernetes.git
cd esgf-kubernetes
./SCRIPTS/setup.sh 

Run the follwing script to create Kubernetes Deployment and Service objects. The created Pods will host the ESGF/Docker containers.

./SCRIPTS/deploy.sh

Wait untill all Pods are running in a stable state:

kubectl get pods -l stack=esgf

Testing

Test basic functionality of the ESGF services. In the URLs below, replace the node hostname with your specific value for $ESGF_HOSTNAME.

Cleanup

To simply stop the Kubernetes cluster (all Pods will be restarted when the cluster is restarted):

minikube stop

To completely delete all ESGF Kubernetes objects, run the following script:

./SCRIPTS/cleanup.sh

and then stop minikube.

Other Notes

  • To connect to the postgres databse from inside its container:

    kubectl get pods
    kubectl exec -it <postgres pod id> -- /bin/bash
    psql -U dbsuper esgcet
    [no password necessary]
    

esgf-kubernetes's People

Contributors

lucacinquini avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fgreg 00mjk

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.